obzenflow_runtime 0.2.5

Runtime services for ObzenFlow - execution and coordination business logic
Documentation
// SPDX-License-Identifier: MIT OR Apache-2.0
// SPDX-FileCopyrightText: 2025-2026 ObzenFlow Contributors
// https://obzenflow.dev

//! Metrics aggregator implementation

mod buffer;
pub mod builder;
pub mod constants;
pub mod fsm;
pub mod handle;
pub mod inputs;
pub mod instrumentation;
pub mod observations;
pub mod supervisor;
pub mod tail_read;
mod throughput;

// Re-export commonly used types
// Note: MetricsAggregatorSupervisor is intentionally NOT exported - use MetricsAggregatorBuilder
pub use builder::MetricsAggregatorBuilder;
#[doc(hidden)]
pub use fsm::MetricsStore;
pub use fsm::{
    MetricsAggregatorAction, MetricsAggregatorContext, MetricsAggregatorEvent,
    MetricsAggregatorState, StageMetrics,
};
pub use handle::{MetricsHandle, MetricsHandleExt};
pub use inputs::MetricsInputs;

#[cfg(test)]
#[derive(Default)]
pub(crate) struct RecordingSnapshots {
    app: std::sync::Mutex<Option<obzenflow_core::metrics::AppMetricsSnapshot>>,
    infra: std::sync::Mutex<Option<obzenflow_core::metrics::InfraMetricsSnapshot>>,
}
#[cfg(test)]
impl obzenflow_core::metrics::MetricsSnapshotExporter for RecordingSnapshots {
    fn publish_app_snapshot(&self, snapshot: obzenflow_core::metrics::AppMetricsSnapshot) {
        *self.app.lock().unwrap() = Some(snapshot);
    }
    fn publish_infra_snapshot(&self, snapshot: obzenflow_core::metrics::InfraMetricsSnapshot) {
        *self.infra.lock().unwrap() = Some(snapshot);
    }
}

#[cfg(feature = "test-support")]
pub(crate) mod tests;