stormlog.infer.diagnosis_signals
Cheap signals that decide whether a window of scrapes looks like an incident.
evaluate_signal is a pure function over one window of /metrics scrapes
the caller chose. It returns the kind’s value, whether the window had enough
data to decide, and the verdict against the shared threshold table. It never
diagnoses: a value over its threshold says a mechanism is suspected in an
engine’s aggregate metrics, which cover every client’s traffic. Confirming
it, and saying whose requests it hurt, is the diagnoser’s job.
Only kinds that /metrics alone can decide are evaluated; every other kind
answers requires_hook, requires_trace or requires_client.
Functions
|
Evaluate |
Classes
|
How to evaluate one window. |
|
One kind's value over a window, and the verdict against its threshold. |
- class stormlog.infer.diagnosis_signals.SignalConfig(engine=None, min_scrapes=2, thresholds=<factory>, reference=None)[source]
Bases:
objectHow to evaluate one window.
thresholdsoverrides entries of the shared table by key; a result says when it did. A key the table lacks, or a value that is not a finite number (a NaN, a string, a bool), is refused: a NaN would never be exceeded and a misspelt key never read, both silently.min_scrapesmust be at least 2.referenceis the prefix-cache hit ratio a window is compared with, which only the caller can know.- Parameters:
engine (str | None)
min_scrapes (int)
thresholds (Mapping[str, float])
reference (float | None)
- engine: str | None = None
- min_scrapes: int = 2
- thresholds: Mapping[str, float]
- reference: float | None = None
- class stormlog.infer.diagnosis_signals.SignalValue(value, sufficient, reason, exceeds, threshold, thresholds_version, threshold_overridden, detail)[source]
Bases:
objectOne kind’s value over a window, and the verdict against its threshold.
exceedsis None wheneversufficientis False;reasonis then the first of the reasons listed indetail["reasons"].- Parameters:
value (float | None)
sufficient (bool)
reason (str | None)
exceeds (bool | None)
threshold (float | None)
thresholds_version (str)
threshold_overridden (bool)
detail (Mapping[str, Any])
- value: float | None
- sufficient: bool
- reason: str | None
- exceeds: bool | None
- threshold: float | None
- thresholds_version: str
- threshold_overridden: bool
- detail: Mapping[str, Any]
- stormlog.infer.diagnosis_signals.evaluate_signal(kind, scrapes, config=None)[source]
Evaluate
kindover a window of consecutive scrapes, in time order.- Raises:
ValueError – for a kind outside the closed vocabulary.
- Parameters:
kind (str)
scrapes (Sequence[VllmScrapeRecord])
config (SignalConfig | None)
- Return type: