Skip to content

Hex1bMetrics ​

Namespace: Hex1b.Diagnostics

Assembly: Hex1b.dll

Provides OpenTelemetry-compatible metrics instrumentation for Hex1b.

csharp
public sealed class Hex1bMetrics : IDisposable

Inheritance ​

Object → Hex1bMetrics

Implements ​

Constructors ​

Hex1bMetrics(Hex1bMetricsOptions?) ​

Creates a new instance with its own .

Parameters:

csharp
public Hex1bMetrics(Hex1bMetricsOptions? options = null)

Properties ​

Default ​

Shared singleton for production use. Always-on, zero config.

Returns: Hex1bMetrics

csharp
public static Hex1bMetrics Default { get; }

FrameBuildDuration ​

Widget tree build phase duration.

Returns: Histogram<Double>

csharp
public Histogram<double> FrameBuildDuration { get; }

FrameCount ​

Total frames rendered.

Returns: Counter<Int64>

csharp
public Counter<long> FrameCount { get; }

FrameDuration ​

Total frame duration (build + reconcile + render).

Returns: Histogram<Double>

csharp
public Histogram<double> FrameDuration { get; }

FrameReconcileDuration ​

Widget→Node reconciliation duration.

Returns: Histogram<Double>

csharp
public Histogram<double> FrameReconcileDuration { get; }

FrameRenderDuration ​

Surface render + diff + serialize duration.

Returns: Histogram<Double>

csharp
public Histogram<double> FrameRenderDuration { get; }

Hmp1SixelReplayDuration ​

Internal HMP1 Sixel reconnect-replay duration.

Returns: Histogram<Double>

csharp
public Histogram<double> Hmp1SixelReplayDuration { get; }

Hmp1SixelReplayOutcomes ​

Internal HMP1 Sixel reconnect-replay outcomes.

Returns: Counter<Int64>

csharp
public Counter<long> Hmp1SixelReplayOutcomes { get; }

InputCount ​

Input events processed (tagged by type: key, mouse, resize).

Returns: Counter<Int64>

csharp
public Counter<long> InputCount { get; }

InputDuration ​

Time to process a single input event.

Returns: Histogram<Double>

csharp
public Histogram<double> InputDuration { get; }

Meter ​

The underlying meter. Use this reference in to filter by instance for test isolation.

Returns: Meter

csharp
public Meter Meter { get; }

NodeArrangeDuration ​

Per-node arrange phase duration (tagged by node path).

Returns: Histogram<Double>

csharp
public Histogram<double>? NodeArrangeDuration { get; }

NodeMeasureDuration ​

Per-node measure phase duration (tagged by node path).

Returns: Histogram<Double>

csharp
public Histogram<double>? NodeMeasureDuration { get; }

NodeReconcileDuration ​

Per-node reconcile phase duration (tagged by node path).

Returns: Histogram<Double>

csharp
public Histogram<double>? NodeReconcileDuration { get; }

NodeRenderDuration ​

Per-node render phase duration (tagged by node path).

Returns: Histogram<Double>

csharp
public Histogram<double>? NodeRenderDuration { get; }

OutputBytes ​

Bytes written to workload output channel per frame.

Returns: Histogram<Int32>

csharp
public Histogram<int> OutputBytes { get; }

OutputCellsChanged ​

Cells changed per surface diff.

Returns: Histogram<Int32>

csharp
public Histogram<int> OutputCellsChanged { get; }

OutputTokens ​

ANSI tokens produced by diff serialization.

Returns: Histogram<Int32>

csharp
public Histogram<int> OutputTokens { get; }

SurfaceCompositeDuration ​

Time to composite a flattened surface onto the parent (tagged by node path).

Returns: Histogram<Double>

csharp
public Histogram<double>? SurfaceCompositeDuration { get; }

SurfaceDiffDuration ​

Time to diff previous vs current surface.

Returns: Histogram<Double>

csharp
public Histogram<double> SurfaceDiffDuration { get; }

SurfaceDiffFastPathCount ​

Number of surface diffs that took the simple 4-field fast path. Compare against to see how often complex content forces the slow path.

Returns: Counter<Int64>

csharp
public Counter<long> SurfaceDiffFastPathCount { get; }

SurfaceDiffSlowPathCount ​

Number of surface diffs that took the full per-cell slow path because at least one cell on either side had wide width, underline, a multi-codepoint grapheme, or a tracked ref.

