Table of Contents

Class CorrelationInstantCodec

Namespace
Typhon.Profiler
Assembly
Typhon.Profiler.dll

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

ulong

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

session uint
drainTick uint
seq ushort

Returns

(ulong Hi, ulong Lo)

Covers(TraceEventKind)

True for kinds 236-240.

public static bool Covers(TraceEventKind kind)

Parameters

kind TraceEventKind

Returns

bool

Decode(ReadOnlySpan<byte>)

Decodes any of the five kinds.

public static CorrelationInstantData Decode(ReadOnlySpan<byte> s)

Parameters

s ReadOnlySpan<byte>

Returns

CorrelationInstantData

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

hi ulong

Returns

bool

SizeOf(TraceEventKind)

Wire size of kind, or 0 for a kind this codec does not cover.

public static int SizeOf(TraceEventKind kind)

Parameters

kind TraceEventKind

Returns

int

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

d Span<byte>
slot byte
ts long
session uint
seq ushort
wireIdx ushort
drainTick uint

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

d Span<byte>
slot byte
ts long
session uint
seq ushort
sysIdx ushort

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

d Span<byte>
slot byte
ts long
session uint
seq ushort
reason IngressDropReason

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

d Span<byte>
slot byte
ts long
session uint
seq ushort
wireIdx ushort
bytes ushort

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)

Parameters

d Span<byte>
slot byte
ts long
session uint
tick uint
bytes uint
acks ushort