perf-sentinel-core 0.4.3

Core library for perf-sentinel: polyglot performance anti-pattern detector
Documentation
//! Shared cloud energy state and snapshot access.
//!
//! Thin wrapper around [`AgedEnergyMap`] generated by the
//! [`impl_energy_state!`] macro. Kept as a distinct nominal type so the
//! daemon's `build_tick_ctx` cannot accidentally confuse cloud-SPECpower
//! readings with Scaphandre-RAPL readings when it merges the snapshots.

// Reuse the monotonic clock from the Scaphandre module so both
// scrapers and the scoring path share a single time source.
pub use crate::score::scaphandre::state::monotonic_ms;

/// Row type expected by the cloud energy scraper when constructing
/// fresh entries. Aliased to the shared [`EnergyRow`] so both the
/// cloud and Scaphandre states share one row definition.
///
/// [`EnergyRow`]: crate::score::energy_state::EnergyRow
pub(super) use crate::score::energy_state::EnergyRow as ServiceEnergy;

crate::score::energy_state::impl_energy_state! {
    /// Runtime state shared between the cloud energy scraper and the
    /// scoring path. Read-heavy / write-rare, zero-contention via
    /// [`AgedEnergyMap`].
    #[derive(Debug, Default)]
    pub struct CloudEnergyState;
}