From 54379ecff9cd9d123a033fa183cbe10fa9695c8f Mon Sep 17 00:00:00 2001 From: Edmund Noble Date: Tue, 18 Jun 2024 10:30:05 -0400 Subject: [PATCH] log: telemetry log current cut periodically, instead of on changes This makes telemetry more reliable in the case of stalls and also much less expensive in terms of disk space. Change-Id: I28b5efa9d89323b1e381c1bd9085e46fb9afb040 --- changes/2024-06-19T182508-0400.txt | 2 ++ node/ChainwebNode.hs | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 changes/2024-06-19T182508-0400.txt diff --git a/changes/2024-06-19T182508-0400.txt b/changes/2024-06-19T182508-0400.txt new file mode 100644 index 000000000..d9efe7e6e --- /dev/null +++ b/changes/2024-06-19T182508-0400.txt @@ -0,0 +1,2 @@ +Log current cut periodically, instead of when it changes, for more +consistency and less space use. diff --git a/node/ChainwebNode.hs b/node/ChainwebNode.hs index 9cfd59180..057f33e48 100644 --- a/node/ChainwebNode.hs +++ b/node/ChainwebNode.hs @@ -215,9 +215,9 @@ runMonitorLoop actionLabel logger = runForeverThrottled runCutMonitor :: Logger logger => logger -> CutDb tbl -> IO () runCutMonitor logger db = L.withLoggerLabel ("component", "cut-monitor") logger $ \l -> runMonitorLoop "ChainwebNode.runCutMonitor" l $ do - S.mapM_ (logFunctionJson l Info) - $ S.map (cutToCutHashes Nothing) - $ cutStream db + logFunctionJson l Info . cutToCutHashes Nothing + =<< _cut db + threadDelay 15_000_000 data BlockUpdate = BlockUpdate { _blockUpdateBlockHeader :: !(ObjectEncoded BlockHeader)