8000 GitHub - acj/hts: Highlight lines of program output based on the latency between them · GitHub
[go: up one dir, main page]

Skip to content
acjPublic

About

Highlight lines of program output based on the latency between them

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

32 Commits

Folders and files

Repository files navigation

hts

Highlight lines of program output based on the latency between them

screenshot with hts showing latency for a demo program

Getting started

Homebrew (recommended)

brew install acj/taps/hts

From source

You'll need a Rust toolchain. Clone this repository, and then:

cargo build

Usage

Usage: hts [OPTIONS] [-- <COMMAND>...]

Arguments:
  [COMMAND]...  Run this command under a pseudo-terminal and annotate its stdout and stderr. Unlike piping, this times lines as the command prints them rather than when it flushes its output buffer, and hts exits with the command's exit code

Options:
  -d, --debug                        Turn debugging information on
  -m, --min-latency <MIN_LATENCY>    Don't highlight lines with latency at or below this threshold [default: 1ms]
  -M, --max-latency <MAX_LATENCY>    Latency at or above this gets the brightest highlight [default: 10s]
  -l, --latency-unit <LATENCY_UNIT>  Show the latency between lines in the given unit. "auto" picks a readable unit for each line [default: auto] [possible values: auto, ns, us, ms, s, m, h, d]
  -t, --top <TOP>                    Number of slowest lines to list in the summary printed to stderr at the end; 0 disables it [default: 5]
  -h, --help                         Print help
  -V, --version                      Print version

Run a command through hts:

hts -- ping google.com -c 4

Piping also works and is fine for programs that flush every line or write to stderr, which is unbuffered:

cargo clean && cargo build 2>&1 | hts

About

Highlight lines of program output based on the latency between them

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages

0