Skip to content
Merged
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 @@ -101,8 +101,8 @@ constraints:
source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-consensus
tag: 86cc78704115007dc6c75185ae83decaa8e89348
--sha256: sha256-K/q+sxmDrCaNEjAicoDYZwLc8gSw+Kw4mO0qbM8MujU=
tag: 8f0e1423c99bcfa0025ae5476a5467a4af0d2828
--sha256: sha256-/1hOntoPR10b7e2NogYzlN0qaBeuXk3O1UbGi9MwkBI=
subdir:
ouroboros-consensus
ouroboros-consensus-cardano
Expand Down
46 changes: 23 additions & 23 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ import Ouroboros.Consensus.Genesis.Governor (DensityBounds (..), GDDDe
import Ouroboros.Consensus.Ledger.Extended (ExtValidationError)
import Ouroboros.Consensus.Ledger.Inspect (LedgerEvent (..), LedgerUpdate, LedgerWarning)
import Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr, ByteSize32 (..), GenTxId,
HasTxId, LedgerSupportsMempool, txForgetValidated, txId, TxMeasureMetrics (txMeasureMetricTxSizeBytes, txMeasureMetricExUnitsMemory, txMeasureMetricExUnitsSteps, txMeasureMetricRefScriptsSizeBytes), TxLimits (TxMeasure))
HasTxId, LedgerSupportsMempool, TxLimits (TxMeasure),
TxMeasureMetrics (txMeasureMetricExUnitsMemory, txMeasureMetricExUnitsSteps, txMeasureMetricRefScriptsSizeBytes, txMeasureMetricTxSizeBytes),
txForgetValidated, txId)
import Ouroboros.Consensus.Ledger.SupportsProtocol
import Ouroboros.Consensus.Mempool (MempoolSize (..), TraceEventMempool (..))
import Ouroboros.Consensus.Mempool.TxSeq (TxSeqMeasure (mCount, mSize))
import Ouroboros.Consensus.MiniProtocol.BlockFetch.Server
(TraceBlockFetchServerEvent (..))
import Ouroboros.Consensus.MiniProtocol.ChainSync.Client
Expand All @@ -54,6 +57,7 @@ import Ouroboros.Consensus.MiniProtocol.LocalTxSubmission.Server
import Ouroboros.Consensus.Node.GSM
import Ouroboros.Consensus.Node.Run (SerialiseNodeToNodeConstraints, estimateBlockSize)
import Ouroboros.Consensus.Node.Tracers
import Ouroboros.Consensus.Observe.ConsensusJson (ConsensusJson (toConsensusJson))
import qualified Ouroboros.Consensus.Protocol.Ledger.HotKey as HotKey
import Ouroboros.Consensus.Util.Enclose
import qualified Ouroboros.Network.AnchoredFragment as AF
Expand Down Expand Up @@ -81,9 +85,8 @@ import Data.Time (NominalDiffTime)
import Data.Word (Word32, Word64)
import Network.TypedProtocol.Core

import LeiosDemoTypes (TraceLeiosKernel, TraceLeiosPeer, traceLeiosKernelToObject, traceLeiosPeerToObject)
import Ouroboros.Consensus.Observe.ConsensusJson (ConsensusJson(toConsensusJson))
import Ouroboros.Consensus.Mempool.TxSeq (TxSeqMeasure(mCount, mSize))
import LeiosDemoTypes (TraceLeiosKernel (..), TraceLeiosPeer, leiosEbTxs,
traceLeiosKernelToObject, traceLeiosPeerToObject)

