diff --git a/haskell-perf.cabal b/haskell-perf.cabal index e49720f..e4dd3fb 100644 --- a/haskell-perf.cabal +++ b/haskell-perf.cabal @@ -129,3 +129,4 @@ executable stat-collector , streamly , containers , ansi-terminal + , unix diff --git a/stat-collector-src/Main.hs b/stat-collector-src/Main.hs index 64098f5..b655a63 100644 --- a/stat-collector-src/Main.hs +++ b/stat-collector-src/Main.hs @@ -25,6 +25,7 @@ import Streamly.Internal.Data.Tuple.Strict (Tuple3Fused' (Tuple3Fused')) import Streamly.Unicode.String (str) import System.IO (hFlush, stdout, stdin) import Text.Read (readMaybe) +import System.Posix.Signals (installHandler, Handler(Catch), sigINT, sigTERM) import qualified Data.Map as Map import qualified Streamly.Data.Fold as Fold @@ -285,12 +286,13 @@ printSlidingStats winSizeList counter rowsOnPage strm = main :: IO () main = do let rowsOnPage = 50 - windowSize = 30 + windowSize = 50 counter = CpuTime - freqMeasurementWindow = 30 + freqMeasurementWindow = 5 tidToInstrument = 21 mainTag = "server" lastCounter = Allocated + _ <- installHandler sigINT (Catch $ ANSI.showCursor) Nothing ANSI.hideCursor ANSI.clearScreen (winSizeList, rest) <- Stream.unfold Handle.chunkReader stdin