Table of Contents

Class ThreadInfoEventCodec

Namespace
Typhon.Profiler
Assembly
Typhon.Profiler.dll

Wire codec for ThreadInfo. Layout after the 12-byte common header:

offset 12..15  i32  ManagedThreadId
offset 16..17  u16  NameByteCount
offset 18+     byte[NameByteCount] NameUtf8
offset 18+N    u8   ThreadKind

Total wire size: 12 + 4 + 2 + NameByteCount + 1 bytes.

public static class ThreadInfoEventCodec
Inheritance
ThreadInfoEventCodec
Inherited Members

Methods

ComputeSize(int)

Total wire size in bytes of a ThreadInfo record whose name is nameByteCount UTF-8 bytes.

public static int ComputeSize(int nameByteCount)

Parameters

nameByteCount int

Returns

int

Decode(ReadOnlyMemory<byte>)

Decode a ThreadInfo record from source.

public static ThreadInfoEventData Decode(ReadOnlyMemory<byte> source)

Parameters

source ReadOnlyMemory<byte>

Returns

ThreadInfoEventData

WriteThreadInfo(Span<byte>, byte, long, int, ReadOnlySpan<byte>, ThreadKind, out int)

Encode a ThreadInfo record. Caller has pre-computed nameUtf8 (via UTF8).

public static void WriteThreadInfo(Span<byte> destination, byte threadSlot, long timestamp, int managedThreadId, ReadOnlySpan<byte> nameUtf8, ThreadKind kind, out int bytesWritten)

Parameters

destination Span<byte>
threadSlot byte
timestamp long
managedThreadId int
nameUtf8 ReadOnlySpan<byte>
kind ThreadKind
bytesWritten int