diff --git a/README.md b/README.md index 92934f3..461bc17 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ifstat-rs -`ifstat-rs` is a simple Rust tool to parse and display network I/O statistics from `/proc/net/dev` once a second. +`ifstat-rs` is a simple Rust tool to parse and display network I/O statistics from `/proc/net/dev` once a second. *"This project has been generated with the assistance of ChatGPT. Please be aware that ChatGPT can make mistakes. It is important to review and verify all information provided by the tool." is what it says. Don't use this tool.* @@ -10,6 +10,7 @@ - Displays RX and TX bytes for each interface every second - Supports monitoring specific interfaces, all interfaces, or loopback interfaces - Allows setting delay between updates and limiting the number of updates +- Displays detailed build information including commit hash and build timestamp ## Installation @@ -32,7 +33,8 @@ cargo run --release - `-a`: Monitor all interfaces - `-l`: Include loopback interfaces - `-i `: Specify interfaces to monitor, separated by commas (e.g., `-i eth0,lo`) -- `--delay `: Set delay between updates (default is 1 second) +- `--first-measurement `: Set delay before the first measurement (default is same as --delay) +- ``: Delay between updates in seconds (default is 1 second) - ``: Number of updates before stopping (default is unlimited) ### Examples @@ -40,25 +42,25 @@ cargo run --release Monitor specific interfaces: ```sh -cargo run --release -- -i eth0,lo +cargo run --release -- -i eth0,lo 1 10 ``` Monitor all interfaces: ```sh -cargo run --release -- -a +cargo run --release -- -a 1 10 ``` Include loopback interfaces: ```sh -cargo run --release -- -l +cargo run --release -- -l 1 10 ``` Specify delay and count: ```sh -cargo run --release -- -a --delay 0.5 10 +cargo run --release -- -a --first-measurement 0.5 1 10 ``` ## Contributing diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 1fb5513..53ac7ad 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -121,11 +121,11 @@ fn test_command_line_options() { "lo,eth0", "--first-measurement", "0.5", - "--delay=1.0", - "--count=10", + "1.0", + "10", ]).unwrap(); assert_eq!(opts.interfaces.unwrap(), "lo,eth0"); assert_eq!(opts.first_measurement.unwrap(), 0.5); assert_eq!(opts.delay, 1.0); assert_eq!(opts.count.unwrap(), 10); -} +} \ No newline at end of file