ouroboros-consensus:unstable-cardano-tools
Safe HaskellNone
LanguageHaskell2010

Cardano.Tools.DBAnalyser.HasAnalysis

Documentation

class (HasAnnTip blk, GetPrevHash blk, Condense (HeaderHash blk)) ⇒ HasAnalysis blk where Source #

Methods

countTxOutputs ∷ blk → Int Source #

blockTxSizes ∷ blk → [SizeInBytes] Source #

knownEBBs ∷ proxy blk → Map (HeaderHash blk) (ChainHash blk) Source #

emitTraces ∷ WithLedgerState blk → [String] Source #

Emit trace markers at points in processing.

blockStats ∷ blk → [TextBuilder] Source #

This method was introduced for the sake of the BenchmarkLedgerOps pass.

blockApplicationMetrics ∷ [(TextBuilder, WithLedgerState blk → IO TextBuilder)] Source #

This function allows to define different metrics about block application.

The block application metrics will be stored in a CSV file. This method is used by 'db-analyser' to define the headers of the resulting data, and how to compute, for a given row, each column of the metrics.

The first component of each element in blockApplicationMetrics represents a header in the resulting CSV file.

Given a block application 'x :: WithLedgerState blk', the metrics for that block application are calculated using the second component of blockApplicationMetrics.

The block application metrics are mapped to an IO action because certain metrics such as the size of data need to be performed in the IO monad.

Instances

Instances details
HasAnalysis ByronBlock Source # 
Instance details

Defined in Cardano.Tools.DBAnalyser.Block.Byron

Methods

countTxOutputs ∷ ByronBlock → Int Source #

blockTxSizes ∷ ByronBlock → [SizeInBytes] Source #

knownEBBs ∷ proxy ByronBlock → Map (HeaderHash ByronBlock) (ChainHash ByronBlock) Source #

emitTraces ∷ WithLedgerState ByronBlock → [String] Source #

blockStats ∷ ByronBlock → [TextBuilder] Source #

blockApplicationMetrics ∷ [(TextBuilder, WithLedgerState ByronBlock → IO TextBuilder)] Source #

HasAnalysis (CardanoBlock StandardCrypto) Source # 
Instance details

Defined in Cardano.Tools.DBAnalyser.Block.Cardano

(ShelleyCompatible proto era, PerEraAnalysis era) ⇒ HasAnalysis (ShelleyBlock proto era) Source #

Usable for each Shelley-based era

Instance details

Defined in Cardano.Tools.DBAnalyser.Block.Shelley

Methods

countTxOutputs ∷ ShelleyBlock proto era → Int Source #

blockTxSizes ∷ ShelleyBlock proto era → [SizeInBytes] Source #

knownEBBs ∷ proxy (ShelleyBlock proto era) → Map (HeaderHash (ShelleyBlock proto era)) (ChainHash (ShelleyBlock proto era)) Source #

emitTraces ∷ WithLedgerState (ShelleyBlock proto era) → [String] Source #

blockStats ∷ ShelleyBlock proto era → [TextBuilder] Source #

blockApplicationMetrics ∷ [(TextBuilder, WithLedgerState (ShelleyBlock proto era) → IO TextBuilder)] Source #

class HasProtocolInfo blk where Source #

Minimal complete definition

mkProtocolInfo | mkProtocolInfoAndBackend

Associated Types

data Args blk Source #

Methods

mkProtocolInfo ∷ Args blk → IO (ProtocolInfo blk) Source #

mkProtocolInfoAndBackend ∷ Args blk → IO (ProtocolInfo blk, Maybe LedgerDBBackend) Source #

The protocol info, together with the LedgerDB backend (and its settings) that the node configuration file selects, which db-analyser uses when the command line does not select one. Both are produced by a single call so that the configuration only has to be read once.

Defaults to no backend (nothing to read one from); only the Cardano instance overrides this.

Instances

Instances details
HasProtocolInfo (CardanoBlock StandardCrypto) Source # 
Instance details

Defined in Cardano.Tools.DBAnalyser.Block.Cardano

Associated Types

data Args (CardanoBlock StandardCrypto) 
Instance details

Defined in Cardano.Tools.DBAnalyser.Block.Cardano

data SizeInBytes #

Instances

Instances details
ToJSON SizeInBytes # 
Instance details

Defined in Ouroboros.Network.SizeInBytes

NFData SizeInBytes # 
Instance details

Defined in Ouroboros.Network.SizeInBytes

Methods

rnf ∷ SizeInBytes → () #

Monoid SizeInBytes # 
Instance details

Defined in Ouroboros.Network.SizeInBytes

Semigroup SizeInBytes # 
Instance details

Defined in Ouroboros.Network.SizeInBytes

Eq SizeInBytes # 
Instance details

Defined in Ouroboros.Network.SizeInBytes

Ord SizeInBytes # 
Instance details

Defined in Ouroboros.Network.SizeInBytes

Bounded SizeInBytes # 
Instance details

Defined in Ouroboros.Network.SizeInBytes

Enum SizeInBytes # 
Instance details

Defined in Ouroboros.Network.SizeInBytes

Generic SizeInBytes # 
Instance details

Defined in Ouroboros.Network.SizeInBytes

Associated Types

type Rep SizeInBytes 
Instance details

Defined in Ouroboros.Network.SizeInBytes

type Rep SizeInBytes = D1 ('MetaData "SizeInBytes" "Ouroboros.Network.SizeInBytes" "ouroboros-network-1.3.0.0-l-api-420e97ba6b036c6a198f26a1245f7cdfe0e0f0edbfe8185b6279bf1163040e70" 'True) (C1 ('MetaCons "SizeInBytes" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSizeInBytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)))
Num SizeInBytes # 
Instance details

Defined in Ouroboros.Network.SizeInBytes

Integral SizeInBytes # 
Instance details

Defined in Ouroboros.Network.SizeInBytes

Real SizeInBytes # 
Instance details

Defined in Ouroboros.Network.SizeInBytes

Show SizeInBytes # 
Instance details

Defined in Ouroboros.Network.SizeInBytes

BoundedMeasure SizeInBytes # 
Instance details

Defined in Ouroboros.Network.SizeInBytes

Measure SizeInBytes # 
Instance details

Defined in Ouroboros.Network.SizeInBytes

NoThunks SizeInBytes # 
Instance details

Defined in Ouroboros.Network.SizeInBytes

type Rep SizeInBytes # 
Instance details

Defined in Ouroboros.Network.SizeInBytes

type Rep SizeInBytes = D1 ('MetaData "SizeInBytes" "Ouroboros.Network.SizeInBytes" "ouroboros-network-1.3.0.0-l-api-420e97ba6b036c6a198f26a1245f7cdfe0e0f0edbfe8185b6279bf1163040e70" 'True) (C1 ('MetaCons "SizeInBytes" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSizeInBytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)))

data WithLedgerState blk Source #

Constructors

WithLedgerState 

Fields