Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Utility functions to filter and simplify raw logs.
Synopsis
- data Trace tx
- = TraceEvent { }
- | TraceEffect { }
- data TraceKey
- tracePerformance :: IsTx tx => Envelope (HydraLog tx (Message tx)) -> State (Map TraceKey [Trace tx]) [Trace tx]
Documentation
A trace of an event or effect for a specific transaction.
Instances
Instances
Show TraceKey Source # | |
Eq TraceKey Source # | |
Ord TraceKey Source # | |
Defined in Hydra.LogFilter |
tracePerformance :: IsTx tx => Envelope (HydraLog tx (Message tx)) -> State (Map TraceKey [Trace tx]) [Trace tx] Source #
Compute duration of some Event
s and Effect
s from logs.
This function is meant to be used with a sequence
in order to traverse a stream of
log entries and output list of Trace
as begin/end pairs are found and identified.
Each Trace
emitted is tied to a specific transaction id which provides an easy way to
identify in which part of their journey through Hydra transactions are spending time.
It currently compute duration of:
* NewTx
, ReqTx
, ReqSn
events,
* ReqTx
, TxValid
and SnapshotConfirmed
effects.
NOTE: Some potential improvements
* Move this function to Monitoring
and expose an histogram kind of metric for each type of event / effect
* Handle more events, in particular the AckSn
which is slightly problematic as it does not contain
a direct reference to a transaction id so we would need to carry around a secondary map to keep
track of this link.