1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! [](https://crates.io/crates/chokepoint)
//! [](https://docs.rs/chokepoint)
//! [](/LICENSE)
//!
//! A library for simulating "traffic shaping" in Rust based on a generic `futures::Stream` and `futures::Sink`
//! transformer that can be used to modify the delivery of items. The main purpose is to simulate various network
//! conditions such as:
//! - Delay (using a user provided function)
//! - Packet loss
//! - Packet reordering
//! - Packet corruption
//! - Packet duplication
//! - Bandwidth limiting
//!
//! See [`TrafficShaper`] for more information and an example.
//!
//! ## chokepoint command line tool
//!
//! At [./cli](./cli) you can find a simple cli tool for interactive exploration. Using a tool like [graph-cli](https://github.com/mcastorina/graph-cli/) you can visualize the output. Here is an example to showcase delay, jitter and bandwidth:
//!
//! 
//!
//! ```sh
//! $ chokepoint --help
//! Usage: chokepoint [OPTIONS] <MODE>
//!
//! Arguments:
//! <MODE> Simulate a sink or a stream [possible values: stream, sink]
//!
//! Options:
//! -v, --verbose
//!
//! -n <N>
//! Number of packets to send [default: 250]
//! -o, --output <OUTPUT>
//! Output file (csv) with packet timing information
//! -r, --packet-rate <PACKET_RATE>
//! Send rate in packets per second
//! -s, --packet-size <PACKET_SIZE>
//! Packet size in bytes [default: 1B]
//! --ordering <ORDERING>
//! [default: ordered]
//! -l, --bandwidth-limit <BANDWIDTH_LIMIT>
//! Bandwidth limit
//! --mean <MEAN>
//! Mean latency in ms [default: 0.0]
//! --stddev <STDDEV>
//! Standard deviation of latency in ms (aka jitter) [default: 0.0]
//! -h, --help
//! Print help
//! ```
extern crate tracing;
extern crate pin_project;
pub
pub use ChokeItem;
pub use *;
pub use ;
pub use ChokeSink;
pub use ChokeStream;