Visualize data in the terminal
termeter can visualize data in the terminal. Data can be passed by pipe or file.
$ seq 100 | awk 'BEGIN{OFS="\t"; print "x","sin(x)","cos(x)"}{x=$1/10; print x,sin(x),cos(x)}' | termeterYou can even draw charts from streaming data.
$ seq 300 | awk 'BEGIN{OFS="\t"; print "x","sin(x)","cos(x)"}{x=$1/10; print x,sin(x),cos(x); system("sleep 0.1")}' | termeter$ go get github.com/atsaki/termeter/cmd/termeterYou can input data with stdin or file.
$ cat data.txt | termeter
$ termeter data.txttermeter can accept tabular data like CSV. Delimiter character can be specified with option '-d DELIMITER'. Default is tab.
termeter supports following chart types.
- LINE
- Plot values as line plot
- COUNTER
- Bar chart of frequencies
- CDF
- Cumulative distribution function
By default, termeter choose chart type automatically from second line of data. If value is numeric LINE is choosed. Otherwise, COUNTER is choosed.
You can specify chart type with option -t TYPESTRING.
nth character of TYPESTRING corresponds to nth chart type.
Following charcters can be used.
- l: LINE
- c: COUNTER
- d: CDF
- other: auto
$ (echo "line counter cdf"; seq 1 1000 | awk '{x=int(6*rand())+1; print x,x,x}') | termeter -d " " -t lcd -S numericalIt is useful to draw chart of resouce in the terminal. You can use tools like dstat.
$ dstat --cpu --output dstat.log > /dev/null &
$ tail -f -n +7 dstat.log | termeter -d ,MIT