stormlog.oom_flight_recorder
OOM flight recorder helpers for bounded event capture and dump artifacts.
Functions
Classify whether an exception corresponds to an OOM condition. |
Classes
|
Normalized classification result for an exception. |
|
Bounded recorder that writes dump bundles on OOM. |
|
Runtime configuration for OOM flight recorder dumps. |
- class stormlog.oom_flight_recorder.OOMFlightRecorder(config)[source]
Bases:
objectBounded recorder that writes dump bundles on OOM.
- Parameters:
config (OOMFlightRecorderConfig)
- record_event(event)[source]
Append one event payload to the in-memory ring buffer.
- Parameters:
event (dict[str, Any])
- Return type:
None
- snapshot_events()[source]
Return buffered events in chronological order.
- Return type:
list[dict[str, Any]]
- dump(*, reason, exception, context, backend, metadata=None, session_summary=None)[source]
Write an OOM diagnostic bundle and enforce retention constraints.
- Parameters:
reason (str)
exception (BaseException)
context (str | None)
backend (str)
metadata (dict[str, Any] | None)
session_summary (SessionSummary | None)
- Return type:
str | None
- class stormlog.oom_flight_recorder.OOMFlightRecorderConfig(enabled=False, dump_dir='oom_dumps', buffer_size=10000, max_dumps=5, max_total_mb=256)[source]
Bases:
objectRuntime configuration for OOM flight recorder dumps.
- Parameters:
enabled (bool)
dump_dir (str)
buffer_size (int)
max_dumps (int)
max_total_mb (int)
- enabled: bool = False
- dump_dir: str = 'oom_dumps'
- buffer_size: int = 10000
- max_dumps: int = 5
- max_total_mb: int = 256
- class stormlog.oom_flight_recorder.OOMExceptionClassification(is_oom, reason)[source]
Bases:
objectNormalized classification result for an exception.
- Parameters:
is_oom (bool)
reason (str | None)
- is_oom: bool
- reason: str | None