Class CorrelationInstantCodec
Wire codec for the five correlation lifecycle instants, kinds 236-240. Each is the 12-byte common header followed by a fixed payload:
IngressReceived session u32, seq u16, wireIdx u16, bytes u16 (10 B)
IngressAdmitted session u32, seq u16, wireIdx u16, drainTick u32 (12 B)
IngressDropped session u32, seq u16, reason u8 (7 B)
CommandConsumed session u32, seq u16, sysIdx u16 (8 B)
EgressSent session u32, tick u32, bytes u32, acks u16 (14 B)
public static class CorrelationInstantCodec
- Inheritance
-
CorrelationInstantCodec
- Inherited Members
Fields
CommandMarker
The marker in the high half of a command's causal id.
public const ulong CommandMarker = 6077962839392256000
Field Value
Methods
CommandCausalId(uint, uint, ushort)
The causal id of a client command: hi = "TYC" marker | session, lo = drainTick << 16 | seq. Unique per session and tick although
seq is 16 bits and wraps; never zero, so it never reads as "no causal id".
public static (ulong Hi, ulong Lo) CommandCausalId(uint session, uint drainTick, ushort seq)
Parameters
Returns
Covers(TraceEventKind)
True for kinds 236-240.
public static bool Covers(TraceEventKind kind)
Parameters
kindTraceEventKind
Returns
Decode(ReadOnlySpan<byte>)
Decodes any of the five kinds.
public static CorrelationInstantData Decode(ReadOnlySpan<byte> s)
Parameters
sReadOnlySpan<byte>
Returns
IsCommandCausalId(ulong)
True when hi is the high half of a command's causal id rather than a W3C trace id.
public static bool IsCommandCausalId(ulong hi)
Parameters
hiulong
Returns
SizeOf(TraceEventKind)
Wire size of kind, or 0 for a kind this codec does not cover.
public static int SizeOf(TraceEventKind kind)
Parameters
kindTraceEventKind
Returns
WriteAdmitted(Span<byte>, byte, long, uint, ushort, ushort, uint)
Encodes IngressAdmitted.
public static void WriteAdmitted(Span<byte> d, byte slot, long ts, uint session, ushort seq, ushort wireIdx, uint drainTick)
Parameters
WriteConsumed(Span<byte>, byte, long, uint, ushort, ushort)
Encodes CommandConsumed.
public static void WriteConsumed(Span<byte> d, byte slot, long ts, uint session, ushort seq, ushort sysIdx)
Parameters
WriteDropped(Span<byte>, byte, long, uint, ushort, IngressDropReason)
Encodes IngressDropped.
public static void WriteDropped(Span<byte> d, byte slot, long ts, uint session, ushort seq, IngressDropReason reason)
Parameters
WriteReceived(Span<byte>, byte, long, uint, ushort, ushort, ushort)
Encodes IngressReceived.
public static void WriteReceived(Span<byte> d, byte slot, long ts, uint session, ushort seq, ushort wireIdx, ushort bytes)
Parameters
WriteSent(Span<byte>, byte, long, uint, uint, uint, ushort)
Encodes EgressSent.
public static void WriteSent(Span<byte> d, byte slot, long ts, uint session, uint tick, uint bytes, ushort acks)