From 017271cc4e05f996eb3fa2cc822629142b8b7f28 Mon Sep 17 00:00:00 2001 From: jentrialgo Date: Tue, 31 Aug 2021 13:52:09 +0200 Subject: [PATCH 1/5] Fix error when dataLabelMode is first The first record of the first line was consumed twice (in the main function and in the update function) so the first line was not correctly plotted --- cmd/termeter/termeter.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/termeter/termeter.go b/cmd/termeter/termeter.go index 095b53e..7044175 100644 --- a/cmd/termeter/termeter.go +++ b/cmd/termeter/termeter.go @@ -135,7 +135,6 @@ func main() { if *dataLabelMode == "first" { labels = labels[1:] - record = record[1:] } types := make([]rune, len(labels), len(labels)) From b81c463c13ba41decef5f3614f798d4e137bbc28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Entrialgo?= Date: Fri, 3 Sep 2021 12:57:41 +0200 Subject: [PATCH 2/5] Add to the README instructions for preparing a go environment --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f6ece92..ac12857 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,26 @@ $ seq 300 | awk 'BEGIN{OFS="\t"; print "x","sin(x)","cos(x)"}{x=$1/10; print x,s ## Installation +If you do not have a go enviroment prepared with the corresponding `GOPATH` +environment variable, you can run these command in Linux: + +```bash +mkdir $HOME/go + +echo "export GOPATH=$HOME/go" >> $HOME/.bashrc +echo "export PATH=$PATH:$GOPATH/bin" >> $HOME/.bashrc +``` + +Restart the session to have the new environment variables. + +With the go environment prepared, you have to run to install: + ```bash -$ go get github.com/atsaki/termeter/cmd/termeter +go get github.com/atsaki/termeter/cmd/termeter ``` +The command `termeter` should be in your path. + ## Input Data You can input data with stdin or file. From 04cf6169c45b5367069ca719c74f59c5688cff82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Entrialgo?= Date: Mon, 6 Sep 2021 10:25:33 +0200 Subject: [PATCH 3/5] Add info about data labels to the README --- README.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ac12857..0a3d8aa 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,8 @@ echo "export PATH=$PATH:$GOPATH/bin" >> $HOME/.bashrc Restart the session to have the new environment variables. -With the go environment prepared, you have to run to install: +With the go environment prepared, you have to run this command in order to +install termeter: ```bash go get github.com/atsaki/termeter/cmd/termeter @@ -49,13 +50,12 @@ 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. +termeter supports following chart types: * LINE * Plot values as line plot @@ -65,7 +65,7 @@ termeter supports following chart types. * 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. +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. @@ -96,6 +96,14 @@ $ tail -f -n +7 dstat.log | termeter -d , +## Data labels + +You specify which data labels to use as X axis in line charts with the option `-L` and one of these options: + +* **count**: use the count of data. (Default) +* **first**: use the first column, i.e., the first value in the same line. +* **time**: use current time. + ## License MIT From 11dee70cd267c394e1f12e9bd4db540fc71d23d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Entrialgo?= Date: Fri, 10 Sep 2021 07:41:17 +0200 Subject: [PATCH 4/5] Fix installation instructions in the README Use single quotes for avoiding variable expansion in echo commands. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0a3d8aa..0d98d01 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,8 @@ environment variable, you can run these command in Linux: ```bash mkdir $HOME/go -echo "export GOPATH=$HOME/go" >> $HOME/.bashrc -echo "export PATH=$PATH:$GOPATH/bin" >> $HOME/.bashrc +echo 'export GOPATH=$HOME/go' >> $HOME/.bashrc +echo 'export PATH=$PATH:$GOPATH/bin' >> $HOME/.bashrc ``` Restart the session to have the new environment variables. From 21858a0b18bfde55281a005caf89b63c95849765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Entrialgo?= Date: Fri, 10 Sep 2021 08:51:25 +0200 Subject: [PATCH 5/5] Fix installation URL in the README to use this repo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d98d01..3b261a7 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ With the go environment prepared, you have to run this command in order to install termeter: ```bash -go get github.com/atsaki/termeter/cmd/termeter +go get github.com/jentrialgo/termeter/cmd/termeter ``` The command `termeter` should be in your path.