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

Cardano.Tools.DBAnalyser.HasAnalysis

Synopsis

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

Associated Types

data Args blk Source #

Methods

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

mkLSMConfig ∷ Args blk → IO LSMConfig Source #

The LSM-trees configuration to use when the LedgerDB runs on the LSM backend. Defaults to no configuration (no snapshot exporting); only the Cardano instance overrides this, reading the values from the node configuration file.

Instances

Instances details
HasProtocolInfo ByronBlock Source # 
Instance details

Defined in Cardano.Tools.DBAnalyser.Block.Byron

Methods

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

mkLSMConfig ∷ Args ByronBlock → IO LSMConfig Source #

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

Methods

mkProtocolInfo ∷ Args (CardanoBlock StandardCrypto) → IO (ProtocolInfo (CardanoBlock StandardCrypto)) Source #

mkLSMConfig ∷ Args (CardanoBlock StandardCrypto) → IO LSMConfig Source #

HasProtocolInfo (ShelleyBlock (TPraos StandardCrypto) ShelleyEra) Source #

Shelley-era specific

Instance details

Defined in Cardano.Tools.DBAnalyser.Block.Shelley

Associated Types

data Args (ShelleyBlock (TPraos StandardCrypto) ShelleyEra) 
Instance details

Defined in Cardano.Tools.DBAnalyser.Block.Shelley

Methods

mkProtocolInfo ∷ Args (ShelleyBlock (TPraos StandardCrypto) ShelleyEra) → IO (ProtocolInfo (ShelleyBlock (TPraos StandardCrypto) ShelleyEra)) Source #

mkLSMConfig ∷ Args (ShelleyBlock (TPraos StandardCrypto) ShelleyEra) → IO LSMConfig Source #

data LSMConfig Source #

LSM-trees configuration relevant to db-analyser.

Constructors

LSMConfig 

Fields

  • lsmConfigExportPath ∷ Maybe FilePath

    The directory (relative to the LedgerDB filesystem root) into which the LSM backend exports snapshots as it takes them. When Nothing, snapshots are not exported.

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.2.0.0-l-api-af495335aa766cc933ee95df4ec7fdea2dd796e1efa726c7d4b40b7590fdf5d9" '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.2.0.0-l-api-af495335aa766cc933ee95df4ec7fdea2dd796e1efa726c7d4b40b7590fdf5d9" 'True) (C1 ('MetaCons "SizeInBytes" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSizeInBytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)))

data WithLedgerState blk Source #

Constructors

WithLedgerState 

Fields