Skip to content

Hex1bMetrics

Namespace: Hex1b.Diagnostics

Assembly: Hex1b.dll

Provides OpenTelemetry-compatible metrics instrumentation for Hex1b.

csharp
public sealed class Hex1bMetrics : IDisposable

Inheritance

ObjectHex1bMetrics

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; }

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; }

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; }

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; }

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.