Table of Contents

Class StreamDiagnostics

Namespace
Mythosia.AI.Models.Streaming
Assembly
Mythosia.AI.Abstractions.dll

Captures observability data about a single SSE streaming round. Populated by the SSE reader and surfaced via StreamOptions.DiagnosticsCallback or attached to StreamReadException when a read fails. Lets callers tell "stream silently ended" apart from "transport error after N chunks".

public class StreamDiagnostics
Inheritance
StreamDiagnostics
Inherited Members

Properties

AccumulatedTextLength

Total characters appended to the assistant text buffer during this round.

public long AccumulatedTextLength { get; set; }

Property Value

long

DataLinesProcessed

Number of lines the provider's chunk parser accepted as content.

public int DataLinesProcessed { get; set; }

Property Value

int

Elapsed

Wall-clock time spent reading the stream.

public TimeSpan Elapsed { get; set; }

Property Value

TimeSpan

LastRawLine

The most recent raw SSE line received. Useful when the stream dies mid-line — reveals whether the last line was truncated or non-standard.

public string? LastRawLine { get; set; }

Property Value

string

LinesRead

Total raw lines read from the SSE stream (including comments, blank lines, and "data:" lines). Reaches the line that triggered a failure, if any.

public int LinesRead { get; set; }

Property Value

int

ParseFailures

Number of lines that hit a parse failure (typically swallowed by the provider's per-chunk catch block).

public int ParseFailures { get; set; }

Property Value

int

Methods

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.