Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ allow-newer:
source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-consensus
tag: e3803b0c86fc0b5f0a7b8f3a977aebf5afe31b8b
--sha256: sha256-PxhS4cB4pnP+izLMOTfsyjrEUCsW2aSEMUKl603Bpk4=
tag: 52eb268ae0fa22c6f1b35fd3cf7642dedd6f63cc
--sha256: sha256-8gY1Ux96k/ghBg2njjvVlCfo/MIFLc6kE3F+47hpSIE=

-- Points to cardano-ledger/leios-prototype
source-repository-package
Expand Down
27 changes: 27 additions & 0 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,16 @@ instance
mconcat
[ "kind" .= String "TraceMempoolTipMovedBetweenSTMBlocks"
]
forMachine dtal (TraceMempoolCacheHit point)=
mconcat
[ "kind" .= String "TraceMempoolCacheHit"
, "point" .= forMachine dtal point
]
forMachine dtal (TraceMempoolCacheMiss point)=
mconcat
[ "kind" .= String "TraceMempoolCacheMiss"
, "point" .= forMachine dtal point
]

asMetrics (TraceMempoolAddedTx _tx _mpSzBefore mpSz) =
[ IntM "txsInMempool" (fromIntegral $ msNumTxs mpSz)
Expand Down Expand Up @@ -1201,6 +1211,8 @@ instance
asMetrics TraceMempoolAttemptingAdd {} = []

asMetrics TraceMempoolTipMovedBetweenSTMBlocks {} = []
asMetrics TraceMempoolCacheHit {} = [ CounterM "mempool.cache-hit-count" (Just 1) ]
asMetrics TraceMempoolCacheMiss {} = [ CounterM "mempool.cache-miss-count" (Just 1) ]

instance LogFormatting MempoolSize where
forMachine _dtal MempoolSize{msNumTxs, msNumBytes} =
Expand All @@ -1219,6 +1231,8 @@ instance MetaTrace (TraceEventMempool blk) where
namespaceFor TraceMempoolSyncNotNeeded {} = Namespace [] ["SyncNotNeeded"]
namespaceFor TraceMempoolAttemptingAdd {} = Namespace [] ["AttemptAdd"]
namespaceFor TraceMempoolTipMovedBetweenSTMBlocks {} = Namespace [] ["TipMovedBetweenSTMBlocks"]
namespaceFor TraceMempoolCacheHit {} = Namespace [] ["CacheHit"]
namespaceFor TraceMempoolCacheMiss {} = Namespace [] ["CacheMiss"]


severityFor (Namespace _ ["AddedTx"]) _ = Just Info
Expand All @@ -1229,6 +1243,8 @@ instance MetaTrace (TraceEventMempool blk) where
severityFor (Namespace _ ["SyncNotNeeded"]) _ = Just Debug
severityFor (Namespace _ ["AttemptAdd"]) _ = Just Debug
severityFor (Namespace [] ["TipMovedBetweenSTMBlocks"]) _ = Just Debug
severityFor (Namespace [] ["CacheHit"]) _ = Just Info
severityFor (Namespace [] ["CacheMiss"]) _ = Just Info
severityFor _ _ = Nothing

metricsDocFor (Namespace _ ["AddedTx"]) =
Expand All @@ -1253,6 +1269,11 @@ instance MetaTrace (TraceEventMempool blk) where
[ ("txsSyncDuration", "Latest time to sync the mempool in ms after block adoption")
, (txsSyncDurationTotalCounterName, "Cumulative time spent syncing the mempool in ms after block adoption")
]
metricsDocFor (Namespace _ ["CacheHit"]) =
[ ("mempool.cache-hit-count", "Total count of cache hits") ]
metricsDocFor (Namespace _ ["CacheMiss"]) =
[ ("mempool.cache-miss-count", "Total count of cache hits")
]
metricsDocFor _ = []

documentFor (Namespace _ ["AddedTx"]) = Just
Expand All @@ -1276,6 +1297,10 @@ instance MetaTrace (TraceEventMempool blk) where
"Mempool is about to try to validate and add a transaction."
documentFor (Namespace _ ["TipMovedBetweenSTMBlocks"]) = Just
"LedgerDB moved to an alternative fork between two reads during re-sync."
documentFor (Namespace _ ["CacheHit"]) = Just
"Forge got a cache hit."
documentFor (Namespace _ ["CacheMiss"]) = Just
"Forge got a cache miss."
documentFor _ = Nothing

allNamespaces =
Expand All @@ -1287,6 +1312,8 @@ instance MetaTrace (TraceEventMempool blk) where
, Namespace [] ["SyncNotNeeded"]
, Namespace [] ["AttemptAdd"]
, Namespace [] ["TipMovedBetweenSTMBlocks"]
, Namespace [] ["CacheHit"]
, Namespace [] ["CacheMiss"]
]

--------------------------------------------------------------------------------
Expand Down
12 changes: 12 additions & 0 deletions cardano-node/src/Cardano/Tracing/OrphanInstances/Consensus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ instance HasSeverityAnnotation (TraceEventMempool blk) where
getSeverityAnnotation TraceMempoolSyncNotNeeded{} = Debug
getSeverityAnnotation TraceMempoolSynced{} = Debug
getSeverityAnnotation TraceMempoolAttemptingAdd{} = Debug
getSeverityAnnotation TraceMempoolCacheHit{} = Info
getSeverityAnnotation TraceMempoolCacheMiss{} = Info

instance HasPrivacyAnnotation ()
instance HasSeverityAnnotation () where
Expand Down Expand Up @@ -1623,6 +1625,16 @@ instance ( ToObject (ApplyTxErr blk), ToObject (GenTx blk)
mconcat
[ "kind" .= String "TraceMempoolTipMovedBetweenSTMBlocks"
]
toObject verb (TraceMempoolCacheHit point)=
mconcat
[ "kind" .= String "TraceMempoolCacheHit"
, "point" .= toObject verb point
]
toObject verb (TraceMempoolCacheMiss point)=
mconcat
[ "kind" .= String "TraceMempoolCacheMiss"
, "point" .= toObject verb point
]

instance ToObject MempoolSize where
toObject _verb MempoolSize{msNumTxs, msNumBytes} =
Expand Down
Loading