{-# LANGUAGE NamedFieldPuns #-}
module Ouroboros.Network.PeerSelection.PeerMetric.Type
( HeaderMetricsTracer
, FetchedMetricsTracer
, ReportPeerMetrics (..)
, TraceLabelPeer (..)
) where
import Control.Concurrent.Class.MonadSTM.Strict
import Control.Monad.Class.MonadTime.SI
import Control.Tracer (Tracer)
import Cardano.Slotting.Slot (SlotNo (..))
import Ouroboros.Network.SizeInBytes (SizeInBytes)
import Network.Mux.Trace (TraceLabelPeer (..))
type m = Tracer (STM m) (SlotNo, Time)
type FetchedMetricsTracer m = Tracer (STM m) (SizeInBytes, SlotNo, Time)
data ReportPeerMetrics m peerAddr = ReportPeerMetrics {
:: Tracer (STM m) (TraceLabelPeer peerAddr ( SlotNo
, Time
))
, forall (m :: * -> *) peerAddr.
ReportPeerMetrics m peerAddr
-> Tracer
(STM m) (TraceLabelPeer peerAddr (SizeInBytes, SlotNo, Time))
reportFetch :: Tracer (STM m) (TraceLabelPeer peerAddr ( SizeInBytes
, SlotNo
, Time
))
}