anomaly
anomaly
¶
Heuristic anomaly detection for the Marianne system profiler.
Compares the current SystemSnapshot against recent history to detect
resource anomalies: memory spikes, runaway processes, zombies, and FD
exhaustion. No LLM calls — pure threshold-based detection.
Detected anomalies are published to the EventBus as monitor.anomaly
events and stored as RESOURCE_ANOMALY patterns in the learning system.
Attributes¶
FD_EXHAUSTION_THRESHOLD
module-attribute
¶
Open FD count that triggers an FD exhaustion anomaly.
MEMORY_PRESSURE_FRACTION
module-attribute
¶
Available/total memory ratio below which memory pressure is flagged.
Classes¶
AnomalyDetector
¶
Detects resource anomalies by comparing snapshots against thresholds.
Runs on each new snapshot collected by ProfilerCollector. Stateless
except for the configuration — all history is passed in via the
detect method.
Source code in src/marianne/daemon/profiler/anomaly.py
Functions¶
detect
¶
Run all anomaly checks against current snapshot and history.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
current
|
SystemSnapshot
|
The most recent system snapshot. |
required |
history
|
list[SystemSnapshot]
|
Recent snapshots (oldest-first) for trend analysis. Should cover at least the configured spike window. |
required |
Returns:
| Type | Description |
|---|---|
list[Anomaly]
|
List of detected |