Table of Contents

Class RenderingMetrics

Namespace
SharpConsoleUI.Diagnostics
Assembly
SharpConsoleUI.dll

Captures per-frame performance and quality metrics for the rendering pipeline. Used to measure efficiency, detect performance issues, and validate optimizations.

public class RenderingMetrics
Inheritance
RenderingMetrics
Inherited Members

Properties

AnsiEscapeSequences

Gets or sets the total number of ANSI escape sequences in the output.

public int AnsiEscapeSequences { get; set; }

Property Value

int

AnsiGenerationTimeMs

Gets or sets the time spent generating ANSI sequences (milliseconds).

public double AnsiGenerationTimeMs { get; set; }

Property Value

double

AnsiOptimizationRatio

Gets or sets the ANSI optimization ratio (1.0 = fully optimized, 0.0 = no optimization).

public double AnsiOptimizationRatio { get; set; }

Property Value

double

BufferComparisonTimeMs

Gets or sets the time spent in buffer comparison (milliseconds).

public double BufferComparisonTimeMs { get; set; }

Property Value

double

BytesWritten

Gets or sets the total number of bytes written to console output. For static content, this should be zero after the first frame.

public int BytesWritten { get; set; }

Property Value

int

CellsActuallyRendered

Gets or sets the number of cells actually rendered to the console.

public int CellsActuallyRendered { get; set; }

Property Value

int

CellsDifferentFromPreviousFrame

Gets or sets the number of cells that differ from the previous frame.

public int CellsDifferentFromPreviousFrame { get; set; }

Property Value

int

CharactersChanged

Gets or sets the number of characters that changed in this frame.

public int CharactersChanged { get; set; }

Property Value

int

ColorChanges

Gets or sets the number of color changes in this frame.

public int ColorChanges { get; set; }

Property Value

int

ConsoleOutputTimeMs

Gets or sets the time spent writing to console (milliseconds).

public double ConsoleOutputTimeMs { get; set; }

Property Value

double

CursorMovements

Gets or sets the number of cursor movement commands.

public int CursorMovements { get; set; }

Property Value

int

DirtyCellsMarked

Gets or sets the number of cells marked as dirty in the CharacterBuffer.

public int DirtyCellsMarked { get; set; }

Property Value

int

DomLayoutTimeMs

Gets or sets the time spent in the DOM layout phase (milliseconds).

public double DomLayoutTimeMs { get; set; }

Property Value

double

EfficiencyRatio

Gets the efficiency ratio (actual rendered / dirty marked). A value close to 1.0 indicates efficient dirty tracking.

public double EfficiencyRatio { get; }

Property Value

double

FrameNumber

Gets or sets the frame number this metrics instance represents.

public int FrameNumber { get; set; }

Property Value

int

IsStaticFrame

Gets whether this frame had no changes from the previous frame. Static frames should produce zero console output.

public bool IsStaticFrame { get; }

Property Value

bool

RedundantAnsiSequences

Gets or sets the number of redundant ANSI sequences detected (e.g., setting the same color twice).

public int RedundantAnsiSequences { get; set; }

Property Value

int

Timestamp

Gets or sets the timestamp when this frame was rendered.

public DateTime Timestamp { get; set; }

Property Value

DateTime

TotalFrameTimeMs

Gets the total frame time across all phases.

public double TotalFrameTimeMs { get; }

Property Value

double

UnnecessaryResets

Gets or sets the number of unnecessary reset sequences.

public int UnnecessaryResets { get; set; }

Property Value

int

Methods

ToString()

Returns a summary string of the metrics.

public override string ToString()

Returns

string