{-# LANGUAGE CPP #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module Network.Mux.Tracing () where
import Data.Aeson (Object, Value (String), object, (.=))
import Data.Aeson.Key (Key)
import Data.Aeson.Key qualified as Key
import Data.List (isPrefixOf)
import Data.Map.Strict (Map)
import Data.Map.Strict qualified as Map
import Data.Text (Text)
import Data.Text qualified as Text
import Data.Typeable
import Data.Word (Word64)
import Formatting
import Cardano.Logging
import Network.Mux qualified as Mux
#ifdef linux_HOST_OS
import Network.Mux.TCPInfo (StructTCPInfo (..))
#endif
import Network.Mux.Types (MiniProtocolDir (..), SDUHeader (..),
unRemoteClockModel)
instance (LogFormatting peer, LogFormatting tr, Typeable tr) =>
LogFormatting (Mux.WithBearer peer tr) where
forMachine :: DetailLevel -> WithBearer peer tr -> Object
forMachine DetailLevel
dtal (Mux.WithBearer peer
b tr
ev) =
[Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> [Char] -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (TypeRep -> [Char]
forall a. Show a => a -> [Char]
show (TypeRep -> [Char]) -> (tr -> TypeRep) -> tr -> [Char]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. tr -> TypeRep
forall a. Typeable a => a -> TypeRep
typeOf (tr -> [Char]) -> tr -> [Char]
forall a b. (a -> b) -> a -> b
$ tr
ev)
, Key
"bearer" Key -> Object -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DetailLevel -> peer -> Object
forall a. LogFormatting a => DetailLevel -> a -> Object
forMachine DetailLevel
dtal peer
b
, Key
"event" Key -> Object -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DetailLevel -> tr -> Object
forall a. LogFormatting a => DetailLevel -> a -> Object
forMachine DetailLevel
dtal tr
ev ]
forHuman :: WithBearer peer tr -> Text
forHuman (Mux.WithBearer peer
b tr
ev) = Text
"With mux bearer " Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> peer -> Text
forall a. LogFormatting a => a -> Text
forHuman peer
b
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
". " Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> tr -> Text
forall a. LogFormatting a => a -> Text
forHuman tr
ev
instance MetaTrace tr => MetaTrace (Mux.WithBearer peer tr) where
namespaceFor :: WithBearer peer tr -> Namespace (WithBearer peer tr)
namespaceFor (Mux.WithBearer peer
_peer tr
obj) = (Namespace tr -> Namespace (WithBearer peer tr)
forall a b. Namespace a -> Namespace b
nsCast (Namespace tr -> Namespace (WithBearer peer tr))
-> (tr -> Namespace tr) -> tr -> Namespace (WithBearer peer tr)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. tr -> Namespace tr
forall a. MetaTrace a => a -> Namespace a
namespaceFor) tr
obj
severityFor :: Namespace (WithBearer peer tr)
-> Maybe (WithBearer peer tr) -> Maybe SeverityS
severityFor Namespace (WithBearer peer tr)
ns Maybe (WithBearer peer tr)
Nothing = Namespace tr -> Maybe tr -> Maybe SeverityS
forall a. MetaTrace a => Namespace a -> Maybe a -> Maybe SeverityS
severityFor (Namespace (WithBearer peer tr) -> Namespace tr
forall a b. Namespace a -> Namespace b
nsCast Namespace (WithBearer peer tr)
ns :: Namespace tr) Maybe tr
forall a. Maybe a
Nothing
severityFor Namespace (WithBearer peer tr)
ns (Just (Mux.WithBearer peer
_peer tr
obj)) =
Namespace tr -> Maybe tr -> Maybe SeverityS
forall a. MetaTrace a => Namespace a -> Maybe a -> Maybe SeverityS
severityFor (Namespace (WithBearer peer tr) -> Namespace tr
forall a b. Namespace a -> Namespace b
nsCast Namespace (WithBearer peer tr)
ns) (tr -> Maybe tr
forall a. a -> Maybe a
Just tr
obj)
privacyFor :: Namespace (WithBearer peer tr)
-> Maybe (WithBearer peer tr) -> Maybe Privacy
privacyFor Namespace (WithBearer peer tr)
ns Maybe (WithBearer peer tr)
Nothing = Namespace tr -> Maybe tr -> Maybe Privacy
forall a. MetaTrace a => Namespace a -> Maybe a -> Maybe Privacy
privacyFor (Namespace (WithBearer peer tr) -> Namespace tr
forall a b. Namespace a -> Namespace b
nsCast Namespace (WithBearer peer tr)
ns :: Namespace tr) Maybe tr
forall a. Maybe a
Nothing
privacyFor Namespace (WithBearer peer tr)
ns (Just (Mux.WithBearer peer
_peer tr
obj)) =
Namespace tr -> Maybe tr -> Maybe Privacy
forall a. MetaTrace a => Namespace a -> Maybe a -> Maybe Privacy
privacyFor (Namespace (WithBearer peer tr) -> Namespace tr
forall a b. Namespace a -> Namespace b
nsCast Namespace (WithBearer peer tr)
ns) (tr -> Maybe tr
forall a. a -> Maybe a
Just tr
obj)
detailsFor :: Namespace (WithBearer peer tr)
-> Maybe (WithBearer peer tr) -> Maybe DetailLevel
detailsFor Namespace (WithBearer peer tr)
ns Maybe (WithBearer peer tr)
Nothing = Namespace tr -> Maybe tr -> Maybe DetailLevel
forall a.
MetaTrace a =>
Namespace a -> Maybe a -> Maybe DetailLevel
detailsFor (Namespace (WithBearer peer tr) -> Namespace tr
forall a b. Namespace a -> Namespace b
nsCast Namespace (WithBearer peer tr)
ns :: Namespace tr) Maybe tr
forall a. Maybe a
Nothing
detailsFor Namespace (WithBearer peer tr)
ns (Just (Mux.WithBearer peer
_peer tr
obj)) =
Namespace tr -> Maybe tr -> Maybe DetailLevel
forall a.
MetaTrace a =>
Namespace a -> Maybe a -> Maybe DetailLevel
detailsFor (Namespace (WithBearer peer tr) -> Namespace tr
forall a b. Namespace a -> Namespace b
nsCast Namespace (WithBearer peer tr)
ns) (tr -> Maybe tr
forall a. a -> Maybe a
Just tr
obj)
documentFor :: Namespace (WithBearer peer tr) -> Maybe Text
documentFor Namespace (WithBearer peer tr)
ns = Namespace tr -> Maybe Text
forall a. MetaTrace a => Namespace a -> Maybe Text
documentFor (Namespace (WithBearer peer tr) -> Namespace tr
forall a b. Namespace a -> Namespace b
nsCast Namespace (WithBearer peer tr)
ns :: Namespace tr)
metricsDocFor :: Namespace (WithBearer peer tr) -> [(Text, Text)]
metricsDocFor Namespace (WithBearer peer tr)
ns = Namespace tr -> [(Text, Text)]
forall a. MetaTrace a => Namespace a -> [(Text, Text)]
metricsDocFor (Namespace (WithBearer peer tr) -> Namespace tr
forall a b. Namespace a -> Namespace b
nsCast Namespace (WithBearer peer tr)
ns :: Namespace tr)
allNamespaces :: [Namespace (WithBearer peer tr)]
allNamespaces = (Namespace tr -> Namespace (WithBearer peer tr))
-> [Namespace tr] -> [Namespace (WithBearer peer tr)]
forall a b. (a -> b) -> [a] -> [b]
map Namespace tr -> Namespace (WithBearer peer tr)
forall a b. Namespace a -> Namespace b
nsCast ([Namespace tr]
forall a. MetaTrace a => [Namespace a]
allNamespaces :: [Namespace tr])
instance LogFormatting Mux.BearerTrace where
forMachine :: DetailLevel -> BearerTrace -> Object
forMachine DetailLevel
_dtal BearerTrace
Mux.TraceRecvHeaderStart = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceRecvHeaderStart"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Bearer Receive Header Start"
]
forMachine DetailLevel
_dtal (Mux.TraceRecvHeaderEnd SDUHeader { RemoteClockModel
mhTimestamp :: RemoteClockModel
mhTimestamp :: SDUHeader -> RemoteClockModel
mhTimestamp, MiniProtocolNum
mhNum :: MiniProtocolNum
mhNum :: SDUHeader -> MiniProtocolNum
mhNum, MiniProtocolDir
mhDir :: MiniProtocolDir
mhDir :: SDUHeader -> MiniProtocolDir
mhDir, Word16
mhLength :: Word16
mhLength :: SDUHeader -> Word16
mhLength }) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceRecvHeaderStart"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Bearer Receive Header End"
, Key
"timestamp" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Word32 -> Text
forall a. Integral a => a -> Text
showTHex (RemoteClockModel -> Word32
unRemoteClockModel RemoteClockModel
mhTimestamp))
, Key
"miniProtocolNum" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolNum -> Text
forall a. Show a => a -> Text
showT MiniProtocolNum
mhNum)
, Key
"miniProtocolDir" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolDir -> Text
forall a. Show a => a -> Text
showT MiniProtocolDir
mhDir)
, Key
"length" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Word16 -> Text
forall a. Show a => a -> Text
showT Word16
mhLength)
]
forMachine DetailLevel
_dtal (Mux.TraceRecvDeltaQObservation SDUHeader { RemoteClockModel
mhTimestamp :: SDUHeader -> RemoteClockModel
mhTimestamp :: RemoteClockModel
mhTimestamp, Word16
mhLength :: SDUHeader -> Word16
mhLength :: Word16
mhLength } Time
ts) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceRecvDeltaQObservation"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Bearer DeltaQ observation"
, Key
"timeRemote" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Time -> Text
forall a. Show a => a -> Text
showT Time
ts)
, Key
"timeLocal" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Word32 -> Text
forall a. Integral a => a -> Text
showTHex (RemoteClockModel -> Word32
unRemoteClockModel RemoteClockModel
mhTimestamp))
, Key
"length" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Word16 -> Text
forall a. Show a => a -> Text
showT Word16
mhLength)
]
forMachine DetailLevel
_dtal (Mux.TraceRecvDeltaQSample Double
d Int
sp Int
so Double
dqs Double
dqvm Double
dqvs Double
estR [Char]
sdud) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceRecvDeltaQSample"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Bearer DeltaQ Sample"
, Key
"duration" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Double -> Text
forall a. Show a => a -> Text
showT Double
d)
, Key
"packets" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Int -> Text
forall a. Show a => a -> Text
showT Int
sp)
, Key
"sumBytes" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Int -> Text
forall a. Show a => a -> Text
showT Int
so)
, Key
"DeltaQ_S" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Double -> Text
forall a. Show a => a -> Text
showT Double
dqs)
, Key
"DeltaQ_VMean" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Double -> Text
forall a. Show a => a -> Text
showT Double
dqvm)
, Key
"DeltaQ_VVar" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Double -> Text
forall a. Show a => a -> Text
showT Double
dqvs)
, Key
"DeltaQ_estR" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Double -> Text
forall a. Show a => a -> Text
showT Double
estR)
, Key
"sizeDist" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String ([Char] -> Text
forall a. Show a => a -> Text
showT [Char]
sdud)
]
forMachine DetailLevel
_dtal (Mux.TraceRecvStart Int
len) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceRecvStart"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Bearer Receive Start"
, Key
"length" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Int -> Text
forall a. Show a => a -> Text
showT Int
len)
]
forMachine DetailLevel
_dtal (Mux.TraceRecvRaw Int
len) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceRecvRaw"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Bearer Receive Raw"
, Key
"length" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Int -> Text
forall a. Show a => a -> Text
showT Int
len)
]
forMachine DetailLevel
_dtal (Mux.TraceRecvEnd Int
len) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceRecvEnd"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Bearer Receive End"
, Key
"length" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Int -> Text
forall a. Show a => a -> Text
showT Int
len)
]
forMachine DetailLevel
_dtal (Mux.TraceSendStart SDUHeader { RemoteClockModel
mhTimestamp :: SDUHeader -> RemoteClockModel
mhTimestamp :: RemoteClockModel
mhTimestamp, MiniProtocolNum
mhNum :: SDUHeader -> MiniProtocolNum
mhNum :: MiniProtocolNum
mhNum, MiniProtocolDir
mhDir :: SDUHeader -> MiniProtocolDir
mhDir :: MiniProtocolDir
mhDir, Word16
mhLength :: SDUHeader -> Word16
mhLength :: Word16
mhLength }) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceSendStart"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Bearer Send Start"
, Key
"timestamp" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Word32 -> Text
forall a. Integral a => a -> Text
showTHex (RemoteClockModel -> Word32
unRemoteClockModel RemoteClockModel
mhTimestamp))
, Key
"miniProtocolNum" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolNum -> Text
forall a. Show a => a -> Text
showT MiniProtocolNum
mhNum)
, Key
"miniProtocolDir" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolDir -> Text
forall a. Show a => a -> Text
showT MiniProtocolDir
mhDir)
, Key
"length" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Word16 -> Text
forall a. Show a => a -> Text
showT Word16
mhLength)
]
forMachine DetailLevel
_dtal BearerTrace
Mux.TraceSendEnd = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceSendEnd"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Bearer Send End"
]
forMachine DetailLevel
_dtal BearerTrace
Mux.TraceSDUReadTimeoutException = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceSDUReadTimeoutException"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Timed out reading SDU"
]
forMachine DetailLevel
_dtal BearerTrace
Mux.TraceSDUWriteTimeoutException = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceSDUWriteTimeoutException"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Timed out writing SDU"
]
forMachine DetailLevel
_dtal BearerTrace
Mux.TraceEmitDeltaQ = Object
forall a. Monoid a => a
mempty
#ifdef linux_HOST_OS
forMachine DetailLevel
_dtal (Mux.TraceTCPInfo StructTCPInfo
{ CUInt
tcpi_snd_mss :: CUInt
tcpi_snd_mss :: StructTCPInfo -> CUInt
tcpi_snd_mss, CUInt
tcpi_rcv_mss :: CUInt
tcpi_rcv_mss :: StructTCPInfo -> CUInt
tcpi_rcv_mss, CUInt
tcpi_lost :: CUInt
tcpi_lost :: StructTCPInfo -> CUInt
tcpi_lost, CUInt
tcpi_retrans :: CUInt
tcpi_retrans :: StructTCPInfo -> CUInt
tcpi_retrans
, CUInt
tcpi_rtt :: CUInt
tcpi_rtt :: StructTCPInfo -> CUInt
tcpi_rtt, CUInt
tcpi_rttvar :: CUInt
tcpi_rttvar :: StructTCPInfo -> CUInt
tcpi_rttvar, CUInt
tcpi_snd_cwnd :: CUInt
tcpi_snd_cwnd :: StructTCPInfo -> CUInt
tcpi_snd_cwnd }
Word16
len) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceTCPInfo"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"TCPInfo"
, Key
"rtt" Key -> Word -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (CUInt -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
tcpi_rtt :: Word)
, Key
"rttvar" Key -> Word -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (CUInt -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
tcpi_rttvar :: Word)
, Key
"snd_cwnd" Key -> Word -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (CUInt -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
tcpi_snd_cwnd :: Word)
, Key
"snd_mss" Key -> Word -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (CUInt -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
tcpi_snd_mss :: Word)
, Key
"rcv_mss" Key -> Word -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (CUInt -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
tcpi_rcv_mss :: Word)
, Key
"lost" Key -> Word -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (CUInt -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
tcpi_lost :: Word)
, Key
"retrans" Key -> Word -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (CUInt -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
tcpi_retrans :: Word)
, Key
"length" Key -> Word16 -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Word16
len
]
#else
forMachine _dtal (Mux.TraceTCPInfo _ len) = mconcat
[ "kind" .= String "Mux.TraceTCPInfo"
, "msg" .= String "TCPInfo"
, "len" .= String (showT len)
]
#endif
forHuman :: BearerTrace -> Text
forHuman BearerTrace
Mux.TraceRecvHeaderStart =
Text
"Bearer Receive Header Start"
forHuman (Mux.TraceRecvHeaderEnd SDUHeader { RemoteClockModel
mhTimestamp :: SDUHeader -> RemoteClockModel
mhTimestamp :: RemoteClockModel
mhTimestamp, MiniProtocolNum
mhNum :: SDUHeader -> MiniProtocolNum
mhNum :: MiniProtocolNum
mhNum, MiniProtocolDir
mhDir :: SDUHeader -> MiniProtocolDir
mhDir :: MiniProtocolDir
mhDir, Word16
mhLength :: SDUHeader -> Word16
mhLength :: Word16
mhLength }) =
Format
Text
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
-> Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text
forall a. Format Text a -> a
sformat (Format
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
"Bearer Receive Header End: ts:" Format
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
-> Format
Text
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
-> Format
Text
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
forall a r. Integral a => Format r (a -> r)
prefixHex Format
(MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
-> Format
Text (MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
-> Format
Text
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
"(" Format
(MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
-> Format
Text (MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
-> Format
Text (MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(MiniProtocolDir -> Word16 -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
forall a r. Show a => Format r (a -> r)
shown Format
(MiniProtocolDir -> Word16 -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
-> Format Text (MiniProtocolDir -> Word16 -> Text)
-> Format
Text (MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(MiniProtocolDir -> Word16 -> Text)
(MiniProtocolDir -> Word16 -> Text)
") " Format
(MiniProtocolDir -> Word16 -> Text)
(MiniProtocolDir -> Word16 -> Text)
-> Format Text (MiniProtocolDir -> Word16 -> Text)
-> Format Text (MiniProtocolDir -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (Word16 -> Text) (MiniProtocolDir -> Word16 -> Text)
forall a r. Show a => Format r (a -> r)
shown Format (Word16 -> Text) (MiniProtocolDir -> Word16 -> Text)
-> Format Text (Word16 -> Text)
-> Format Text (MiniProtocolDir -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (Word16 -> Text) (Word16 -> Text)
" len " Format (Word16 -> Text) (Word16 -> Text)
-> Format Text (Word16 -> Text) -> Format Text (Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (Word16 -> Text)
forall a r. Integral a => Format r (a -> r)
int)
(RemoteClockModel -> Word32
unRemoteClockModel RemoteClockModel
mhTimestamp) MiniProtocolNum
mhNum MiniProtocolDir
mhDir Word16
mhLength
forHuman (Mux.TraceRecvDeltaQObservation SDUHeader { RemoteClockModel
mhTimestamp :: SDUHeader -> RemoteClockModel
mhTimestamp :: RemoteClockModel
mhTimestamp, Word16
mhLength :: SDUHeader -> Word16
mhLength :: Word16
mhLength } Time
ts) =
Format Text (Word32 -> Time -> Word16 -> Text)
-> Word32 -> Time -> Word16 -> Text
forall a. Format Text a -> a
sformat (Format
(Word32 -> Time -> Word16 -> Text)
(Word32 -> Time -> Word16 -> Text)
"Bearer DeltaQ observation: remote ts" Format
(Word32 -> Time -> Word16 -> Text)
(Word32 -> Time -> Word16 -> Text)
-> Format Text (Word32 -> Time -> Word16 -> Text)
-> Format Text (Word32 -> Time -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (Time -> Word16 -> Text) (Word32 -> Time -> Word16 -> Text)
forall a r. Integral a => Format r (a -> r)
int Format (Time -> Word16 -> Text) (Word32 -> Time -> Word16 -> Text)
-> Format Text (Time -> Word16 -> Text)
-> Format Text (Word32 -> Time -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (Time -> Word16 -> Text) (Time -> Word16 -> Text)
" local ts " Format (Time -> Word16 -> Text) (Time -> Word16 -> Text)
-> Format Text (Time -> Word16 -> Text)
-> Format Text (Time -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (Word16 -> Text) (Time -> Word16 -> Text)
forall a r. Show a => Format r (a -> r)
shown Format (Word16 -> Text) (Time -> Word16 -> Text)
-> Format Text (Word16 -> Text)
-> Format Text (Time -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (Word16 -> Text) (Word16 -> Text)
" length " Format (Word16 -> Text) (Word16 -> Text)
-> Format Text (Word16 -> Text) -> Format Text (Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (Word16 -> Text)
forall a r. Integral a => Format r (a -> r)
int)
(RemoteClockModel -> Word32
unRemoteClockModel RemoteClockModel
mhTimestamp) Time
ts Word16
mhLength
forHuman (Mux.TraceRecvDeltaQSample Double
d Int
sp Int
so Double
dqs Double
dqvm Double
dqvs Double
estR [Char]
sdud) =
Format
Text
(Double
-> Int
-> Int
-> Double
-> Double
-> Double
-> Double
-> [Char]
-> Text)
-> Double
-> Int
-> Int
-> Double
-> Double
-> Double
-> Double
-> [Char]
-> Text
forall a. Format Text a -> a
sformat (Format
(Double
-> Int
-> Int
-> Double
-> Double
-> Double
-> Double
-> [Char]
-> Text)
(Double
-> Int
-> Int
-> Double
-> Double
-> Double
-> Double
-> [Char]
-> Text)
"Bearer DeltaQ Sample: duration " Format
(Double
-> Int
-> Int
-> Double
-> Double
-> Double
-> Double
-> [Char]
-> Text)
(Double
-> Int
-> Int
-> Double
-> Double
-> Double
-> Double
-> [Char]
-> Text)
-> Format
Text
(Double
-> Int
-> Int
-> Double
-> Double
-> Double
-> Double
-> [Char]
-> Text)
-> Format
Text
(Double
-> Int
-> Int
-> Double
-> Double
-> Double
-> Double
-> [Char]
-> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Int
-> Format
(Int
-> Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
(Double
-> Int
-> Int
-> Double
-> Double
-> Double
-> Double
-> [Char]
-> Text)
forall a r. Real a => Int -> Format r (a -> r)
fixed Int
3 Format
(Int
-> Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
(Double
-> Int
-> Int
-> Double
-> Double
-> Double
-> Double
-> [Char]
-> Text)
-> Format
Text
(Int
-> Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
-> Format
Text
(Double
-> Int
-> Int
-> Double
-> Double
-> Double
-> Double
-> [Char]
-> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(Int
-> Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
(Int
-> Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
" packets " Format
(Int
-> Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
(Int
-> Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
-> Format
Text
(Int
-> Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
-> Format
Text
(Int
-> Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
(Int
-> Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
forall a r. Integral a => Format r (a -> r)
int Format
(Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
(Int
-> Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
-> Format
Text
(Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
-> Format
Text
(Int
-> Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
(Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
" sumBytes "
Format
(Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
(Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
-> Format
Text
(Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
-> Format
Text
(Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(Double -> Double -> Double -> Double -> [Char] -> Text)
(Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
forall a r. Integral a => Format r (a -> r)
int Format
(Double -> Double -> Double -> Double -> [Char] -> Text)
(Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
-> Format
Text (Double -> Double -> Double -> Double -> [Char] -> Text)
-> Format
Text
(Int -> Double -> Double -> Double -> Double -> [Char] -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(Double -> Double -> Double -> Double -> [Char] -> Text)
(Double -> Double -> Double -> Double -> [Char] -> Text)
" DeltaQ_S " Format
(Double -> Double -> Double -> Double -> [Char] -> Text)
(Double -> Double -> Double -> Double -> [Char] -> Text)
-> Format
Text (Double -> Double -> Double -> Double -> [Char] -> Text)
-> Format
Text (Double -> Double -> Double -> Double -> [Char] -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Int
-> Format
(Double -> Double -> Double -> [Char] -> Text)
(Double -> Double -> Double -> Double -> [Char] -> Text)
forall a r. Real a => Int -> Format r (a -> r)
fixed Int
3 Format
(Double -> Double -> Double -> [Char] -> Text)
(Double -> Double -> Double -> Double -> [Char] -> Text)
-> Format Text (Double -> Double -> Double -> [Char] -> Text)
-> Format
Text (Double -> Double -> Double -> Double -> [Char] -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(Double -> Double -> Double -> [Char] -> Text)
(Double -> Double -> Double -> [Char] -> Text)
" DeltaQ_VMean " Format
(Double -> Double -> Double -> [Char] -> Text)
(Double -> Double -> Double -> [Char] -> Text)
-> Format Text (Double -> Double -> Double -> [Char] -> Text)
-> Format Text (Double -> Double -> Double -> [Char] -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Int
-> Format
(Double -> Double -> [Char] -> Text)
(Double -> Double -> Double -> [Char] -> Text)
forall a r. Real a => Int -> Format r (a -> r)
fixed Int
3 Format
(Double -> Double -> [Char] -> Text)
(Double -> Double -> Double -> [Char] -> Text)
-> Format Text (Double -> Double -> [Char] -> Text)
-> Format Text (Double -> Double -> Double -> [Char] -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(Double -> Double -> [Char] -> Text)
(Double -> Double -> [Char] -> Text)
"DeltaQ_VVar " Format
(Double -> Double -> [Char] -> Text)
(Double -> Double -> [Char] -> Text)
-> Format Text (Double -> Double -> [Char] -> Text)
-> Format Text (Double -> Double -> [Char] -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Int
-> Format
(Double -> [Char] -> Text) (Double -> Double -> [Char] -> Text)
forall a r. Real a => Int -> Format r (a -> r)
fixed Int
3
Format
(Double -> [Char] -> Text) (Double -> Double -> [Char] -> Text)
-> Format Text (Double -> [Char] -> Text)
-> Format Text (Double -> Double -> [Char] -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (Double -> [Char] -> Text) (Double -> [Char] -> Text)
" DeltaQ_estR " Format (Double -> [Char] -> Text) (Double -> [Char] -> Text)
-> Format Text (Double -> [Char] -> Text)
-> Format Text (Double -> [Char] -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Int -> Format ([Char] -> Text) (Double -> [Char] -> Text)
forall a r. Real a => Int -> Format r (a -> r)
fixed Int
3 Format ([Char] -> Text) (Double -> [Char] -> Text)
-> Format Text ([Char] -> Text)
-> Format Text (Double -> [Char] -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format ([Char] -> Text) ([Char] -> Text)
" sizeDist " Format ([Char] -> Text) ([Char] -> Text)
-> Format Text ([Char] -> Text) -> Format Text ([Char] -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text ([Char] -> Text)
forall r. Format r ([Char] -> r)
string)
Double
d Int
sp Int
so Double
dqs Double
dqvm Double
dqvs Double
estR [Char]
sdud
forHuman (Mux.TraceRecvStart Int
len) =
Format Text (Int -> Text) -> Int -> Text
forall a. Format Text a -> a
sformat (Format (Int -> Text) (Int -> Text)
"Bearer Receive Start: length " Format (Int -> Text) (Int -> Text)
-> Format Text (Int -> Text) -> Format Text (Int -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (Int -> Text)
forall a r. Integral a => Format r (a -> r)
int) Int
len
forHuman (Mux.TraceRecvRaw Int
len) =
Format Text (Int -> Text) -> Int -> Text
forall a. Format Text a -> a
sformat (Format (Int -> Text) (Int -> Text)
"Bearer Receive Raw: length " Format (Int -> Text) (Int -> Text)
-> Format Text (Int -> Text) -> Format Text (Int -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (Int -> Text)
forall a r. Integral a => Format r (a -> r)
int) Int
len
forHuman (Mux.TraceRecvEnd Int
len) =
Format Text (Int -> Text) -> Int -> Text
forall a. Format Text a -> a
sformat (Format (Int -> Text) (Int -> Text)
"Bearer Receive End: length " Format (Int -> Text) (Int -> Text)
-> Format Text (Int -> Text) -> Format Text (Int -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (Int -> Text)
forall a r. Integral a => Format r (a -> r)
int) Int
len
forHuman (Mux.TraceSendStart SDUHeader { RemoteClockModel
mhTimestamp :: SDUHeader -> RemoteClockModel
mhTimestamp :: RemoteClockModel
mhTimestamp, MiniProtocolNum
mhNum :: SDUHeader -> MiniProtocolNum
mhNum :: MiniProtocolNum
mhNum, MiniProtocolDir
mhDir :: SDUHeader -> MiniProtocolDir
mhDir :: MiniProtocolDir
mhDir, Word16
mhLength :: SDUHeader -> Word16
mhLength :: Word16
mhLength }) =
Format
Text
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
-> Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text
forall a. Format Text a -> a
sformat (Format
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
"Bearer Send Start: ts: " Format
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
-> Format
Text
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
-> Format
Text
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
forall a r. Integral a => Format r (a -> r)
prefixHex Format
(MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
-> Format
Text (MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
-> Format
Text
(Word32 -> MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
" (" Format
(MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
-> Format
Text (MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
-> Format
Text (MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(MiniProtocolDir -> Word16 -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
forall a r. Show a => Format r (a -> r)
shown Format
(MiniProtocolDir -> Word16 -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
-> Format Text (MiniProtocolDir -> Word16 -> Text)
-> Format
Text (MiniProtocolNum -> MiniProtocolDir -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(MiniProtocolDir -> Word16 -> Text)
(MiniProtocolDir -> Word16 -> Text)
") " Format
(MiniProtocolDir -> Word16 -> Text)
(MiniProtocolDir -> Word16 -> Text)
-> Format Text (MiniProtocolDir -> Word16 -> Text)
-> Format Text (MiniProtocolDir -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (Word16 -> Text) (MiniProtocolDir -> Word16 -> Text)
forall a r. Show a => Format r (a -> r)
shown Format (Word16 -> Text) (MiniProtocolDir -> Word16 -> Text)
-> Format Text (Word16 -> Text)
-> Format Text (MiniProtocolDir -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (Word16 -> Text) (Word16 -> Text)
" length " Format (Word16 -> Text) (Word16 -> Text)
-> Format Text (Word16 -> Text) -> Format Text (Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (Word16 -> Text)
forall a r. Integral a => Format r (a -> r)
int)
(RemoteClockModel -> Word32
unRemoteClockModel RemoteClockModel
mhTimestamp) MiniProtocolNum
mhNum MiniProtocolDir
mhDir Word16
mhLength
forHuman BearerTrace
Mux.TraceSendEnd =
Text
"Bearer Send End"
forHuman BearerTrace
Mux.TraceSDUReadTimeoutException =
Text
"Timed out reading SDU"
forHuman BearerTrace
Mux.TraceSDUWriteTimeoutException =
Text
"Timed out writing SDU"
forHuman BearerTrace
Mux.TraceEmitDeltaQ = Text
forall a. Monoid a => a
mempty
#ifdef linux_HOST_OS
forHuman (Mux.TraceTCPInfo StructTCPInfo
{ CUInt
tcpi_snd_mss :: StructTCPInfo -> CUInt
tcpi_snd_mss :: CUInt
tcpi_snd_mss, CUInt
tcpi_rcv_mss :: StructTCPInfo -> CUInt
tcpi_rcv_mss :: CUInt
tcpi_rcv_mss, CUInt
tcpi_lost :: StructTCPInfo -> CUInt
tcpi_lost :: CUInt
tcpi_lost, CUInt
tcpi_retrans :: StructTCPInfo -> CUInt
tcpi_retrans :: CUInt
tcpi_retrans
, CUInt
tcpi_rtt :: StructTCPInfo -> CUInt
tcpi_rtt :: CUInt
tcpi_rtt, CUInt
tcpi_rttvar :: StructTCPInfo -> CUInt
tcpi_rttvar :: CUInt
tcpi_rttvar, CUInt
tcpi_snd_cwnd :: StructTCPInfo -> CUInt
tcpi_snd_cwnd :: CUInt
tcpi_snd_cwnd }
Word16
len) =
Format
Text
(Word
-> Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
-> Word
-> Word
-> Word
-> Word
-> Word
-> Word
-> Word
-> Word16
-> Text
forall a. Format Text a -> a
sformat (Format
(Word
-> Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
(Word
-> Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
"TCPInfo rtt " Format
(Word
-> Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
(Word
-> Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
-> Format
Text
(Word
-> Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
-> Format
Text
(Word
-> Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
(Word
-> Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
forall a r. Integral a => Format r (a -> r)
int Format
(Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
(Word
-> Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
-> Format
Text
(Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
-> Format
Text
(Word
-> Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
(Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
" rttvar " Format
(Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
(Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
-> Format
Text
(Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
-> Format
Text
(Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
(Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
forall a r. Integral a => Format r (a -> r)
int Format
(Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
(Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
-> Format
Text (Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
-> Format
Text
(Word -> Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
(Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
" snd_cwnd " Format
(Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
(Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
-> Format
Text (Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
-> Format
Text (Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(Word -> Word -> Word -> Word -> Word16 -> Text)
(Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
forall a r. Integral a => Format r (a -> r)
int Format
(Word -> Word -> Word -> Word -> Word16 -> Text)
(Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
-> Format Text (Word -> Word -> Word -> Word -> Word16 -> Text)
-> Format
Text (Word -> Word -> Word -> Word -> Word -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
%
Format
(Word -> Word -> Word -> Word -> Word16 -> Text)
(Word -> Word -> Word -> Word -> Word16 -> Text)
" snd_mss " Format
(Word -> Word -> Word -> Word -> Word16 -> Text)
(Word -> Word -> Word -> Word -> Word16 -> Text)
-> Format Text (Word -> Word -> Word -> Word -> Word16 -> Text)
-> Format Text (Word -> Word -> Word -> Word -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(Word -> Word -> Word -> Word16 -> Text)
(Word -> Word -> Word -> Word -> Word16 -> Text)
forall a r. Integral a => Format r (a -> r)
int Format
(Word -> Word -> Word -> Word16 -> Text)
(Word -> Word -> Word -> Word -> Word16 -> Text)
-> Format Text (Word -> Word -> Word -> Word16 -> Text)
-> Format Text (Word -> Word -> Word -> Word -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(Word -> Word -> Word -> Word16 -> Text)
(Word -> Word -> Word -> Word16 -> Text)
" rcv_mss " Format
(Word -> Word -> Word -> Word16 -> Text)
(Word -> Word -> Word -> Word16 -> Text)
-> Format Text (Word -> Word -> Word -> Word16 -> Text)
-> Format Text (Word -> Word -> Word -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(Word -> Word -> Word16 -> Text)
(Word -> Word -> Word -> Word16 -> Text)
forall a r. Integral a => Format r (a -> r)
int Format
(Word -> Word -> Word16 -> Text)
(Word -> Word -> Word -> Word16 -> Text)
-> Format Text (Word -> Word -> Word16 -> Text)
-> Format Text (Word -> Word -> Word -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(Word -> Word -> Word16 -> Text) (Word -> Word -> Word16 -> Text)
" lost " Format
(Word -> Word -> Word16 -> Text) (Word -> Word -> Word16 -> Text)
-> Format Text (Word -> Word -> Word16 -> Text)
-> Format Text (Word -> Word -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (Word -> Word16 -> Text) (Word -> Word -> Word16 -> Text)
forall a r. Integral a => Format r (a -> r)
int Format (Word -> Word16 -> Text) (Word -> Word -> Word16 -> Text)
-> Format Text (Word -> Word16 -> Text)
-> Format Text (Word -> Word -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
%
Format (Word -> Word16 -> Text) (Word -> Word16 -> Text)
" retrans " Format (Word -> Word16 -> Text) (Word -> Word16 -> Text)
-> Format Text (Word -> Word16 -> Text)
-> Format Text (Word -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (Word16 -> Text) (Word -> Word16 -> Text)
forall a r. Integral a => Format r (a -> r)
int Format (Word16 -> Text) (Word -> Word16 -> Text)
-> Format Text (Word16 -> Text)
-> Format Text (Word -> Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (Word16 -> Text) (Word16 -> Text)
" len " Format (Word16 -> Text) (Word16 -> Text)
-> Format Text (Word16 -> Text) -> Format Text (Word16 -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (Word16 -> Text)
forall a r. Integral a => Format r (a -> r)
int)
(CUInt -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
tcpi_rtt :: Word)
(CUInt -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
tcpi_rttvar :: Word)
(CUInt -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
tcpi_snd_cwnd :: Word)
(CUInt -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
tcpi_snd_mss :: Word)
(CUInt -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
tcpi_rcv_mss :: Word)
(CUInt -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
tcpi_lost :: Word)
(CUInt -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
tcpi_retrans :: Word)
Word16
len
#else
forHuman (Mux.TraceTCPInfo _ len) = sformat ("TCPInfo len " % int) len
#endif
instance MetaTrace Mux.BearerTrace where
namespaceFor :: BearerTrace -> Namespace BearerTrace
namespaceFor Mux.TraceRecvHeaderStart {} =
[Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"RecvHeaderStart"]
namespaceFor Mux.TraceRecvHeaderEnd {} =
[Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"RecvHeaderEnd"]
namespaceFor Mux.TraceRecvStart {} =
[Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"RecvStart"]
namespaceFor Mux.TraceRecvRaw {} =
[Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"RecvRaw"]
namespaceFor Mux.TraceRecvEnd {} =
[Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"RecvEnd"]
namespaceFor Mux.TraceSendStart {} =
[Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"SendStart"]
namespaceFor BearerTrace
Mux.TraceSendEnd =
[Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"SendEnd"]
namespaceFor Mux.TraceRecvDeltaQObservation {} =
[Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"RecvDeltaQObservation"]
namespaceFor Mux.TraceRecvDeltaQSample {} =
[Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"RecvDeltaQSample"]
namespaceFor BearerTrace
Mux.TraceSDUReadTimeoutException =
[Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"SDUReadTimeoutException"]
namespaceFor BearerTrace
Mux.TraceSDUWriteTimeoutException =
[Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"SDUWriteTimeoutException"]
namespaceFor BearerTrace
Mux.TraceEmitDeltaQ =
[Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"TraceEmitDeltaQ"]
namespaceFor Mux.TraceTCPInfo {} =
[Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"TCPInfo"]
severityFor :: Namespace BearerTrace -> Maybe BearerTrace -> Maybe SeverityS
severityFor (Namespace [Text]
_ [Text
"RecvHeaderStart"]) Maybe BearerTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"RecvRaw"]) Maybe BearerTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"RecvHeaderEnd"]) Maybe BearerTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"RecvStart"]) Maybe BearerTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"RecvEnd"]) Maybe BearerTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"SendStart"]) Maybe BearerTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"SendEnd"]) Maybe BearerTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"RecvDeltaQObservation"]) Maybe BearerTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"RecvDeltaQSample"]) Maybe BearerTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"SDUReadTimeoutException"]) Maybe BearerTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Notice
severityFor (Namespace [Text]
_ [Text
"SDUWriteTimeoutException"]) Maybe BearerTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Notice
severityFor (Namespace [Text]
_ [Text
"TCPInfo"]) Maybe BearerTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"TraceEmitDeltaQ"]) Maybe BearerTrace
_ = Maybe SeverityS
forall a. Maybe a
Nothing
severityFor Namespace BearerTrace
_ Maybe BearerTrace
_ = Maybe SeverityS
forall a. Maybe a
Nothing
documentFor :: Namespace BearerTrace -> Maybe Text
documentFor (Namespace [Text]
_ [Text
"RecvHeaderStart"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Bearer receive header start."
documentFor (Namespace [Text]
_ [Text
"RecvRaw"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Bearer receive raw."
documentFor (Namespace [Text]
_ [Text
"RecvHeaderEnd"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Bearer receive header end."
documentFor (Namespace [Text]
_ [Text
"RecvStart"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Bearer receive start."
documentFor (Namespace [Text]
_ [Text
"RecvEnd"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Bearer receive end."
documentFor (Namespace [Text]
_ [Text
"SendStart"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Bearer send start."
documentFor (Namespace [Text]
_ [Text
"SendEnd"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Bearer send end."
documentFor (Namespace [Text]
_ [Text
"RecvDeltaQObservation"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Bearer DeltaQ observation."
documentFor (Namespace [Text]
_ [Text
"RecvDeltaQSample"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Bearer DeltaQ sample."
documentFor (Namespace [Text]
_ [Text
"SDUReadTimeoutException"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Timed out reading SDU."
documentFor (Namespace [Text]
_ [Text
"SDUWriteTimeoutException"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Timed out writing SDU."
documentFor (Namespace [Text]
_ [Text
"TraceEmitDeltaQ"]) = Maybe Text
forall a. Maybe a
Nothing
documentFor (Namespace [Text]
_ [Text
"TCPInfo"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"TCPInfo."
documentFor Namespace BearerTrace
_ = Maybe Text
forall a. Maybe a
Nothing
allNamespaces :: [Namespace BearerTrace]
allNamespaces = [
[Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"RecvHeaderStart"]
, [Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"RecvRaw"]
, [Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"RecvHeaderEnd"]
, [Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"RecvStart"]
, [Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"RecvEnd"]
, [Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"SendStart"]
, [Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"SendEnd"]
, [Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"RecvDeltaQObservation"]
, [Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"RecvDeltaQSample"]
, [Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"SDUReadTimeoutException"]
, [Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"SDUWriteTimeoutException"]
, [Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"TraceEmitDeltaQ"]
, [Text] -> [Text] -> Namespace BearerTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"TCPInfo"]
]
instance LogFormatting Mux.ChannelTrace where
forMachine :: DetailLevel -> ChannelTrace -> Object
forMachine DetailLevel
_dtal (Mux.TraceChannelRecvStart MiniProtocolNum
mid) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceChannelRecvStart"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Channel Receive Start"
, Key
"miniProtocolNum" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolNum -> Text
forall a. Show a => a -> Text
showT MiniProtocolNum
mid)
]
forMachine DetailLevel
_dtal (Mux.TraceChannelRecvEnd MiniProtocolNum
mid Int
len) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceChannelRecvEnd"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Channel Receive End"
, Key
"miniProtocolNum" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolNum -> Text
forall a. Show a => a -> Text
showT MiniProtocolNum
mid)
, Key
"length" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Int -> Text
forall a. Show a => a -> Text
showT Int
len)
]
forMachine DetailLevel
_dtal (Mux.TraceChannelSendStart MiniProtocolNum
mid) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceChannelSendStart"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Channel Send Start"
, Key
"miniProtocolNum" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolNum -> Text
forall a. Show a => a -> Text
showT MiniProtocolNum
mid)
]
forMachine DetailLevel
_dtal (Mux.TraceChannelSendEnd MiniProtocolNum
mid Int
len) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceChannelSendEnd"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Channel Send End"
, Key
"miniProtocolNum" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolNum -> Text
forall a. Show a => a -> Text
showT MiniProtocolNum
mid)
, Key
"length" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (Int -> Text
forall a. Show a => a -> Text
showT Int
len)
]
forHuman :: ChannelTrace -> Text
forHuman (Mux.TraceChannelRecvStart MiniProtocolNum
mid) =
Format Text (MiniProtocolNum -> Text) -> MiniProtocolNum -> Text
forall a. Format Text a -> a
sformat (Format (MiniProtocolNum -> Text) (MiniProtocolNum -> Text)
"Channel Receive Start on " Format (MiniProtocolNum -> Text) (MiniProtocolNum -> Text)
-> Format Text (MiniProtocolNum -> Text)
-> Format Text (MiniProtocolNum -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (MiniProtocolNum -> Text)
forall a r. Show a => Format r (a -> r)
shown) MiniProtocolNum
mid
forHuman (Mux.TraceChannelRecvEnd MiniProtocolNum
mid Int
len) =
Format Text (MiniProtocolNum -> Int -> Text)
-> MiniProtocolNum -> Int -> Text
forall a. Format Text a -> a
sformat (Format
(MiniProtocolNum -> Int -> Text) (MiniProtocolNum -> Int -> Text)
"Channel Receive End on (" Format
(MiniProtocolNum -> Int -> Text) (MiniProtocolNum -> Int -> Text)
-> Format Text (MiniProtocolNum -> Int -> Text)
-> Format Text (MiniProtocolNum -> Int -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (Int -> Text) (MiniProtocolNum -> Int -> Text)
forall a r. Show a => Format r (a -> r)
shown Format (Int -> Text) (MiniProtocolNum -> Int -> Text)
-> Format Text (Int -> Text)
-> Format Text (MiniProtocolNum -> Int -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (Int -> Text) (Int -> Text)
") " Format (Int -> Text) (Int -> Text)
-> Format Text (Int -> Text) -> Format Text (Int -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (Int -> Text)
forall a r. Integral a => Format r (a -> r)
int) MiniProtocolNum
mid Int
len
forHuman (Mux.TraceChannelSendStart MiniProtocolNum
mid) =
Format Text (MiniProtocolNum -> Text) -> MiniProtocolNum -> Text
forall a. Format Text a -> a
sformat (Format (MiniProtocolNum -> Text) (MiniProtocolNum -> Text)
"Channel Send Start on " Format (MiniProtocolNum -> Text) (MiniProtocolNum -> Text)
-> Format Text (MiniProtocolNum -> Text)
-> Format Text (MiniProtocolNum -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (MiniProtocolNum -> Text)
forall a r. Show a => Format r (a -> r)
shown) MiniProtocolNum
mid
forHuman (Mux.TraceChannelSendEnd MiniProtocolNum
mid Int
len) =
Format Text (MiniProtocolNum -> Int -> Text)
-> MiniProtocolNum -> Int -> Text
forall a. Format Text a -> a
sformat (Format
(MiniProtocolNum -> Int -> Text) (MiniProtocolNum -> Int -> Text)
"Channel Send End on (" Format
(MiniProtocolNum -> Int -> Text) (MiniProtocolNum -> Int -> Text)
-> Format Text (MiniProtocolNum -> Int -> Text)
-> Format Text (MiniProtocolNum -> Int -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (Int -> Text) (MiniProtocolNum -> Int -> Text)
forall a r. Show a => Format r (a -> r)
shown Format (Int -> Text) (MiniProtocolNum -> Int -> Text)
-> Format Text (Int -> Text)
-> Format Text (MiniProtocolNum -> Int -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (Int -> Text) (Int -> Text)
") " Format (Int -> Text) (Int -> Text)
-> Format Text (Int -> Text) -> Format Text (Int -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (Int -> Text)
forall a r. Integral a => Format r (a -> r)
int) MiniProtocolNum
mid Int
len
instance MetaTrace Mux.ChannelTrace where
namespaceFor :: ChannelTrace -> Namespace ChannelTrace
namespaceFor Mux.TraceChannelRecvStart {} =
[Text] -> [Text] -> Namespace ChannelTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ChannelRecvStart"]
namespaceFor Mux.TraceChannelRecvEnd {} =
[Text] -> [Text] -> Namespace ChannelTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ChannelRecvEnd"]
namespaceFor Mux.TraceChannelSendStart {} =
[Text] -> [Text] -> Namespace ChannelTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ChannelSendStart"]
namespaceFor Mux.TraceChannelSendEnd {} =
[Text] -> [Text] -> Namespace ChannelTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ChannelSendEnd"]
severityFor :: Namespace ChannelTrace -> Maybe ChannelTrace -> Maybe SeverityS
severityFor (Namespace [Text]
_ [Text
"ChannelRecvStart"]) Maybe ChannelTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"ChannelRecvEnd"]) Maybe ChannelTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"ChannelSendStart"]) Maybe ChannelTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"ChannelSendEnd"]) Maybe ChannelTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor Namespace ChannelTrace
_ Maybe ChannelTrace
_ = Maybe SeverityS
forall a. Maybe a
Nothing
documentFor :: Namespace ChannelTrace -> Maybe Text
documentFor (Namespace [Text]
_ [Text
"ChannelRecvStart"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Channel receive start."
documentFor (Namespace [Text]
_ [Text
"ChannelRecvEnd"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Channel receive end."
documentFor (Namespace [Text]
_ [Text
"ChannelSendStart"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Channel send start."
documentFor (Namespace [Text]
_ [Text
"ChannelSendEnd"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Channel send end."
documentFor Namespace ChannelTrace
_ = Maybe Text
forall a. Maybe a
Nothing
allNamespaces :: [Namespace ChannelTrace]
allNamespaces = [
[Text] -> [Text] -> Namespace ChannelTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ChannelRecvStart"]
, [Text] -> [Text] -> Namespace ChannelTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ChannelRecvEnd"]
, [Text] -> [Text] -> Namespace ChannelTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ChannelSendStart"]
, [Text] -> [Text] -> Namespace ChannelTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ChannelSendEnd"]
]
txsMempoolTimeoutHardCounterName :: Text
txsMempoolTimeoutHardCounterName :: Text
txsMempoolTimeoutHardCounterName = Text
"txsMempoolTimeoutHard"
impliesMempoolTimeoutHard :: Mux.Trace -> Bool
impliesMempoolTimeoutHard :: Trace -> Bool
impliesMempoolTimeoutHard = \case
Mux.TraceExceptionExit MiniProtocolNum
_mid MiniProtocolDir
_dir SomeException
e
| [Char] -> [Char] -> Bool
forall a. Eq a => [a] -> [a] -> Bool
isPrefixOf [Char]
"ExnMempoolTimeout " (SomeException -> [Char]
forall a. Show a => a -> [Char]
show SomeException
e) -> Bool
True
Trace
_ -> Bool
False
instance LogFormatting Mux.Trace where
forMachine :: DetailLevel -> Trace -> Object
forMachine DetailLevel
_dtal (Mux.TraceState State
new) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceState"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MuxState"
, Key
"state" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (State -> Text
forall a. Show a => a -> Text
showT State
new)
]
forMachine DetailLevel
_dtal (Mux.TraceCleanExit MiniProtocolNum
mid MiniProtocolDir
dir) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceCleanExit"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Miniprotocol terminated cleanly"
, Key
"miniProtocolNum" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolNum -> Text
forall a. Show a => a -> Text
showT MiniProtocolNum
mid)
, Key
"miniProtocolDir" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolDir -> Text
forall a. Show a => a -> Text
showT MiniProtocolDir
dir)
]
forMachine DetailLevel
_dtal (Mux.TraceExceptionExit MiniProtocolNum
mid MiniProtocolDir
dir SomeException
exc) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceExceptionExit"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Miniprotocol terminated with exception"
, Key
"miniProtocolNum" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolNum -> Text
forall a. Show a => a -> Text
showT MiniProtocolNum
mid)
, Key
"miniProtocolDir" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolDir -> Text
forall a. Show a => a -> Text
showT MiniProtocolDir
dir)
, Key
"exception" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (SomeException -> Text
forall a. Show a => a -> Text
showT SomeException
exc)
]
forMachine DetailLevel
_dtal (Mux.TraceStartEagerly MiniProtocolNum
mid MiniProtocolDir
dir) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceStartEagerly"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Eagerly started"
, Key
"miniProtocolNum" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolNum -> Text
forall a. Show a => a -> Text
showT MiniProtocolNum
mid)
, Key
"miniProtocolDir" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolDir -> Text
forall a. Show a => a -> Text
showT MiniProtocolDir
dir)
]
forMachine DetailLevel
_dtal (Mux.TraceStartOnDemand MiniProtocolNum
mid MiniProtocolDir
dir) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceStartOnDemand"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Preparing to start"
, Key
"miniProtocolNum" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolNum -> Text
forall a. Show a => a -> Text
showT MiniProtocolNum
mid)
, Key
"miniProtocolDir" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolDir -> Text
forall a. Show a => a -> Text
showT MiniProtocolDir
dir)
]
forMachine DetailLevel
_dtal (Mux.TraceStartOnDemandAny MiniProtocolNum
mid MiniProtocolDir
dir) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceStartOnDemandAny"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Preparing to start"
, Key
"miniProtocolNum" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolNum -> Text
forall a. Show a => a -> Text
showT MiniProtocolNum
mid)
, Key
"miniProtocolDir" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolDir -> Text
forall a. Show a => a -> Text
showT MiniProtocolDir
dir)
]
forMachine DetailLevel
_dtal (Mux.TraceStartedOnDemand MiniProtocolNum
mid MiniProtocolDir
dir) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceStartedOnDemand"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Started on demand"
, Key
"miniProtocolNum" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolNum -> Text
forall a. Show a => a -> Text
showT MiniProtocolNum
mid)
, Key
"miniProtocolDir" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolDir -> Text
forall a. Show a => a -> Text
showT MiniProtocolDir
dir)
]
forMachine DetailLevel
_dtal (Mux.TraceTerminating MiniProtocolNum
mid MiniProtocolDir
dir) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceTerminating"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Terminating"
, Key
"miniProtocolNum" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolNum -> Text
forall a. Show a => a -> Text
showT MiniProtocolNum
mid)
, Key
"miniProtocolDir" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolDir -> Text
forall a. Show a => a -> Text
showT MiniProtocolDir
dir)
]
forMachine DetailLevel
_dtal (Mux.TraceNewMux [MiniProtocolInfo mode]
_) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceNewMux"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"New Mux"
]
forMachine DetailLevel
_dtal Trace
Mux.TraceStarting = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceSarting"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux starting"
]
forMachine DetailLevel
_dtal Trace
Mux.TraceStopping = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceStopping"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux stopping"
]
forMachine DetailLevel
_dtal Trace
Mux.TraceStopped = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux.TraceStopped"
, Key
"msg" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Mux stoppped"
]
forHuman :: Trace -> Text
forHuman (Mux.TraceState State
new) =
Format Text (State -> Text) -> State -> Text
forall a. Format Text a -> a
sformat (Format (State -> Text) (State -> Text)
"State: " Format (State -> Text) (State -> Text)
-> Format Text (State -> Text) -> Format Text (State -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (State -> Text)
forall a r. Show a => Format r (a -> r)
shown) State
new
forHuman (Mux.TraceCleanExit MiniProtocolNum
mid MiniProtocolDir
dir) =
Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
-> MiniProtocolNum -> MiniProtocolDir -> Text
forall a. Format Text a -> a
sformat (Format
(MiniProtocolNum -> MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
"Miniprotocol (" Format
(MiniProtocolNum -> MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
forall a r. Show a => Format r (a -> r)
shown Format
(MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (MiniProtocolDir -> Text) (MiniProtocolDir -> Text)
") " Format (MiniProtocolDir -> Text) (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (MiniProtocolDir -> Text)
forall a r. Show a => Format r (a -> r)
shown Format Text (MiniProtocolDir -> Text)
-> Format Text Text -> Format Text (MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text Text
" terminated cleanly")
MiniProtocolNum
mid MiniProtocolDir
dir
forHuman (Mux.TraceExceptionExit MiniProtocolNum
mid MiniProtocolDir
dir SomeException
e) =
Format
Text (MiniProtocolNum -> MiniProtocolDir -> SomeException -> Text)
-> MiniProtocolNum -> MiniProtocolDir -> SomeException -> Text
forall a. Format Text a -> a
sformat (Format
(MiniProtocolNum -> MiniProtocolDir -> SomeException -> Text)
(MiniProtocolNum -> MiniProtocolDir -> SomeException -> Text)
"Miniprotocol (" Format
(MiniProtocolNum -> MiniProtocolDir -> SomeException -> Text)
(MiniProtocolNum -> MiniProtocolDir -> SomeException -> Text)
-> Format
Text (MiniProtocolNum -> MiniProtocolDir -> SomeException -> Text)
-> Format
Text (MiniProtocolNum -> MiniProtocolDir -> SomeException -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(MiniProtocolDir -> SomeException -> Text)
(MiniProtocolNum -> MiniProtocolDir -> SomeException -> Text)
forall a r. Show a => Format r (a -> r)
shown Format
(MiniProtocolDir -> SomeException -> Text)
(MiniProtocolNum -> MiniProtocolDir -> SomeException -> Text)
-> Format Text (MiniProtocolDir -> SomeException -> Text)
-> Format
Text (MiniProtocolNum -> MiniProtocolDir -> SomeException -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(MiniProtocolDir -> SomeException -> Text)
(MiniProtocolDir -> SomeException -> Text)
") " Format
(MiniProtocolDir -> SomeException -> Text)
(MiniProtocolDir -> SomeException -> Text)
-> Format Text (MiniProtocolDir -> SomeException -> Text)
-> Format Text (MiniProtocolDir -> SomeException -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(SomeException -> Text) (MiniProtocolDir -> SomeException -> Text)
forall a r. Show a => Format r (a -> r)
shown Format
(SomeException -> Text) (MiniProtocolDir -> SomeException -> Text)
-> Format Text (SomeException -> Text)
-> Format Text (MiniProtocolDir -> SomeException -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
%
Format (SomeException -> Text) (SomeException -> Text)
" terminated with exception " Format (SomeException -> Text) (SomeException -> Text)
-> Format Text (SomeException -> Text)
-> Format Text (SomeException -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (SomeException -> Text)
forall a r. Show a => Format r (a -> r)
shown) MiniProtocolNum
mid MiniProtocolDir
dir SomeException
e
forHuman (Mux.TraceStartEagerly MiniProtocolNum
mid MiniProtocolDir
dir) =
Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
-> MiniProtocolNum -> MiniProtocolDir -> Text
forall a. Format Text a -> a
sformat (Format
(MiniProtocolNum -> MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
"Eagerly started (" Format
(MiniProtocolNum -> MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
forall a r. Show a => Format r (a -> r)
shown Format
(MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (MiniProtocolDir -> Text) (MiniProtocolDir -> Text)
") in " Format (MiniProtocolDir -> Text) (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (MiniProtocolDir -> Text)
forall a r. Show a => Format r (a -> r)
shown) MiniProtocolNum
mid MiniProtocolDir
dir
forHuman (Mux.TraceStartOnDemand MiniProtocolNum
mid MiniProtocolDir
dir) =
Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
-> MiniProtocolNum -> MiniProtocolDir -> Text
forall a. Format Text a -> a
sformat (Format
(MiniProtocolNum -> MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
"Preparing to start (" Format
(MiniProtocolNum -> MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
forall a r. Show a => Format r (a -> r)
shown Format
(MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (MiniProtocolDir -> Text) (MiniProtocolDir -> Text)
") in " Format (MiniProtocolDir -> Text) (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (MiniProtocolDir -> Text)
forall a r. Show a => Format r (a -> r)
shown) MiniProtocolNum
mid MiniProtocolDir
dir
forHuman (Mux.TraceStartOnDemandAny MiniProtocolNum
mid MiniProtocolDir
dir) =
Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
-> MiniProtocolNum -> MiniProtocolDir -> Text
forall a. Format Text a -> a
sformat (Format
(MiniProtocolNum -> MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
"Preparing to start (" Format
(MiniProtocolNum -> MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
forall a r. Show a => Format r (a -> r)
shown Format
(MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (MiniProtocolDir -> Text) (MiniProtocolDir -> Text)
") in " Format (MiniProtocolDir -> Text) (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (MiniProtocolDir -> Text)
forall a r. Show a => Format r (a -> r)
shown) MiniProtocolNum
mid MiniProtocolDir
dir
forHuman (Mux.TraceStartedOnDemand MiniProtocolNum
mid MiniProtocolDir
dir) =
Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
-> MiniProtocolNum -> MiniProtocolDir -> Text
forall a. Format Text a -> a
sformat (Format
(MiniProtocolNum -> MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
"Started on demand (" Format
(MiniProtocolNum -> MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
forall a r. Show a => Format r (a -> r)
shown Format
(MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (MiniProtocolDir -> Text) (MiniProtocolDir -> Text)
") in " Format (MiniProtocolDir -> Text) (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (MiniProtocolDir -> Text)
forall a r. Show a => Format r (a -> r)
shown) MiniProtocolNum
mid MiniProtocolDir
dir
forHuman (Mux.TraceTerminating MiniProtocolNum
mid MiniProtocolDir
dir) =
Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
-> MiniProtocolNum -> MiniProtocolDir -> Text
forall a. Format Text a -> a
sformat (Format
(MiniProtocolNum -> MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
"Terminating (" Format
(MiniProtocolNum -> MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format
(MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
forall a r. Show a => Format r (a -> r)
shown Format
(MiniProtocolDir -> Text)
(MiniProtocolNum -> MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolNum -> MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format (MiniProtocolDir -> Text) (MiniProtocolDir -> Text)
") in " Format (MiniProtocolDir -> Text) (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
-> Format Text (MiniProtocolDir -> Text)
forall r a r'. Format r a -> Format r' r -> Format r' a
% Format Text (MiniProtocolDir -> Text)
forall a r. Show a => Format r (a -> r)
shown) MiniProtocolNum
mid MiniProtocolDir
dir
forHuman (Mux.TraceNewMux [MiniProtocolInfo mode]
_) = Text
"New Mux"
forHuman Trace
Mux.TraceStarting = Text
"Mux Starting"
forHuman Trace
Mux.TraceStopping = Text
"Mux stopping"
forHuman Trace
Mux.TraceStopped = Text
"Mux stoppped"
asMetrics :: Trace -> [Metric]
asMetrics = \case
Mux.TraceState{} -> []
Mux.TraceCleanExit{} -> []
ev :: Trace
ev@Mux.TraceExceptionExit{} ->
[ Text -> Maybe Int -> Metric
CounterM Text
txsMempoolTimeoutHardCounterName Maybe Int
forall a. Maybe a
Nothing
| Trace -> Bool
impliesMempoolTimeoutHard Trace
ev
]
Mux.TraceStartEagerly{} -> []
Mux.TraceStartOnDemand{} -> []
Mux.TraceStartOnDemandAny{} -> []
Mux.TraceStartedOnDemand{} -> []
Mux.TraceTerminating{} -> []
Mux.TraceNewMux{} -> []
Mux.TraceStarting{} -> []
Mux.TraceStopping{} -> []
Mux.TraceStopped{} -> []
instance MetaTrace Mux.Trace where
namespaceFor :: Trace -> Namespace Trace
namespaceFor Mux.TraceState {} =
[Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"State"]
namespaceFor Mux.TraceCleanExit {} =
[Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"CleanExit"]
namespaceFor Mux.TraceExceptionExit {} =
[Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ExceptionExit"]
namespaceFor Mux.TraceStartEagerly {} =
[Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"StartEagerly"]
namespaceFor Mux.TraceStartOnDemand {} =
[Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"StartOnDemand"]
namespaceFor Mux.TraceStartOnDemandAny {} =
[Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"StartOnDemandAny"]
namespaceFor Mux.TraceStartedOnDemand {} =
[Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"StartedOnDemand"]
namespaceFor Mux.TraceTerminating {} =
[Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"Terminating"]
namespaceFor (Mux.TraceNewMux [MiniProtocolInfo mode]
_) =
[Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"NewMux"]
namespaceFor Trace
Mux.TraceStarting =
[Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"Starting"]
namespaceFor Trace
Mux.TraceStopping =
[Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"Stopping"]
namespaceFor Trace
Mux.TraceStopped =
[Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"Stopped"]
severityFor :: Namespace Trace -> Maybe Trace -> Maybe SeverityS
severityFor (Namespace [Text]
_ [Text
"State"]) Maybe Trace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
severityFor (Namespace [Text]
_ [Text
"CleanExit"]) Maybe Trace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Notice
severityFor (Namespace [Text]
_ [Text
"ExceptionExit"]) Maybe Trace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Notice
severityFor (Namespace [Text]
_ [Text
"StartEagerly"]) Maybe Trace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"StartOnDemand"]) Maybe Trace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"StartOnDemandAny"]) Maybe Trace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"StartedOnDemand"]) Maybe Trace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"Terminating"]) Maybe Trace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"NewMux"]) Maybe Trace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"Starting"]) Maybe Trace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"Stopping"]) Maybe Trace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor (Namespace [Text]
_ [Text
"Stopped"]) Maybe Trace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
severityFor Namespace Trace
_ Maybe Trace
_ = Maybe SeverityS
forall a. Maybe a
Nothing
documentFor :: Namespace Trace -> Maybe Text
documentFor (Namespace [Text]
_ [Text
"State"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"State."
documentFor (Namespace [Text]
_ [Text
"CleanExit"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Miniprotocol terminated cleanly."
documentFor (Namespace [Text]
_ [Text
"ExceptionExit"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Miniprotocol terminated with exception."
documentFor (Namespace [Text]
_ [Text
"StartEagerly"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Eagerly started."
documentFor (Namespace [Text]
_ [Text
"StartOnDemand"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Preparing to start."
documentFor (Namespace [Text]
_ [Text
"StartedOnDemand"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Started on demand."
documentFor (Namespace [Text]
_ [Text
"StartOnDemandAny"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Start whenever any other protocol has started."
documentFor (Namespace [Text]
_ [Text
"Terminating"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Terminating."
documentFor (Namespace [Text]
_ [Text
"NewMux"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"New Mux"
documentFor (Namespace [Text]
_ [Text
"Starting"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Mux Starting"
documentFor (Namespace [Text]
_ [Text
"Stopping"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Mux shutdown."
documentFor (Namespace [Text]
_ [Text
"Stopped"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
Text
"Mux shutdown."
documentFor Namespace Trace
_ = Maybe Text
forall a. Maybe a
Nothing
metricsDocFor :: Namespace Trace -> [(Text, Text)]
metricsDocFor (Namespace [Text]
_ [Text
"State"]) = []
metricsDocFor (Namespace [Text]
_ [Text
"CleanExit"]) = []
metricsDocFor (Namespace [Text]
_ [Text
"ExceptionExit"]) =
[ (Text
txsMempoolTimeoutHardCounterName, Text
"Transactions that hard timed out in mempool")
]
metricsDocFor (Namespace [Text]
_ [Text
"StartEagerly"]) = []
metricsDocFor (Namespace [Text]
_ [Text
"StartOnDemand"]) = []
metricsDocFor (Namespace [Text]
_ [Text
"StartedOnDemand"]) = []
metricsDocFor (Namespace [Text]
_ [Text
"StartOnDemandAny"]) = []
metricsDocFor (Namespace [Text]
_ [Text
"Terminating"]) = []
metricsDocFor (Namespace [Text]
_ [Text
"NewMux"]) = []
metricsDocFor (Namespace [Text]
_ [Text
"Starting"]) = []
metricsDocFor (Namespace [Text]
_ [Text
"Stopping"]) = []
metricsDocFor (Namespace [Text]
_ [Text
"Stopped"]) = []
metricsDocFor Namespace Trace
_ = []
allNamespaces :: [Namespace Trace]
allNamespaces = [
[Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"State"]
, [Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"CleanExit"]
, [Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ExceptionExit"]
, [Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"StartEagerly"]
, [Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"StartOnDemand"]
, [Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"StartOnDemandAny"]
, [Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"StartedOnDemand"]
, [Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"Terminating"]
, [Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"NewMux"]
, [Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"Starting"]
, [Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"Stopping"]
, [Text] -> [Text] -> Namespace Trace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"Stopped"]
]
data Side = Remote | Local
sideDoc :: Side -> Text
sideDoc :: Side -> Text
sideDoc Side
Remote = Text
"node-to-node"
sideDoc Side
Local = Text
"node-to-client"
onSide :: Side -> Text -> Text
onSide :: Side -> Text -> Text
onSide Side
Remote Text
name = Text
name
onSide Side
Local Text
name = Text
"local" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text -> Text
Text.toUpper (Int -> Text -> Text
Text.take Int
1 Text
name) Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Int -> Text -> Text
Text.drop Int
1 Text
name
data FailureCount = FailureCount {
FailureCount -> Text
fcName :: Text,
FailureCount -> Text
fcLabel :: Text,
FailureCount -> Word64
fcCount :: Word64,
FailureCount -> Text
fcDoc :: Text
}
fcKey :: FailureCount -> Key
fcKey :: FailureCount -> Key
fcKey = Text -> Key
Key.fromText (Text -> Key) -> (FailureCount -> Text) -> FailureCount -> Key
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char -> Bool) -> Text -> Text
Text.takeWhileEnd (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
/= Char
'.') (Text -> Text) -> (FailureCount -> Text) -> FailureCount -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FailureCount -> Text
fcName
failureCounts :: Mux.Failures -> [FailureCount]
failureCounts :: Failures -> [FailureCount]
failureCounts (Mux.Failures Word64
mfWriteTimeouts Word64
mfWriteErrors Word64
mfReadTimeouts Word64
mfOverruns
Word64
mfProtocolErrors Word64
mfReadErrors Word64
mfPeerClosed Word64
mfOtherErrors
Map (MiniProtocolNum, MiniProtocolDir) Word64
_miniProtocols) =
[ Text -> Text -> Word64 -> Text -> FailureCount
FailureCount Text
"mux.egress.writeTimeouts" Text
"write timeouts" Word64
mfWriteTimeouts
Text
"Muxes dropped because the peer took nothing within the SDU timeout."
, Text -> Text -> Word64 -> Text -> FailureCount
FailureCount Text
"mux.egress.writeErrors" Text
"write errors" Word64
mfWriteErrors
(Text
"Muxes dropped because a write failed otherwise than by the peer closing; on "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"Windows a reset counts here.")
, Text -> Text -> Word64 -> Text -> FailureCount
FailureCount Text
"mux.ingress.readTimeouts" Text
"read timeouts" Word64
mfReadTimeouts
Text
"Muxes dropped because an SDU did not arrive in full within the SDU timeout."
, Text -> Text -> Word64 -> Text -> FailureCount
FailureCount Text
"mux.ingress.overruns" Text
"overruns" Word64
mfOverruns
Text
"Muxes dropped because the peer exceeded a mini-protocol's ingress limit."
, Text -> Text -> Word64 -> Text -> FailureCount
FailureCount Text
"mux.ingress.protocolErrors" Text
"protocol errors" Word64
mfProtocolErrors
(Text
"Muxes dropped for undecodable SDUs, unknown mini-protocols, or data "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"an initiator-only mux cannot take.")
, Text -> Text -> Word64 -> Text -> FailureCount
FailureCount Text
"mux.ingress.readErrors" Text
"read errors" Word64
mfReadErrors
(Text
"Muxes dropped because a read failed otherwise than by the peer closing: "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"a connection that timed out, a host unreachable; on Windows a reset counts "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"here.")
, Text -> Text -> Word64 -> Text -> FailureCount
FailureCount Text
"mux.peerClosed" Text
"peers closed" Word64
mfPeerClosed
(Text
"Muxes dropped because the peer closed the connection: read as its end while "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"a mini-protocol was running, or met by a read or a write as a reset or a "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"broken pipe by errno. On Windows the socket library reports a reset under "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"EINVAL, not its own errno, so it counts as a read or write error instead, "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"and a client closing its named pipe is read as a broken pipe, so a "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"node-to-client session's normal end counts here, which on other platforms "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"it does not.")
, Text -> Text -> Word64 -> Text -> FailureCount
FailureCount Text
"mux.otherErrors" Text
"other errors" Word64
mfOtherErrors
(Text
"Muxes dropped because the muxer or the demuxer died with an exception of "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"a kind not listed: an encoding that would not force, a bug.")
]
dirName :: MiniProtocolDir -> Text
dirName :: MiniProtocolDir -> Text
dirName MiniProtocolDir
InitiatorDir = Text
"initiator"
dirName MiniProtocolDir
ResponderDir = Text
"responder"
instance LogFormatting Mux.CountersTrace where
forMachine :: DetailLevel -> CountersTrace -> Object
forMachine DetailLevel
_dtal = \case
Mux.TraceRemoteCounters Counts
c -> Text -> Counts -> Object
countsObject Text
"Mux.TraceRemoteCounters" Counts
c
Mux.TraceLocalCounters Counts
c -> Text -> Counts -> Object
countsObject Text
"Mux.TraceLocalCounters" Counts
c
where
countsObject :: Text -> Mux.Counts -> Object
countsObject :: Text -> Counts -> Object
countsObject Text
kind
Mux.Counts { mcFailures :: Counts -> Failures
Mux.mcFailures = Failures
failures, Map (MiniProtocolNum, MiniProtocolDir) Word64
mcSent :: Map (MiniProtocolNum, MiniProtocolDir) Word64
mcSent :: Counts -> Map (MiniProtocolNum, MiniProtocolDir) Word64
Mux.mcSent, Map (MiniProtocolNum, MiniProtocolDir) Word64
mcReceived :: Map (MiniProtocolNum, MiniProtocolDir) Word64
mcReceived :: Counts -> Map (MiniProtocolNum, MiniProtocolDir) Word64
Mux.mcReceived } =
[Object] -> Object
forall a. Monoid a => [a] -> a
mconcat ([Object] -> Object) -> [Object] -> Object
forall a b. (a -> b) -> a -> b
$
[ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
kind ]
[Object] -> [Object] -> [Object]
forall a. [a] -> [a] -> [a]
++ [ FailureCount -> Key
fcKey FailureCount
c Key -> Word64 -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= FailureCount -> Word64
fcCount FailureCount
c | FailureCount
c <- Failures -> [FailureCount]
failureCounts Failures
failures ]
[Object] -> [Object] -> [Object]
forall a. [a] -> [a] -> [a]
++ [ Key
"miniProtocolFailures" Key -> Word64 -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Map (MiniProtocolNum, MiniProtocolDir) Word64 -> Word64
forall a. Num a => Map (MiniProtocolNum, MiniProtocolDir) a -> a
forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum Map (MiniProtocolNum, MiniProtocolDir) Word64
protocols
, Key
"miniProtocolFailuresByProtocol" Key -> [Value] -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Key -> Map (MiniProtocolNum, MiniProtocolDir) Word64 -> [Value]
byProtocol Key
"failures" Map (MiniProtocolNum, MiniProtocolDir) Word64
protocols
, Key
"bytesSent" Key -> Word64 -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Map (MiniProtocolNum, MiniProtocolDir) Word64 -> Word64
forall a. Num a => Map (MiniProtocolNum, MiniProtocolDir) a -> a
forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum Map (MiniProtocolNum, MiniProtocolDir) Word64
mcSent
, Key
"bytesSentByProtocol" Key -> [Value] -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Key -> Map (MiniProtocolNum, MiniProtocolDir) Word64 -> [Value]
byProtocol Key
"bytes" Map (MiniProtocolNum, MiniProtocolDir) Word64
mcSent
, Key
"bytesReceived" Key -> Word64 -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Map (MiniProtocolNum, MiniProtocolDir) Word64 -> Word64
forall a. Num a => Map (MiniProtocolNum, MiniProtocolDir) a -> a
forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum Map (MiniProtocolNum, MiniProtocolDir) Word64
mcReceived
, Key
"bytesReceivedByProtocol" Key -> [Value] -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Key -> Map (MiniProtocolNum, MiniProtocolDir) Word64 -> [Value]
byProtocol Key
"bytes" Map (MiniProtocolNum, MiniProtocolDir) Word64
mcReceived
]
where
protocols :: Map (Mux.MiniProtocolNum, MiniProtocolDir) Word64
protocols :: Map (MiniProtocolNum, MiniProtocolDir) Word64
protocols = Failures -> Map (MiniProtocolNum, MiniProtocolDir) Word64
Mux.mfMiniProtocols Failures
failures
byProtocol :: Key -> Map (Mux.MiniProtocolNum, MiniProtocolDir) Word64 -> [Value]
byProtocol :: Key -> Map (MiniProtocolNum, MiniProtocolDir) Word64 -> [Value]
byProtocol Key
what Map (MiniProtocolNum, MiniProtocolDir) Word64
counts =
[ [Pair] -> Value
object [ Key
"protocol" Key -> Word16 -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Word16
n, Key
"direction" Key -> Value -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (MiniProtocolDir -> Text
forall a. Show a => a -> Text
showT MiniProtocolDir
d), Key
what Key -> Word64 -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Word64
b ]
| ((Mux.MiniProtocolNum Word16
n, MiniProtocolDir
d), Word64
b) <- Map (MiniProtocolNum, MiniProtocolDir) Word64
-> [((MiniProtocolNum, MiniProtocolDir), Word64)]
forall k a. Map k a -> [(k, a)]
Map.toList Map (MiniProtocolNum, MiniProtocolDir) Word64
counts
]
forHuman :: CountersTrace -> Text
forHuman = \case
Mux.TraceRemoteCounters Counts
c -> Text
"Node-to-node mux counters: " Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Counts -> Text
countsLine Counts
c
Mux.TraceLocalCounters Counts
c -> Text
"Node-to-client mux counters: " Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Counts -> Text
countsLine Counts
c
where
countsLine :: Mux.Counts -> Text
countsLine :: Counts -> Text
countsLine Mux.Counts { mcFailures :: Counts -> Failures
Mux.mcFailures = Failures
failures, Map (MiniProtocolNum, MiniProtocolDir) Word64
mcSent :: Counts -> Map (MiniProtocolNum, MiniProtocolDir) Word64
mcSent :: Map (MiniProtocolNum, MiniProtocolDir) Word64
Mux.mcSent, Map (MiniProtocolNum, MiniProtocolDir) Word64
mcReceived :: Counts -> Map (MiniProtocolNum, MiniProtocolDir) Word64
mcReceived :: Map (MiniProtocolNum, MiniProtocolDir) Word64
Mux.mcReceived } =
Text -> [Text] -> Text
Text.intercalate Text
", " ([Text] -> Text) -> [Text] -> Text
forall a b. (a -> b) -> a -> b
$
[ Word64 -> Text
forall a. Show a => a -> Text
showT (Map (MiniProtocolNum, MiniProtocolDir) Word64 -> Word64
forall a. Num a => Map (MiniProtocolNum, MiniProtocolDir) a -> a
forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum Map (MiniProtocolNum, MiniProtocolDir) Word64
mcSent) Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
" bytes sent"
, Word64 -> Text
forall a. Show a => a -> Text
showT (Map (MiniProtocolNum, MiniProtocolDir) Word64 -> Word64
forall a. Num a => Map (MiniProtocolNum, MiniProtocolDir) a -> a
forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum Map (MiniProtocolNum, MiniProtocolDir) Word64
mcReceived) Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
" bytes received" ]
[Text] -> [Text] -> [Text]
forall a. [a] -> [a] -> [a]
++ [ Word64 -> Text
forall a. Show a => a -> Text
showT (FailureCount -> Word64
fcCount FailureCount
c) Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
" " Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> FailureCount -> Text
fcLabel FailureCount
c
| FailureCount
c <- Failures -> [FailureCount]
failureCounts Failures
failures
, FailureCount -> Word64
fcCount FailureCount
c Word64 -> Word64 -> Bool
forall a. Eq a => a -> a -> Bool
/= Word64
0
]
[Text] -> [Text] -> [Text]
forall a. [a] -> [a] -> [a]
++ [ Word64 -> Text
forall a. Show a => a -> Text
showT Word64
n Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
" mini-protocol failures"
| let n :: Word64
n = Map (MiniProtocolNum, MiniProtocolDir) Word64 -> Word64
forall a. Num a => Map (MiniProtocolNum, MiniProtocolDir) a -> a
forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum (Failures -> Map (MiniProtocolNum, MiniProtocolDir) Word64
Mux.mfMiniProtocols Failures
failures)
, Word64
n Word64 -> Word64 -> Bool
forall a. Eq a => a -> a -> Bool
/= Word64
0
]
asMetrics :: CountersTrace -> [Metric]
asMetrics = \case
Mux.TraceRemoteCounters Counts
c -> Side -> Counts -> [Metric]
countsMetrics Side
Remote Counts
c
Mux.TraceLocalCounters Counts
c -> Side -> Counts -> [Metric]
countsMetrics Side
Local Counts
c
where
countsMetrics :: Side -> Mux.Counts -> [Metric]
countsMetrics :: Side -> Counts -> [Metric]
countsMetrics Side
side
Mux.Counts { mcFailures :: Counts -> Failures
Mux.mcFailures = Failures
failures, Map (MiniProtocolNum, MiniProtocolDir) Word64
mcSent :: Counts -> Map (MiniProtocolNum, MiniProtocolDir) Word64
mcSent :: Map (MiniProtocolNum, MiniProtocolDir) Word64
Mux.mcSent, Map (MiniProtocolNum, MiniProtocolDir) Word64
mcReceived :: Counts -> Map (MiniProtocolNum, MiniProtocolDir) Word64
mcReceived :: Map (MiniProtocolNum, MiniProtocolDir) Word64
Mux.mcReceived } =
[ Text -> Integer -> Metric
IntM (Side -> Text -> Text
onSide Side
side (FailureCount -> Text
fcName FailureCount
c)) (Word64 -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral (FailureCount -> Word64
fcCount FailureCount
c))
| FailureCount
c <- Failures -> [FailureCount]
failureCounts Failures
failures
]
[Metric] -> [Metric] -> [Metric]
forall a. [a] -> [a] -> [a]
++ Text -> Map (MiniProtocolNum, MiniProtocolDir) Word64 -> [Metric]
perProtocol (Side -> Text -> Text
onSide Side
side Text
"mux.miniProtocols.failures") (Failures -> Map (MiniProtocolNum, MiniProtocolDir) Word64
Mux.mfMiniProtocols Failures
failures)
[Metric] -> [Metric] -> [Metric]
forall a. [a] -> [a] -> [a]
++ Text -> Map (MiniProtocolNum, MiniProtocolDir) Word64 -> [Metric]
perProtocol (Side -> Text -> Text
onSide Side
side Text
"mux.egress.bytes") Map (MiniProtocolNum, MiniProtocolDir) Word64
mcSent
[Metric] -> [Metric] -> [Metric]
forall a. [a] -> [a] -> [a]
++ Text -> Map (MiniProtocolNum, MiniProtocolDir) Word64 -> [Metric]
perProtocol (Side -> Text -> Text
onSide Side
side Text
"mux.ingress.bytes") Map (MiniProtocolNum, MiniProtocolDir) Word64
mcReceived
perProtocol :: Text -> Map (Mux.MiniProtocolNum, MiniProtocolDir) Word64 -> [Metric]
perProtocol :: Text -> Map (MiniProtocolNum, MiniProtocolDir) Word64 -> [Metric]
perProtocol Text
name Map (MiniProtocolNum, MiniProtocolDir) Word64
counts =
Text -> Integer -> Metric
IntM Text
name (Word64 -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Map (MiniProtocolNum, MiniProtocolDir) Word64 -> Word64
forall a. Num a => Map (MiniProtocolNum, MiniProtocolDir) a -> a
forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum Map (MiniProtocolNum, MiniProtocolDir) Word64
counts))
Metric -> [Metric] -> [Metric]
forall a. a -> [a] -> [a]
: [ Text -> Integer -> Metric
IntM (Text
name Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"." Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Word16 -> Text
forall a. Show a => a -> Text
showT Word16
n Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"." Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> MiniProtocolDir -> Text
dirName MiniProtocolDir
d) (Word64 -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
b)
| ((Mux.MiniProtocolNum Word16
n, MiniProtocolDir
d), Word64
b) <- Map (MiniProtocolNum, MiniProtocolDir) Word64
-> [((MiniProtocolNum, MiniProtocolDir), Word64)]
forall k a. Map k a -> [(k, a)]
Map.toList Map (MiniProtocolNum, MiniProtocolDir) Word64
counts
]
instance MetaTrace Mux.CountersTrace where
namespaceFor :: CountersTrace -> Namespace CountersTrace
namespaceFor Mux.TraceRemoteCounters {} = [Text] -> [Text] -> Namespace CountersTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"Remote"]
namespaceFor Mux.TraceLocalCounters {} = [Text] -> [Text] -> Namespace CountersTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"Local"]
severityFor :: Namespace CountersTrace -> Maybe CountersTrace -> Maybe SeverityS
severityFor (Namespace [Text]
_ [Text
"Remote"]) Maybe CountersTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
severityFor (Namespace [Text]
_ [Text
"Local"]) Maybe CountersTrace
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
severityFor Namespace CountersTrace
_ Maybe CountersTrace
_ = Maybe SeverityS
forall a. Maybe a
Nothing
documentFor :: Namespace CountersTrace -> Maybe Text
documentFor (Namespace [Text]
_ [Text
"Remote"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just (Side -> Text
countersDoc Side
Remote)
documentFor (Namespace [Text]
_ [Text
"Local"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just (Side -> Text
countersDoc Side
Local)
documentFor Namespace CountersTrace
_ = Maybe Text
forall a. Maybe a
Nothing
metricsDocFor :: Namespace CountersTrace -> [(Text, Text)]
metricsDocFor (Namespace [Text]
_ [Text
"Remote"]) = Side -> [(Text, Text)]
metricsDoc Side
Remote
metricsDocFor (Namespace [Text]
_ [Text
"Local"]) = Side -> [(Text, Text)]
metricsDoc Side
Local
metricsDocFor Namespace CountersTrace
_ = []
allNamespaces :: [Namespace CountersTrace]
allNamespaces = [ [Text] -> [Text] -> Namespace CountersTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"Remote"], [Text] -> [Text] -> Namespace CountersTrace
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"Local"] ]
countersDoc :: Side -> Text
countersDoc :: Side -> Text
countersDoc Side
side =
Text
"Node-wide counters of the " Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Side -> Text
sideDoc Side
side Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
" muxes, every counters "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"interval: how they have failed, and the bytes they sent and read."
metricsDoc :: Side -> [(Text, Text)]
metricsDoc :: Side -> [(Text, Text)]
metricsDoc Side
side =
[ (Side -> Text -> Text
onSide Side
side (FailureCount -> Text
fcName FailureCount
c), FailureCount -> Text
fcDoc FailureCount
c)
| FailureCount
c <- Failures -> [FailureCount]
failureCounts Failures
Mux.noFailures
]
[(Text, Text)] -> [(Text, Text)] -> [(Text, Text)]
forall a. [a] -> [a] -> [a]
++ [ (Side -> Text -> Text
onSide Side
side Text
"mux.miniProtocols.failures",
Text
"Muxes dropped because a mini-protocol's thread died with an exception of its "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"own; the same per mini-protocol and direction under "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
".failures.<num>.<initiator|responder>.")
, (Side -> Text -> Text
onSide Side
side Text
"mux.egress.bytes",
Text
"Bytes written, SDU headers included, the handshake's not, run on the bearer "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"before the mux; the same per mini-protocol and "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"direction under .bytes.<num>.<initiator|responder>, the numbers "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"the application's.")
, (Side -> Text -> Text
onSide Side
side Text
"mux.ingress.bytes",
Text
"Bytes read, SDU headers included, the handshake's not, run on the bearer "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"before the mux; an SDU that overran its ingress limit is not counted; "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"the same per mini-protocol and direction under "
Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
".bytes.<num>.<initiator|responder>.")
]