Returns: Counter<Int64>

csharp
public Counter<long> SurfaceDiffSlowPathCount { get; }

SurfaceFlattenDuration ​

Time to flatten a CompositeSurface (tagged by node path).

Returns: Histogram<Double>

csharp
public Histogram<double>? SurfaceFlattenDuration { get; }

SurfaceLayerCount ​

Number of layers in a SurfaceNode (tagged by node path).

Returns: Histogram<Int32>

csharp
public Histogram<int>? SurfaceLayerCount { get; }

SurfaceLayerDuration ​

Time per layer in a SurfaceNode (tagged by node, layer_index, layer_type).

Returns: Histogram<Double>

csharp
public Histogram<double>? SurfaceLayerDuration { get; }

SurfaceSerializeDuration ​

Time to serialize ANSI tokens to string.

Returns: Histogram<Double>

csharp
public Histogram<double> SurfaceSerializeDuration { get; }

SurfaceTokensDuration ​

Time to convert surface diff to ANSI tokens.

Returns: Histogram<Double>

csharp
public Histogram<double> SurfaceTokensDuration { get; }

TerminalDcsBytes ​

Bytes observed inside each DCS sequence, excluding its introducer and terminator.

Returns: Histogram<Int64>

csharp
public Histogram<long> TerminalDcsBytes { get; }

TerminalDcsCancellations ​

DCS sequences cancelled by CAN or SUB.

Returns: Counter<Int64>

csharp
public Counter<long> TerminalDcsCancellations { get; }

TerminalDcsDispatches ​

Completed DCS framing outcomes (tagged by kind).

Returns: Counter<Int64>

csharp
public Counter<long> TerminalDcsDispatches { get; }

TerminalDcsMalformedRecoveries ​

Malformed DCS introducers recovered at a control-string boundary.

Returns: Counter<Int64>

csharp
public Counter<long> TerminalDcsMalformedRecoveries { get; }

TerminalDcsRetentionLimitEvents ​

DCS sequences whose retained-content limit was exceeded.

Returns: Counter<Int64>

csharp
public Counter<long> TerminalDcsRetentionLimitEvents { get; }

TerminalInputBytes ​

Raw bytes read from presentation adapter per read.

Returns: Histogram<Int32>

csharp
public Histogram<int> TerminalInputBytes { get; }

TerminalInputEvents ​

Structured events dispatched to workload (tagged by type: key, mouse, resize).

Returns: Counter<Int64>

csharp
public Counter<long> TerminalInputEvents { get; }

TerminalInputTokens ​

ANSI tokens parsed from raw input per read.

Returns: Histogram<Int32>

csharp
public Histogram<int> TerminalInputTokens { get; }

TerminalOutputBytes ​

Bytes written to presentation adapter per write.

Returns: Histogram<Int32>

csharp
public Histogram<int> TerminalOutputBytes { get; }

TerminalOutputTokens ​

ANSI tokens parsed from workload output per pump cycle.

Returns: Histogram<Int32>

csharp
public Histogram<int> TerminalOutputTokens { get; }

TerminalRawPassthroughDuration ​

Time spent forwarding one raw workload chunk to a native presentation.

Returns: Histogram<Double>

csharp
public Histogram<double> TerminalRawPassthroughDuration { get; }

TerminalSixelLimitEvents ​

Sixel resource-limit events (tagged by limit).

Returns: Counter<Int64>

csharp
public Counter<long> TerminalSixelLimitEvents { get; }

TerminalSixelOutcomes ​

Sixel parser/model outcomes (tagged by outcome).

Returns: Counter<Int64>

csharp
public Counter<long> TerminalSixelOutcomes { get; }

TerminalSixelProcessingDuration ​

Time spent applying one accepted Sixel sequence to the authoritative model.

Returns: Histogram<Double>

csharp
public Histogram<double> TerminalSixelProcessingDuration { get; }

TerminalSixelResources ​

Sixel resource lifecycle operations (tagged by action and optional reason).

Returns: Counter<Int64>

csharp
public Counter<long> TerminalSixelResources { get; }

Methods ​

Dispose() ​

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

csharp
public void Dispose()

Remarks ​

All instruments live under the Hex1b meter and use the hex1b.* namespace. Metrics are zero-cost when no or OTLP exporter is attached.

Use for production. Create a new instance per test for isolation — can filter by reference to avoid crosstalk.

Released under the MIT License.