Skip to content
Live Histogram Command-Line Tool
C++ Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
Makefile
README.md
cli_parser.cpp
cli_parser.h
livehist.cpp

README.md

Live Histogram

A command line tool to show a real-time histogram of a data stream.

Usage

The tool reads lines from the stdin. Every line is considered a symbol.

Example:

python3 -c 'import random; [print(random.choice("ACABACAAABAABC")) for x in range(10000)]' | livehist

Sample output:

5595 :: A
2210 :: B
2195 :: C

Options

Parameter Description
--separator=SEPERATOR / -s SEPERATOR Set the seperator between symbol and count (default: " :: ")
--number=NUMBER / -n NUMBER Display only top NUMBER entries (default: all)
--no-clear / -c Disable screen clear
--reverse / -r Short ascending
--percent / -p Show frequency as percentage
--draw / -d Draw bar for visualization
--interval=SECONDS / -i SECONDS Refresh interval (default: 0)
--switch / -x Show count first, then value
--help / -h Show the help
--outfile=FILE / -o FILE Output latest histogram to file FILE.
--atomic / -a On Ctrl+C, application finishes printing the histogram.

Compile

There are no dependencies on third-party libraries. To compile, simply run

make

Install

After building, simply run

sudo make install

The binary (livehist) is installed to /usr/bin/livehist. Run sudo make uninstall to remove the application.

You can’t perform that action at this time.