Safe Haskell | None |
---|---|
Language | Haskell2010 |
Network.Mux.Trace
Synopsis
- data Error
- handleIOException :: MonadThrow m => String -> IOException -> m a
- data Trace
- = TraceState State
- | TraceCleanExit MiniProtocolNum MiniProtocolDir
- | TraceExceptionExit MiniProtocolNum MiniProtocolDir SomeException
- | TraceStartEagerly MiniProtocolNum MiniProtocolDir
- | TraceStartOnDemand MiniProtocolNum MiniProtocolDir
- | TraceStartOnDemandAny MiniProtocolNum MiniProtocolDir
- | TraceStartedOnDemand MiniProtocolNum MiniProtocolDir
- | TraceTerminating MiniProtocolNum MiniProtocolDir
- | TraceStopping
- | TraceStopped
- data ChannelTrace
- data BearerTrace
- = TraceRecvHeaderStart
- | TraceRecvHeaderEnd SDUHeader
- | TraceRecvDeltaQObservation SDUHeader Time
- | TraceRecvDeltaQSample Double Int Int Double Double Double Double String
- | TraceEmitDeltaQ
- | TraceRecvRaw Int
- | TraceRecvStart Int
- | TraceRecvEnd Int
- | TraceSendStart SDUHeader
- | TraceSendEnd
- | TraceSDUReadTimeoutException
- | TraceSDUWriteTimeoutException
- | TraceTCPInfo StructTCPInfo Word16
- data Tracers' (m :: Type -> Type) (f :: Type -> Type) where
- Tracers {
- tracer :: Tracer m (f Trace)
- channelTracer :: Tracer m (f ChannelTrace)
- bearerTracer :: Tracer m (f BearerTrace)
- pattern TracersI :: Tracer m Trace -> Tracer m ChannelTrace -> Tracer m BearerTrace -> Tracers m
- Tracers {
- contramapTracers' :: forall f' f (m :: Type -> Type). (forall x. f' x -> f x) -> Tracers' m f -> Tracers' m f'
- type Tracers (m :: Type -> Type) = Tracers' m Identity
- nullTracers :: forall (m :: Type -> Type) (f :: Type -> Type). Applicative m => Tracers' m f
- tracersWith :: forall (m :: Type -> Type) (f :: Type -> Type). (forall x. Tracer m x) -> Tracers' m f
- type TracersWithBearer connId (m :: Type -> Type) = Tracers' m (WithBearer connId)
- tracersWithBearer :: forall peerId (m :: Type -> Type). peerId -> TracersWithBearer peerId m -> Tracers m
- data WithBearer peerid a = WithBearer {}
- data TraceLabelPeer peerid a = TraceLabelPeer peerid a
- data State
Exceptions
Enumeration of error conditions.
Constructors
UnknownMiniProtocol MiniProtocolNum | returned by |
BearerClosed String | thrown by |
IngressQueueOverRun MiniProtocolNum MiniProtocolDir | thrown by |
InitiatorOnly MiniProtocolNum | thrown when data arrives on a responder channel when the
mux was set up as an |
IOException IOException String |
|
SDUDecodeError String | return by |
SDUReadTimeout | thrown when reading of a single SDU takes too long |
SDUWriteTimeout | thrown when writing a single SDU takes too long |
Shutdown (Maybe SomeException) Status | Result of runMiniProtocol's completionAction in case of an error or mux being closed while a mini-protocol was still running, this is not a clean exit. |
Instances
Exception Error Source # | |
Defined in Network.Mux.Trace Methods toException :: Error -> SomeException # fromException :: SomeException -> Maybe Error # displayException :: Error -> String # backtraceDesired :: Error -> Bool # | |
Show Error Source # | |
handleIOException :: MonadThrow m => String -> IOException -> m a Source #
Handler for IOException
s which wraps them in Error
.
It is used various Bearer
implementations:
* socketAsBearer
* pipeAsBearer
Trace events
High-level mux events.
Constructors
data ChannelTrace Source #
Mid-level channel events traced independently by each mini protocol job.
Constructors
TraceChannelRecvStart MiniProtocolNum | |
TraceChannelRecvEnd MiniProtocolNum Int | |
TraceChannelSendStart MiniProtocolNum Int | |
TraceChannelSendEnd MiniProtocolNum |
Instances
Show ChannelTrace Source # | |
Defined in Network.Mux.Trace Methods showsPrec :: Int -> ChannelTrace -> ShowS # show :: ChannelTrace -> String # showList :: [ChannelTrace] -> ShowS # |
data BearerTrace Source #
Low-level bearer trace tags (these are not traced by the tracer which is passed to Mux).
Constructors
Instances
Show BearerTrace Source # | |
Defined in Network.Mux.Types Methods showsPrec :: Int -> BearerTrace -> ShowS # show :: BearerTrace -> String # showList :: [BearerTrace] -> ShowS # |
Tracers
data Tracers' (m :: Type -> Type) (f :: Type -> Type) Source #
Bundle of tracers used directly by mux.
Constructors
Tracers | |
Fields
|
Bundled Patterns
pattern TracersI :: Tracer m Trace -> Tracer m ChannelTrace -> Tracer m BearerTrace -> Tracers m | A convenient bidirectional pattern synonym which (un)wraps the |
contramapTracers' :: forall f' f (m :: Type -> Type). (forall x. f' x -> f x) -> Tracers' m f -> Tracers' m f' Source #
Contravariant natural transformation of Tracers
m`.
nullTracers :: forall (m :: Type -> Type) (f :: Type -> Type). Applicative m => Tracers' m f Source #
tracersWith :: forall (m :: Type -> Type) (f :: Type -> Type). (forall x. Tracer m x) -> Tracers' m f Source #
Trace all events through one polymorphic tracer.
type TracersWithBearer connId (m :: Type -> Type) = Tracers' m (WithBearer connId) Source #
tracersWithBearer :: forall peerId (m :: Type -> Type). peerId -> TracersWithBearer peerId m -> Tracers m Source #
Tracing wrappers
data WithBearer peerid a Source #
Type used for tracing mux events.
Constructors
WithBearer | |
Instances
Generic (WithBearer peerid a) Source # | |||||
Defined in Network.Mux.Trace Associated Types
Methods from :: WithBearer peerid a -> Rep (WithBearer peerid a) x # to :: Rep (WithBearer peerid a) x -> WithBearer peerid a # | |||||
(Show peerid, Show a) => Show (WithBearer peerid a) Source # | |||||
Defined in Network.Mux.Trace Methods showsPrec :: Int -> WithBearer peerid a -> ShowS # show :: WithBearer peerid a -> String # showList :: [WithBearer peerid a] -> ShowS # | |||||
type Rep (WithBearer peerid a) Source # | |||||
Defined in Network.Mux.Trace type Rep (WithBearer peerid a) = D1 ('MetaData "WithBearer" "Network.Mux.Trace" "network-mux-0.9.0.0-inplace" 'False) (C1 ('MetaCons "WithBearer" 'PrefixI 'True) (S1 ('MetaSel ('Just "wbPeerId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 peerid) :*: S1 ('MetaSel ('Just "wbEvent") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a))) |
data TraceLabelPeer peerid a Source #
A peer label for use in Tracer
s. This annotates tracer output as being
associated with a given peer identifier.
Constructors
TraceLabelPeer peerid a |
Instances
Bifunctor TraceLabelPeer Source # | |
Defined in Network.Mux.Trace Methods bimap :: (a -> b) -> (c -> d) -> TraceLabelPeer a c -> TraceLabelPeer b d # first :: (a -> b) -> TraceLabelPeer a c -> TraceLabelPeer b c # second :: (b -> c) -> TraceLabelPeer a b -> TraceLabelPeer a c # | |
Functor (TraceLabelPeer peerid) Source # | |
Defined in Network.Mux.Trace Methods fmap :: (a -> b) -> TraceLabelPeer peerid a -> TraceLabelPeer peerid b # (<$) :: a -> TraceLabelPeer peerid b -> TraceLabelPeer peerid a # | |
(Show peerid, Show a) => Show (TraceLabelPeer peerid a) Source # | |
Defined in Network.Mux.Trace Methods showsPrec :: Int -> TraceLabelPeer peerid a -> ShowS # show :: TraceLabelPeer peerid a -> String # showList :: [TraceLabelPeer peerid a] -> ShowS # | |
(Eq peerid, Eq a) => Eq (TraceLabelPeer peerid a) Source # | |
Defined in Network.Mux.Trace Methods (==) :: TraceLabelPeer peerid a -> TraceLabelPeer peerid a -> Bool # (/=) :: TraceLabelPeer peerid a -> TraceLabelPeer peerid a -> Bool # |