pub struct LogicalMeterConfig { /* private fields */ }Implementations§
Source§impl LogicalMeterConfig
impl LogicalMeterConfig
Sourcepub fn new(resampling_interval: TimeDelta) -> Self
pub fn new(resampling_interval: TimeDelta) -> Self
Creates a new LogicalMeterConfig with the given resampling interval.
Sourcepub fn with_default_resampling_function(
self,
function: ResamplingFunction<f32, Sample<f32>>,
) -> Self
pub fn with_default_resampling_function( self, function: ResamplingFunction<f32, Sample<f32>>, ) -> Self
Sets the default resampling function.
This function will be used for all metrics that do not have a specific override set.
If no default resampling function is set, the logical meter will default
to using the Average resampling function.
Sourcepub fn override_resampling_function<M: Metric>(
self,
function: ResamplingFunction<f32, Sample<f32>>,
) -> Self
pub fn override_resampling_function<M: Metric>( self, function: ResamplingFunction<f32, Sample<f32>>, ) -> Self
Sets a resampling function override for a specific metric.
If this function is called multiple times for the same metric, the last function provided will be used.
Sourcepub fn with_max_age_in_intervals(self, max_age_in_intervals: u32) -> Self
pub fn with_max_age_in_intervals(self, max_age_in_intervals: u32) -> Self
Sets the maximum age of samples to be considered for resampling, in number of intervals.
Must be at least 1. If a smaller value is provided, it will be clamped to 1.
If not set, the default value is 3.
Sourcepub fn with_component_graph_config(self, config: ComponentGraphConfig) -> Self
pub fn with_component_graph_config(self, config: ComponentGraphConfig) -> Self
Sets the ComponentGraphConfig forwarded to the underlying graph
when LogicalMeterHandle::try_new (and therefore
Microgrid::try_new) builds it. If not set, the graph crate’s
Default::default() is used.
Auto Trait Implementations§
impl Freeze for LogicalMeterConfig
impl !RefUnwindSafe for LogicalMeterConfig
impl Send for LogicalMeterConfig
impl Sync for LogicalMeterConfig
impl Unpin for LogicalMeterConfig
impl UnsafeUnpin for LogicalMeterConfig
impl !UnwindSafe for LogicalMeterConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request