Diagnostic

final class ntoseye.Diagnostic

One field that reads on its own and can fail. If the read succeeds, value holds the data, and if it fails, error holds the reason. The object is true when the value is available and false otherwise. The class is generic over its value: a property typed Diagnostic[int] reads an int.

property value: _T | None

The value that was read, or None if it is not available or the value read was None.

property error: str | None

The reason that the read failed, or None if it succeeded.

property available: bool

Whether the value was read.

property source: str | None

Where a metric’s value came from ("dump header", "KDBG", …), or None for a field that is not a metric or when the source is unknown.

to_dict() → dict[str, Any]

The {available, value, error[, source]} dict that the MCP surface returns, with source present only for a metric.