Skip to content

models

models

Pydantic v2 models for the Marianne system profiler.

Defines configuration, per-process metrics, GPU metrics, system snapshots, process lifecycle events, anomalies, and resource estimates used by the profiler collector, storage layer, anomaly detector, and correlation analyzer.

Classes

AnomalySeverity

Bases: str, Enum

Severity level for detected anomalies.

AnomalyType

Bases: str, Enum

Types of resource anomalies the detector can identify.

Attributes
MEMORY_SPIKE class-attribute instance-attribute
MEMORY_SPIKE = 'memory_spike'

RSS increased >threshold in recent window.

RUNAWAY_PROCESS class-attribute instance-attribute
RUNAWAY_PROCESS = 'runaway_process'

Child process consuming >threshold CPU for extended duration.

ZOMBIE class-attribute instance-attribute
ZOMBIE = 'zombie'

One or more zombie child processes found.

FD_EXHAUSTION class-attribute instance-attribute
FD_EXHAUSTION = 'fd_exhaustion'

Process approaching file descriptor limits.

EventType

Bases: str, Enum

Process lifecycle event types.

ProcessMetric

Bases: BaseModel

Resource metrics for a single process in a snapshot.

GpuMetric

Bases: BaseModel

Per-GPU resource snapshot at a point in time.

JobProgress

Bases: BaseModel

Progress snapshot for a single running job.

Populated from CheckpointState in _live_states during collect_snapshot(). Consumed by the TUI jobs panel for accurate progress bars.

SystemSnapshot

Bases: BaseModel

Point-in-time system resource snapshot.

Collected periodically by ProfilerCollector, stored in SQLite + JSONL, and consumed by AnomalyDetector and CorrelationAnalyzer.

ProcessEvent

Bases: BaseModel

Lifecycle event for a child process (spawn, exit, signal, kill, oom).

Anomaly

Bases: BaseModel

A detected resource anomaly.

Produced by AnomalyDetector when heuristic thresholds are exceeded. Published to EventBus as monitor.anomaly events and stored as RESOURCE_ANOMALY patterns in the learning system.

ResourceEstimate

Bases: BaseModel

Scheduling hint based on learned resource correlations.

Returned by BackpressureController.estimate_job_resource_needs() to inform job admission and scheduling decisions.

RetentionConfig

Bases: BaseModel

Data retention policy for profiler storage.

AnomalyConfig

Bases: BaseModel

Thresholds for anomaly detection.

CorrelationConfig

Bases: BaseModel

Configuration for the periodic correlation analyzer.

ProfilerConfig

Bases: BaseModel

Top-level profiler configuration for DaemonConfig.profiler.

Controls data collection, storage, anomaly detection thresholds, and correlation analysis frequency.