Module series

Module series 

Source
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§

BwSeriesPoint
A single point in a bandwidth trace series.
DelayPerPacketSeriesPoint
A single point in a per-packet delay trace series.
DelaySeriesPoint
A single point in a delay trace series.
DuplicateSeriesPoint
A single point in a duplicate trace series.
LossSeriesPoint
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.