Expand description
This module provides functionality to expand trace models into time series data that can be used for plotting and analysis in other programming languages.
Note: This module is only available when the trace-ext feature is enabled.
§Overview
Trace models generate values by calling next_xxx() methods. This module provides
functions to expand these traces into a complete series within a specified time range,
making them suitable for visualization and export.
§Examples
let mut static_bw = StaticBwConfig::new()
.bw(Bandwidth::from_mbps(24))
.duration(Duration::from_secs(2))
.build();
let series = expand_bw_trace(
&mut static_bw,
Duration::from_secs(0),
Duration::from_secs(2)
);
assert_eq!(series.len(), 1);
assert_eq!(series[0].start_time, Duration::from_secs(0));
assert_eq!(series[0].value, Bandwidth::from_mbps(24));
assert_eq!(series[0].duration, Duration::from_secs(2));Structs§
- BwSeries
Point - A single point in a bandwidth trace series.
- Delay
PerPacket Series Point - A single point in a per-packet delay trace series.
- Delay
Series Point - A single point in a delay trace series.
- Duplicate
Series Point - A single point in a duplicate trace series.
- Loss
Series Point - A single point in a loss trace series.
Functions§
- expand_
bw_ trace - Expands a bandwidth trace into a series within the specified time range.
- expand_
delay_ per_ packet_ trace - Expands a per-packet delay trace into a series.
- expand_
delay_ trace - Expands a delay trace into a series within the specified time range.
- expand_
duplicate_ trace - Expands a duplicate trace into a series within the specified time range.
- expand_
loss_ trace - Expands a loss trace into a series within the specified time range.
- write_
bw_ series_ csv - Writes a bandwidth series to a file in CSV format.
- write_
bw_ series_ json - Writes a bandwidth series to a file in JSON format.
- write_
delay_ per_ packet_ series_ csv - Writes a per-packet delay series to a file in CSV format.
- write_
delay_ per_ packet_ series_ json - Writes a per-packet delay series to a file in JSON format.
- write_
delay_ series_ csv - Writes a delay series to a file in CSV format.
- write_
delay_ series_ json - Writes a delay series to a file in JSON format.
- write_
duplicate_ series_ csv - Writes a duplicate series to a file in CSV format.
- write_
duplicate_ series_ json - Writes a duplicate series to a file in JSON format.
- write_
loss_ series_ csv - Writes a loss series to a file in CSV format.
- write_
loss_ series_ json - Writes a loss series to a file in JSON format.