use crate::event::observability::CaptureStamp;
use crate::time::MetricsDuration;
use crate::StageId;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ThroughputMeasurement {
pub capture: CaptureStamp,
pub event_delta: u64,
pub elapsed: MetricsDuration,
pub events_per_second: f64,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ThroughputSnapshot {
pub stages: HashMap<StageId, ThroughputMeasurement>,
pub flow_input: Option<ThroughputMeasurement>,
pub flow_output: Option<ThroughputMeasurement>,
}
pub trait ThroughputSource: Send + Sync {
fn throughput(&self) -> ThroughputSnapshot;
}