pub struct Builder { /* private fields */ }
Expand description
Builder for Receiver
.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn histogram(self, window: Duration, granularity: Duration) -> Self
pub fn histogram(self, window: Duration, granularity: Duration) -> Self
Sets the histogram configuration.
Defaults to a 10 second window with 1 second granularity.
This controls both how long of a time window we track histogram data for, and the granularity in which we roll off old data.
As an example, with the default values, we would keep the last 10 seconds worth of histogram data, and would remove 1 seconds worth of data at a time as the window rolled forward.
Sourcepub fn upkeep_interval(self, interval: Duration) -> Self
pub fn upkeep_interval(self, interval: Duration) -> Self
Sets the upkeep interval.
Defaults to 50 milliseconds.
This controls how often the time source, used internally by histograms, is updated with the real time. For performance reasons, histograms use a sampled time source when they perform checks to see if internal maintenance needs to occur. If the histogram granularity is set very low, then this interval might need to be similarly reduced to make sure we’re able to update the time more often than histograms need to perform upkeep.