Struct tic::Config [−][src]
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, // some fields omitted }
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
Methods
impl<T: Hash + Eq + Send + Display + Clone> Config<T>
[src]
impl<T: Hash + Eq + Send + Display + Clone> Config<T>
pub fn new() -> Config<T>
[src]
pub fn new() -> Config<T>
pub fn sample_rate(self, frequency: f64) -> Self
[src]
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
pub fn duration(self, duration: usize) -> Self
[src]
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
pub fn windows(self, windows: usize) -> Self
[src]
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
pub fn max_tau(self, tau: usize) -> Self
[src]
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
pub fn capacity(self, capacity: usize) -> Self
[src]
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
pub fn batch_size(self, batch_size: usize) -> Self
[src]
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
pub fn trace_file(self, path: String) -> Self
[src]
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
pub fn waterfall_file(self, path: String) -> Self
[src]
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
pub fn poll_delay(self, delay: Option<Duration>) -> Self
[src]
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)));
pub fn service(self, enabled: bool) -> Self
[src]
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);
pub fn build(self) -> Receiver<T>
[src]
pub fn build(self) -> Receiver<T>
Build a new Receiver based on the current configuration
Trait Implementations
impl<T: Clone> Clone for Config<T>
[src]
impl<T: Clone> Clone for Config<T>
fn clone(&self) -> Config<T>
[src]
fn clone(&self) -> Config<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T: Hash + Eq + Send + Display + Clone> Default for Config<T>
[src]
impl<T: Hash + Eq + Send + Display + Clone> Default for Config<T>