instance (LogFormatting adr, Show adr) => LogFormatting (ConnectionId adr) where
forMachine _dtal (ConnectionId local' remote) =
Expand Down Expand Up @@ -1705,31 +1708,17 @@ instance ( tx ~ GenTx blk
, CounterM "Forge.forged" Nothing
-- NOTE(bladyjoker): New!!!
, CounterM "Forge.ranking-block.total-count" Nothing

, CounterM "Forge.ranking-block.total-tx-count" (Just . fromInteger . toInteger . mCount . fbNewBlockSize $ fb)
, CounterM "Forge.endorser-block.total-tx-count" (Just . fromInteger . toInteger . mCount . fbNewEndorserBlockSize $ fb)
, CounterM "Forge.rest-in-mempool.total-tx-count" (Just . fromInteger . toInteger . mCount . fbMempoolRestSize $ fb)

, CounterM "Forge.ranking-block.total-tx-bytes" (Just . fromInteger . toInteger . unByteSize32 . txMeasureMetricTxSizeBytes . mSize . fbNewBlockSize $ fb)
, CounterM "Forge.endorser-block.total-tx-bytes" (Just . fromInteger . toInteger . unByteSize32 . txMeasureMetricTxSizeBytes . mSize . fbNewEndorserBlockSize $ fb)
, CounterM "Forge.rest-in-mempool.total-tx-bytes" (Just . fromInteger . toInteger . unByteSize32 . txMeasureMetricTxSizeBytes . mSize . fbMempoolRestSize $ fb)

, CounterM "Forge.ranking-block.total-tx-xu-memory" (Just . fromInteger . toInteger . txMeasureMetricExUnitsMemory . mSize . fbNewBlockSize $ fb)
, CounterM "Forge.endorser-block.total-tx-xu-memory" (Just . fromInteger . toInteger . txMeasureMetricExUnitsMemory . mSize . fbNewEndorserBlockSize $ fb)
, CounterM "Forge.rest-in-mempool.total-tx-xu-memory" (Just . fromInteger . toInteger . txMeasureMetricExUnitsMemory . mSize . fbMempoolRestSize $ fb)

, CounterM "Forge.ranking-block.total-tx-xu-time" (Just . fromInteger . toInteger . txMeasureMetricExUnitsSteps . mSize . fbNewBlockSize $ fb)
, CounterM "Forge.endorser-block.total-tx-xu-time" (Just . fromInteger . toInteger . txMeasureMetricExUnitsSteps . mSize . fbNewEndorserBlockSize $ fb)
, CounterM "Forge.rest-in-mempool.total-tx-xu-time" (Just . fromInteger . toInteger . txMeasureMetricExUnitsSteps . mSize . fbMempoolRestSize $ fb)

, CounterM "Forge.ranking-block.total-tx-ref-script-size-bytes" (Just . fromInteger . toInteger . unByteSize32 . txMeasureMetricRefScriptsSizeBytes . mSize . fbNewBlockSize $ fb)
, CounterM "Forge.endorser-block.total-tx-ref-script-size-bytes" (Just . fromInteger . toInteger . unByteSize32 . txMeasureMetricRefScriptsSizeBytes . mSize . fbNewEndorserBlockSize $ fb)
, CounterM "Forge.rest-in-mempool.total-tx-count" (Just . fromInteger . toInteger . mCount . fbMempoolRestSize $ fb)
, CounterM "Forge.rest-in-mempool.total-tx-bytes" (Just . fromInteger . toInteger . unByteSize32 . txMeasureMetricTxSizeBytes . mSize . fbMempoolRestSize $ fb)
, CounterM "Forge.rest-in-mempool.total-tx-xu-memory" (Just . fromInteger . toInteger . txMeasureMetricExUnitsMemory . mSize . fbMempoolRestSize $ fb)
, CounterM "Forge.rest-in-mempool.total-tx-xu-time" (Just . fromInteger . toInteger . txMeasureMetricExUnitsSteps . mSize . fbMempoolRestSize $ fb)
, CounterM "Forge.rest-in-mempool.total-tx-ref-script-size-bytes" (Just . fromInteger . toInteger . unByteSize32 . txMeasureMetricRefScriptsSizeBytes . mSize . fbMempoolRestSize $ fb)
] ++ case fbMaybeNewEndorserBlock fb of
Nothing -> []
Just _ -> [
CounterM "Forge.endorser-block.total-count" Nothing
]
]
asMetrics (TraceDidntAdoptBlock _slot _) =
[CounterM "Forge.didnt-adopt" Nothing]
asMetrics (TraceForgedInvalidBlock _slot _ _) =
Expand Down Expand Up @@ -2302,6 +2291,17 @@ instance LogFormatting TraceLeiosKernel where
forHuman = showT
forMachine _dtal = traceLeiosKernelToObject

asMetrics (TraceLeiosBlockForged{eb, ebMeasure}) =
[ CounterM "Forge.endorser-block.total-count" Nothing
,
CounterM "Forge.endorser-block.total-tx-count" (Just . fromIntegral . length $ leiosEbTxs eb)
, CounterM "Forge.endorser-block.total-tx-bytes" (Just . fromInteger . toInteger . unByteSize32 . txMeasureMetricTxSizeBytes $ ebMeasure)
, CounterM "Forge.endorser-block.total-tx-xu-memory" (Just . fromInteger . toInteger . txMeasureMetricExUnitsMemory $ ebMeasure)
, CounterM "Forge.endorser-block.total-tx-xu-time" (Just . fromInteger . toInteger . txMeasureMetricExUnitsSteps $ ebMeasure)
, CounterM "Forge.endorser-block.total-tx-ref-script-size-bytes" (Just . fromInteger . toInteger . unByteSize32 . txMeasureMetricRefScriptsSizeBytes $ ebMeasure)
]
asMetrics _ = []

instance MetaTrace TraceLeiosKernel where
namespaceFor _ = Namespace [] []
severityFor _ _ = Just Debug
Expand Down
Loading