termeter

Visualize data in the terminal

  • 所有者: atsaki/termeter
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

termeter

Visualize data in the terminal

Description

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)}', termeter

screenshot01

You 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

Installation

$ go get github.com/atsaki/termeter/cmd/termeter

Input Data

You can input data with stdin or file.

$ cat data.txt, termeter
$ termeter data.txt

termeter can accept tabular data like CSV.
Delimiter character can be specified with option '-d DELIMITER'. Default is tab.

Chart types

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

Example of chart types

$ (echo "line counter cdf"; seq 1 1000, awk '{x=int(6*rand())+1; print x,x,x}'), termeter -d " " -t lcd -S numerical

charttype

Use case

It 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 ,

License

MIT

主要指标

概览
名称与所有者atsaki/termeter
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2015-03-20 01:39:21
推送于2021-09-10 06:51:43
最后一次提交2015-11-13 00:33:52
发布数0
用户参与
星数456
关注者数11
派生数31
提交数7
已启用问题?
问题数9
打开的问题数8
拉请求数1
打开的拉请求数3
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?