Skip to content

Commit

Permalink
cardano-node: fix for client metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
jutaro committed Oct 24, 2024
1 parent 387a454 commit c84c8fc
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,8 @@ instance ConvertRawHash blk
<> [ "risingEdge" .= True | RisingEdge <- [enclosing] ]

asMetrics (TraceChainSyncServerUpdate _tip (AddBlock _pt) _blocking FallingEdge) =
[CounterM "headersServed.falling" Nothing]
asMetrics (TraceChainSyncServerUpdate _tip (AddBlock _pt) _blocking _) =
[CounterM "headersServed" Nothing]
[CounterM "served.header" Nothing]
asMetrics (TraceChainSyncServerUpdate _tip (AddBlock _pt) _blocking _) = []
asMetrics _ = []

instance MetaTrace (TraceChainSyncServerEvent blk) where
Expand All @@ -487,8 +486,7 @@ instance MetaTrace (TraceChainSyncServerEvent blk) where
severityFor _ _ = Nothing

metricsDocFor (Namespace _ ["Update"]) =
[ ("served.header", "A counter triggered on any header event")
, ("served.header.falling",
[ ("served.header",
"A counter triggered only on header event with falling edge")]
metricsDocFor _ = []

Expand Down Expand Up @@ -622,6 +620,8 @@ calculateBlockFetchClientMetrics cm@ClientMetrics {..} _lc
, cmCdf5sVar = thd3 updatedMetrics
, cmDelay = realToFrac forgeDelay
, cmBlockSize = getSizeInBytes blockSize
, cmTraceVars = True
, cmTraceIt = True
, cmSlotMap = slotMap'' }

updateMetrics slotMap' _slotNo =
Expand All @@ -633,12 +633,17 @@ calculateBlockFetchClientMetrics cm@ClientMetrics {..} _lc
, cmCdf5sVar = thd3 updatedMetrics
, cmDelay = realToFrac forgeDelay
, cmBlockSize = getSizeInBytes blockSize
, cmTraceVars = True
, cmTraceIt = True
, cmSlotMap = slotMap' }
else pure cm
{ cmCdf1sVar = fst3 updatedMetrics
, cmCdf3sVar = snd3 updatedMetrics
, cmCdf5sVar = thd3 updatedMetrics
, cmDelay = realToFrac forgeDelay
, cmBlockSize = getSizeInBytes blockSize
, cmTraceVars = False
, cmTraceIt = True
, cmSlotMap = slotMap' }

updateCDFs minDelay forgeDelay' =
Expand Down

0 comments on commit c84c8fc

Please sign in to comment.