Public declaration syntax from forge-rs/crates/forge-health/src/degradation.rs Original source SHA-256: 936b5b1c0b14e7d0e90f397b66f00c4b308426f726de8a2e8291f4c4c7df6729 Function bodies and constant values are omitted. This is not the complete implementation. Source line 69 #[derive(Debug, Clone, Serialize, Deserialize)] pub struct DegradationThresholds { /// Maximum acceptable mean latency in microseconds. /// Exceeding this triggers a `LatencySpike` signal. pub latency_spike_threshold_us: u64, /// Maximum acceptable P99 latency in microseconds. /// Exceeding this triggers a `TailLatencyBlowup` signal. pub p99_threshold_us: u64, /// Minimum acceptable success rate as a fraction (0.0 to 1.0). /// Dropping below this triggers a `SuccessRateDrop` signal. pub min_success_rate: f64, /// Maximum acceptable number of recent failures in the window. /// Exceeding this triggers an `ErrorBurst` signal. pub max_recent_failures: u64 } Source line 115 #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] pub enum DegradationSignal { /// Mean latency exceeds the configured threshold. LatencySpike { /// Observed mean latency in microseconds. mean_latency_us: u64, /// Configured threshold in microseconds. threshold_us: u64, }, /// P99 latency exceeds the configured threshold. TailLatencyBlowup { /// Observed P99 latency in microseconds. p99_latency_us: u64, /// Configured threshold in microseconds. threshold_us: u64, }, /// Success rate has dropped below the minimum threshold. SuccessRateDrop { /// Observed success rate (0.0 to 1.0). success_rate: f64, /// Configured minimum success rate. min_threshold: f64, }, /// Too many failures in the recent window. ErrorBurst { /// Number of failures in the current window. failure_count: u64, /// Configured maximum allowed failures. max_allowed: u64, }, } Source line 169 pub fn description(&self) -> String; Source line 229 #[derive(Debug, Clone)] pub struct DegradationDetector { } Source line 243 pub fn new(thresholds: DegradationThresholds) -> Self; Source line 248 pub fn thresholds(&self) -> &DegradationThresholds; Source line 293 pub fn detect(&self, stats: &LatencyStats) -> Vec;