Skip to main content

Module resize_sla

Module resize_sla 

Source
Expand description

Resize SLA monitoring with conformal alerting (bd-1rz0.21).

This module provides SLA monitoring for resize operations by integrating the ConformalAlert system with resize telemetry hooks.

§Mathematical Model

The SLA monitor tracks resize latency (time from resize event to final frame apply) and uses conformal prediction to detect violations:

SLA violation := latency > conformal_threshold(calibration_data, alpha)

The conformal threshold is computed using the (n+1) rule from crate::conformal_alert, providing distribution-free coverage guarantees.

§Key Invariants

  1. Latency bound: Alert if latency exceeds calibrated threshold
  2. FPR control: False positive rate <= alpha (configurable)
  3. Anytime-valid: E-process layer prevents FPR inflation from early stopping
  4. Full provenance: Every alert includes evidence ledger

§Usage

use ftui_runtime::resize_sla::{ResizeSlaMonitor, SlaConfig};
use ftui_runtime::resize_coalescer::{ResizeCoalescer, TelemetryHooks};

let sla_monitor = ResizeSlaMonitor::new(SlaConfig::default());
let hooks = sla_monitor.make_hooks();

let coalescer = ResizeCoalescer::new(config, (80, 24))
    .with_telemetry_hooks(hooks);

// SLA violations are logged and can be queried
if let Some(alert) = sla_monitor.last_alert() {
    println!("SLA violation: {}", alert.evidence_summary());
}

Structs§

ResizeEvidence
Evidence for a single resize operation.
ResizeSlaMonitor
Resize SLA monitor with conformal alerting.
SlaConfig
Configuration for resize SLA monitoring.
SlaLogEntry
SLA event log entry for JSONL output.
SlaSummary
Summary statistics for SLA monitoring.

Functions§

make_sla_hooks
Create TelemetryHooks that feed into an SLA monitor.