Highlight lines of program output based on the latency between them
![screenshot with hts showing latency for a demo program](https://private-user-images.githubusercontent.com/27923/267640402-ba91c337-6c94-4ef1-a964-b7b7ab8f6f59.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNzExNTUsIm5iZiI6MTczOTM3MDg1NSwicGF0aCI6Ii8yNzkyMy8yNjc2NDA0MDItYmE5MWMzMzctNmM5NC00ZWYxLWE5NjQtYjdiN2FiOGY2ZjU5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDE0MzQxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZjODQ1NGJhZTBlNmE5MDEzMjU5NjNmYjBjMDYwNTdkN2YyOWFlMjEzN2YzNTE5Yzk5NjYxMzRhZTc4MjhiMDAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.26Np-Kv2DRGvTeccoMiW8mEgRpXFkkgtBhBh3q6MUYw)
brew install acj/taps/hts
You'll need a Rust toolchain. Clone this repository, and then:
cargo build
Usage: hts [OPTIONS]
Options:
-d, --debug Turn debugging information on
-n, --no-echo Do not echo lines of input as they arrive; show highlighted output after the command finishes
-m, --min-latency <MIN_LATENCY> Don't highlight lines with latency below this threshold [default: 1ms]
-l, --latency-unit <LATENCY_UNIT> Show the latency between lines in the given unit. Valid units are ns, us, ms, s, m, h, d [default: ms]
-h, --help Print help
-V, --version Print version
Try piping a command into hts
:
ping google.com -c 4 | hts
If you built hts from source, try it again with highlighting:
cargo clean && cargo build 2>&1 | hts