Struct Config

Source
pub struct Config<T> {
    pub sample_rate: f64,
    pub duration: usize,
    pub windows: usize,
    pub max_tau: usize,
    pub capacity: usize,
    pub batch_size: usize,
    pub service_mode: bool,
    pub poll_delay: Option<Duration>,
    pub trace_file: Option<String>,
    pub waterfall_file: Option<String>,
    pub heatmap_config: Config,
    pub histogram_config: Config,
    /* private fields */
}
Expand description

a configuration struct for customizing Receiver

Fields§

§sample_rate: f64

the nominal sampling rate in Hertz

§duration: usize

duration of a reporting interval (window) in seconds typical values are 1 or 60 for secondly or minutely reporting

§windows: usize

the number of reporting intervals (windows) to aggregate in heatmap and traces. NOTE: The receiver will halt if service_mode is false and the total number of windows have elapsed

§max_tau: usize

the largest Tau used in producing Allan Deviation meta-metrics

§capacity: usize

the capacity of the stats queue. Default: 256

§batch_size: usize

the default batch size of a Sender. Default: 512

§service_mode: bool

set continuous-run mode. heatmaps and traces will generate every N windows when this is set to true. If it is set to false, the Receiver will halt after N windows

§poll_delay: Option<Duration>

set an optional delay between calls to poll

§trace_file: Option<String>

save a latency heatmap trace to the given file

§waterfall_file: Option<String>

save a waterfal png of the latency heatmap to the given file

§heatmap_config: Config

the shared Heatmap configuration

§histogram_config: Config

the shared Histogram configuration

Implementations§

Source§

impl<T: Hash + Eq + Send + Display + Clone> Config<T>

Source

pub fn new() -> Config<T>

create a new tic Config with defaults

§Example
let mut c = Receiver::<usize>::configure();
Source

pub fn sample_rate(self, frequency: f64) -> Self

set sampling rate in Hertz: default 1 Hz

§Example
let mut c = Receiver::<usize>::configure();
c.sample_rate(1.0); // set to 1 Hz sample rate
Source

pub fn duration(self, duration: usize) -> Self

set integration window in seconds: default 60

§Example
let mut c = Receiver::<usize>::configure();
c.duration(60); // set to 60 second integration window
Source

pub fn windows(self, windows: usize) -> Self

set number of windows to collect: default 60

§Example
let mut c = Receiver::<usize>::configure();
c.windows(60); // collect for 60 x duration and terminate
Source

pub fn max_tau(self, tau: usize) -> Self

set max Tau used in calculating Allan Deviation: default 300

§Example
let mut c = Receiver::<usize>::configure();
c.max_tau(300); // produce ADEV from 1-300 inclusive
Source

pub fn capacity(self, capacity: usize) -> Self

set capacity of the queue: default 256

§Example
let mut c = Receiver::<usize>::configure();
c.capacity(256); // buffer for 256 batches of samples
Source

pub fn batch_size(self, batch_size: usize) -> Self

set batch size of the sender: default 512

§Example
let mut c = Receiver::<usize>::configure();
c.batch_size(512); // batch 512 samples in one queue write
Source

pub fn trace_file(self, path: String) -> Self

set the heatmap trace file

§Example
let mut c = Receiver::<usize>::configure();
c.trace_file("/tmp/heatmap.trace".to_owned()); // heatmap trace will write here
Source

pub fn waterfall_file(self, path: String) -> Self

set the heatmap trace file

§Example
let mut c = Receiver::<usize>::configure();
c.waterfall_file("/tmp/waterfall.png".to_owned()); // waterfall png will render here
Source

pub fn poll_delay(self, delay: Option<Duration>) -> Self

set the poll delay

§Example
let mut c = Receiver::<usize>::configure();
c.poll_delay(Some(Duration::new(0, 100_000)));
Source

pub fn service(self, enabled: bool) -> Self

set receiver to continuous run mode aka service mode

§Example
let mut c = Receiver::<usize>::configure();
c.service(true);
Source

pub fn build(self) -> Receiver<T>

Build a new Receiver based on the current configuration

Trait Implementations§

Source§

impl<T: Clone> Clone for Config<T>

Source§

fn clone(&self) -> Config<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Hash + Eq + Send + Display + Clone> Default for Config<T>

Source§

fn default() -> Config<T>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Config<T>

§

impl<T> RefUnwindSafe for Config<T>
where T: RefUnwindSafe,

§

impl<T> Send for Config<T>
where T: Send,

§

impl<T> Sync for Config<T>
where T: Sync,

§

impl<T> Unpin for Config<T>
where T: Unpin,

§

impl<T> UnwindSafe for Config<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.