Class RenderingDiagnostics
- Namespace
- SharpConsoleUI.Diagnostics
- Assembly
- SharpConsoleUI.dll
Main coordinator for capturing rendering artifacts and metrics across all three layers. Provides snapshot capture, metrics collection, and quality analysis for testing and debugging.
public class RenderingDiagnostics
- Inheritance
-
RenderingDiagnostics
- Inherited Members
Constructors
RenderingDiagnostics(ConsoleWindowSystemOptions)
Creates a new RenderingDiagnostics instance.
public RenderingDiagnostics(ConsoleWindowSystemOptions options)
Parameters
optionsConsoleWindowSystemOptions
Properties
CurrentFrameNumber
Gets the current frame number.
public int CurrentFrameNumber { get; }
Property Value
EnabledLayers
Gets the enabled diagnostics layers.
public DiagnosticsLayers EnabledLayers { get; }
Property Value
IsEnabled
Gets whether diagnostics are enabled.
public bool IsEnabled { get; set; }
Property Value
LastAnsiSnapshot
Gets the most recent ANSI lines snapshot.
public AnsiLinesSnapshot? LastAnsiSnapshot { get; }
Property Value
LastBufferSnapshot
Gets the most recent CharacterBuffer snapshot.
public CharacterBufferSnapshot? LastBufferSnapshot { get; }
Property Value
LastConsoleSnapshot
Gets the most recent ConsoleBuffer snapshot.
public ConsoleBufferSnapshot? LastConsoleSnapshot { get; }
Property Value
LastMetrics
Gets the most recent metrics.
public RenderingMetrics? LastMetrics { get; }
Property Value
LastOutputSnapshot
Gets the most recent output snapshot.
public RenderOutputSnapshot? LastOutputSnapshot { get; }
Property Value
LastQualityReport
Gets the most recent quality report.
public QualityReport? LastQualityReport { get; }
Property Value
Methods
BeginFrame()
Begins a new frame, incrementing the frame counter.
public void BeginFrame()
CaptureAnsiLines(List<string>)
Captures ANSI lines snapshot (MIDDLE LAYER).
public void CaptureAnsiLines(List<string> lines)
Parameters
CaptureCharacterBuffer(CharacterBuffer)
Captures a CharacterBuffer snapshot (TOP LAYER).
public void CaptureCharacterBuffer(CharacterBuffer buffer)
Parameters
bufferCharacterBuffer
CaptureConsoleBufferState(ConsoleCell[,], ConsoleCell[,], int, int)
Captures ConsoleBuffer internal state (BOTTOM LAYER).
public void CaptureConsoleBufferState(ConsoleCell[,] front, ConsoleCell[,] back, int width, int height)
Parameters
frontConsoleCell[,]backConsoleCell[,]widthintheightint
CaptureConsoleOutput(string)
Captures console output string.
public void CaptureConsoleOutput(string output)
Parameters
outputstring
Clear()
Clears all captured diagnostics data.
public void Clear()
GetAllMetrics()
Gets all recorded metrics.
public IReadOnlyList<RenderingMetrics> GetAllMetrics()
Returns
GetMetrics(int)
Gets metrics for a specific frame.
public RenderingMetrics? GetMetrics(int frameNumber)
Parameters
frameNumberint
Returns
GetQualityReport(int)
Gets quality report for a specific frame.
public QualityReport? GetQualityReport(int frameNumber)
Parameters
frameNumberint
Returns
GetSnapshot<T>(int)
Gets a snapshot of a specific type for a given frame.
public T? GetSnapshot<T>(int frameNumber) where T : class
Parameters
frameNumberint
Returns
- T
Type Parameters
T
RecordMetrics(RenderingMetrics)
Records rendering metrics for a frame.
public void RecordMetrics(RenderingMetrics metrics)
Parameters
metricsRenderingMetrics