TrafficGenerator

Trait TrafficGenerator 

Source
pub trait TrafficGenerator<T: Scenario>: Send + Sync {
    // Required methods
    fn get_data_rate_channel(&self) -> Receiver<(f32, f32)>;
    fn get_sent_packets_channel(&self) -> Receiver<usize>;
    fn get_error_rate_channel(&self) -> Receiver<(f32, f32)>;
    fn send_packet(&mut self);
    fn set_scenario(&mut self, schem: T);
    fn get_scenario(&self) -> &T;
    fn run_scenario(&mut self);
    fn fire_hose(&mut self);
}
Expand description

Traffic Generators are the bread and butter of pdc. Structs that implement TrafficGenerator will take in a scenario and try to replicate the network traffic described by that scenario.

Required Methods§

Source

fn get_data_rate_channel(&self) -> Receiver<(f32, f32)>

Give a bounded channel that sends time series data on the send rate of a generator. The data is encoded as (Miliseconds since start of scenario, counts/sec).

Source

fn get_sent_packets_channel(&self) -> Receiver<usize>

Give a bounded channel that sends the total amount of packets/requests sent

Source

fn get_error_rate_channel(&self) -> Receiver<(f32, f32)>

Give a bounded channel that sends time series data on the send rate of a generator. The data is encoded as (Miliseconds since start of scenario, counts/sec).

Source

fn send_packet(&mut self)

Send a single packet per call, used for debuging and low traffic testing.

Source

fn set_scenario(&mut self, schem: T)

Sets a Scenario for the generator to try and replicate.

Source

fn get_scenario(&self) -> &T

Gets the current Scenario

Source

fn run_scenario(&mut self)

Runs the current scenario

Source

fn fire_hose(&mut self)

Run the generator at full throttle!

Implementors§