1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00

Add back strictness

This commit is contained in:
Rick Winfrey 2017-03-23 16:50:34 -07:00
parent 9fe095474f
commit 1604f6ca34

View File

@ -1,5 +1,5 @@
-- | We use BangPatterns to force evaluation of git operations to preserve accuracy in measuring system stats (particularly disk read bytes)
{-# LANGUAGE RecordWildCards, DeriveGeneric, RankNTypes #-}
{-# LANGUAGE RecordWildCards, BangPatterns, DeriveGeneric, RankNTypes #-}
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
module GitmonClient where
@ -85,7 +85,8 @@ reportGitmon' SocketFactory{..} program gitCommand =
gitmonStatus <- safeGitmonIO $ recv socket' 1024
(startTime, beforeProcIOContents) <- collectStats
let result = withGitmonStatus gitmonStatus gitCommand
-- | We are eagerly evaluating the gitCommand with BangPatterns. This is to preserve accuracy in measuring the process stats calculated, in particular disk read bytes.
let !result = withGitmonStatus gitmonStatus gitCommand
(afterTime, afterProcIOContents) <- collectStats
let (cpuTime, diskReadBytes, diskWriteBytes, resultCode) = procStats startTime afterTime beforeProcIOContents afterProcIOContents