pub struct StationLoadSampler { /* private fields */ }Expand description
Runtime helper that derives StationLoadSample from existing low-level state.
Implementations§
Source§impl StationLoadSampler
impl StationLoadSampler
Sourcepub const fn new(config: StationLoadSamplerConfig) -> Self
pub const fn new(config: StationLoadSamplerConfig) -> Self
Creates a station load sampler.
Sourcepub const fn config(&self) -> StationLoadSamplerConfig
pub const fn config(&self) -> StationLoadSamplerConfig
Returns the sampler configuration.
Sourcepub fn sample_station(
&self,
station: &Station,
index: Option<&CellIndex>,
queued_events: usize,
subscribers: usize,
) -> StationLoadSample
pub fn sample_station( &self, station: &Station, index: Option<&CellIndex>, queued_events: usize, subscribers: usize, ) -> StationLoadSample
Samples one station from its storage, optional index, queued event count, and caller-provided subscriber estimate.
Sourcepub fn sample_all(
&self,
stations: &StationSet,
indexes: &StationIndexSet,
router: &EventRouter,
subscriber_counts: &[(StationId, usize)],
) -> Vec<StationLoadSample>
pub fn sample_all( &self, stations: &StationSet, indexes: &StationIndexSet, router: &EventRouter, subscriber_counts: &[(StationId, usize)], ) -> Vec<StationLoadSample>
Samples every station in deterministic station-set order.
subscriber_counts is explicit integration input: SectorSync can use it
for load decisions, but does not own gateway/client/session business state.
Counts with the same station id are aggregated with saturating arithmetic.
Because the event router and subscriber input are station-scoped, their
pressure stays on the station sample instead of being invented per cell.
Sourcepub fn sample_all_into<'a>(
&self,
stations: &StationSet,
indexes: &StationIndexSet,
router: &EventRouter,
subscriber_counts: &[(StationId, usize)],
scratch: &'a mut StationLoadSamplerScratch,
) -> &'a [StationLoadSample]
pub fn sample_all_into<'a>( &self, stations: &StationSet, indexes: &StationIndexSet, router: &EventRouter, subscriber_counts: &[(StationId, usize)], scratch: &'a mut StationLoadSamplerScratch, ) -> &'a [StationLoadSample]
Samples every station into caller-owned storage and returns its active prefix.
Station order and aggregation semantics match Self::sample_all. Reusing
the same scratch retains subscriber, occupancy, station, and per-cell storage.
Trait Implementations§
Source§impl Clone for StationLoadSampler
impl Clone for StationLoadSampler
Source§fn clone(&self) -> StationLoadSampler
fn clone(&self) -> StationLoadSampler
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more