Skip to content

Commit f6ce1f7

Browse files
jutaromgmeier
authored andcommitted
cardano-node: make forge metrics counters
1 parent a4167e5 commit f6ce1f7

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ import Cardano.Node.Tracing.Formatting ()
3232
import Cardano.Node.Tracing.Render
3333
import Cardano.Node.Tracing.Tracers.ConsensusStartupException ()
3434
import Cardano.Node.Tracing.Tracers.StartLeadershipCheck
35-
import Cardano.Tracing.OrphanInstances.Network (Verbose (..))
3635
import Cardano.Protocol.TPraos.OCert (KESPeriod (..))
3736
import Cardano.Slotting.Slot (WithOrigin (..))
37+
import Cardano.Tracing.OrphanInstances.Network (Verbose (..))
3838
import Ouroboros.Consensus.Block
3939
import Ouroboros.Consensus.BlockchainTime (SystemStart (..))
4040
import Ouroboros.Consensus.BlockchainTime.WallClock.Util (TraceBlockchainTimeEvent (..))
@@ -1754,37 +1754,37 @@ instance ( tx ~ GenTx blk
17541754
])
17551755

17561756

1757-
asMetrics (TraceStartLeadershipCheck slot) =
1758-
[IntM "Forge.about-to-lead" (fromIntegral $ unSlotNo slot)]
1759-
asMetrics (TraceSlotIsImmutable slot _tipPoint _tipBlkNo) =
1760-
[IntM "Forge.slot-is-immutable" (fromIntegral $ unSlotNo slot)]
1761-
asMetrics (TraceBlockFromFuture slot _slotNo) =
1762-
[IntM "Forge.block-from-future" (fromIntegral $ unSlotNo slot)]
1763-
asMetrics (TraceNoLedgerState slot _) =
1764-
[IntM "Forge.could-not-forge" (fromIntegral $ unSlotNo slot)]
1765-
asMetrics (TraceNoLedgerView slot _) =
1766-
[IntM "Forge.could-not-forge" (fromIntegral $ unSlotNo slot)]
1757+
asMetrics (TraceStartLeadershipCheck _slot) =
1758+
[CounterM "Forge.about-to-lead" Nothing]
1759+
asMetrics (TraceSlotIsImmutable _slot _tipPoint _tipBlkNo) =
1760+
[CounterM "Forge.slot-is-immutable" Nothing]
1761+
asMetrics (TraceBlockFromFuture _slot _slotNo) =
1762+
[CounterM "Forge.block-from-future" Nothing]
1763+
asMetrics (TraceNoLedgerState _slot _) =
1764+
[CounterM "Forge.could-not-forge"Nothing]
1765+
asMetrics (TraceNoLedgerView _slot _) =
1766+
[CounterM "Forge.could-not-forge" Nothing]
17671767
asMetrics (TraceLedgerView _) = []
17681768
asMetrics TraceBlockContext {} = []
17691769
asMetrics (TraceLedgerState _ _) = []
1770-
asMetrics (TraceNodeCannotForge slot _reason) =
1771-
[IntM "Forge.could-not-forge" (fromIntegral $ unSlotNo slot)]
1772-
asMetrics (TraceNodeNotLeader slot) =
1773-
[IntM "Forge.node-not-leader" (fromIntegral $ unSlotNo slot)]
1774-
asMetrics (TraceNodeIsLeader slot) =
1775-
[IntM "Forge.node-is-leader" (fromIntegral $ unSlotNo slot)]
1770+
asMetrics (TraceNodeCannotForge _slot _reason) =
1771+
[CounterM "Forge.could-not-forge" Nothing]
1772+
asMetrics (TraceNodeNotLeader _slot) =
1773+
[CounterM "Forge.node-not-leader" Nothing]
1774+
asMetrics (TraceNodeIsLeader _slot) =
1775+
[CounterM "Forge.node-is-leader" Nothing]
17761776
asMetrics TraceForgeTickedLedgerState {} = []
17771777
asMetrics TraceForgingMempoolSnapshot {} = []
1778-
asMetrics (TraceForgedBlock slot _ _ _) =
1779-
[IntM "Forge.forged" (fromIntegral $ unSlotNo slot)]
1780-
asMetrics (TraceDidntAdoptBlock slot _) =
1781-
[IntM "Forge.didnt-adopt" (fromIntegral $ unSlotNo slot)]
1782-
asMetrics (TraceForgedInvalidBlock slot _ _) =
1783-
[IntM "Forge.forged-invalid" (fromIntegral $ unSlotNo slot)]
1784-
asMetrics (TraceAdoptedBlock slot _ _) =
1785-
[IntM "Forge.adopted" (fromIntegral $ unSlotNo slot)]
1786-
asMetrics (TraceAdoptionThreadDied slot _) =
1787-
[IntM "Forge.adoption-thread-died" (fromIntegral $ unSlotNo slot)]
1778+
asMetrics (TraceForgedBlock _slot _ _ _) =
1779+
[CounterM "Forge.forged" Nothing]
1780+
asMetrics (TraceDidntAdoptBlock _slot _) =
1781+
[CounterM "Forge.didnt-adopt" Nothing]
1782+
asMetrics (TraceForgedInvalidBlock _slot _ _) =
1783+
[CounterM "Forge.forged-invalid" Nothing]
1784+
asMetrics (TraceAdoptedBlock _slot _ _) =
1785+
[CounterM "Forge.adopted" Nothing]
1786+
asMetrics (TraceAdoptionThreadDied _slot _) =
1787+
[CounterM "Forge.adoption-thread-died" Nothing]
17881788

17891789
instance MetaTrace (TraceForgeEvent blk) where
17901790
namespaceFor TraceStartLeadershipCheck {} =

0 commit comments

Comments
 (0)