imake it easier to process collectd output - ploot - simple plotting tools Err bitreich.org 70
hgit clone git://bitreich.org/ploot git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/ploot URL:git://bitreich.org/ploot git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/ploot bitreich.org 70
1Log /scm/ploot/log.gph bitreich.org 70
1Files /scm/ploot/files.gph bitreich.org 70
1Refs /scm/ploot/refs.gph bitreich.org 70
1Tags /scm/ploot/tag bitreich.org 70
1README /scm/ploot/file/README.md.gph bitreich.org 70
1LICENSE /scm/ploot/file/LICENSE.gph bitreich.org 70
i--- Err bitreich.org 70
1commit 1da236f9d56f1181e2612354a1b54ff476dbe61c /scm/ploot/commit/1da236f9d56f1181e2612354a1b54ff476dbe61c.gph bitreich.org 70
1parent f9e8a55f3bafb5dad451b50fedab9eb5dfd4cb20 /scm/ploot/commit/f9e8a55f3bafb5dad451b50fedab9eb5dfd4cb20.gph bitreich.org 70
hAuthor: Josuah Demangeon <mail@josuah.net> URL:mailto:mail@josuah.net bitreich.org 70
iDate: Tue, 6 Feb 2018 23:47:26 +0100 Err bitreich.org 70
i Err bitreich.org 70
imake it easier to process collectd output Err bitreich.org 70
i Err bitreich.org 70
iDiffstat: Err bitreich.org 70
i M ploot.c | 17 +++++++++-------- Err bitreich.org 70
i Err bitreich.org 70
i1 file changed, 9 insertions(+), 8 deletions(-) Err bitreich.org 70
i--- Err bitreich.org 70
1diff --git a/ploot.c b/ploot.c /scm/ploot/file/ploot.c.gph bitreich.org 70
i@@ -85,7 +85,7 @@ title(char *str, int width) Err bitreich.org 70
i { Err bitreich.org 70
i if (str == NULL) Err bitreich.org 70
i return; Err bitreich.org 70
i- printf("%*s\n", (int)(width + strlen(str) + MARGIN) / 2, str); Err bitreich.org 70
i+ printf("%*s\n", (int)(width + strlen(str)) / 2 + MARGIN, str); Err bitreich.org 70
i } Err bitreich.org 70
i Err bitreich.org 70
i /* Err bitreich.org 70
i@@ -179,20 +179,21 @@ read_simple(double buf[MAX_VAL]) Err bitreich.org 70
i } Err bitreich.org 70
i Err bitreich.org 70
i /* Err bitreich.org 70
i- * Read a format with blank-separated time_t-double pairs, one per line and save Err bitreich.org 70
i+ * Read a format with comma separated time_t-double pairs, one per line and save Err bitreich.org 70
i * the last `MAX_WIDTH' values into `tbuf' and `vbuf' which must both be at Err bitreich.org 70
i- * least MAX_VAL wide and return a pointer to the last element of `vbuf' or NULL if the Err bitreich.org 70
i- * input contains error. Err bitreich.org 70
i+ * least MAX_VAL wide and return a pointer to the last element of `vbuf' or Err bitreich.org 70
i+ * NULL if the input contains error. Err bitreich.org 70
i */ Err bitreich.org 70
i time_t * Err bitreich.org 70
i read_time_series(double *vbuf, time_t *tbuf) Err bitreich.org 70
i { Err bitreich.org 70
i size_t p, pos, nul, len; Err bitreich.org 70
i- double vrbuf[MAX_VAL], vval; Err bitreich.org 70
i+ double vrbuf[MAX_VAL], vval, dval; Err bitreich.org 70
i time_t trbuf[MAX_VAL], tval; Err bitreich.org 70
i Err bitreich.org 70
i len = LEN(vrbuf); Err bitreich.org 70
i- for (p = pos = 0; scanf("%zd %lf\n", &tval, &vval) > 0; p++) { Err bitreich.org 70
i+ for (p = pos = 0; scanf("%lf,%lf\n", &dval, &vval) > 0; p++) { Err bitreich.org 70
i+ tval = (time_t)dval; Err bitreich.org 70
i RING_ADD(trbuf, len, pos, tval); Err bitreich.org 70
i RING_ADD(vrbuf, len, nul, vval); Err bitreich.org 70
i } Err bitreich.org 70
i@@ -209,7 +210,7 @@ read_time_series(double *vbuf, time_t *tbuf) Err bitreich.org 70
i * value in `step' amount of time, by setting a value to -1. Err bitreich.org 70
i */ Err bitreich.org 70
i double * Err bitreich.org 70
i-fill_gaps(time_t *tbeg, time_t *tend, double *vbuf, time_t step) Err bitreich.org 70
i+skip_gaps(time_t *tbeg, time_t *tend, double *vbuf, time_t step) Err bitreich.org 70
i { Err bitreich.org 70
i size_t p, pos, len; Err bitreich.org 70
i time_t *tp, toff; Err bitreich.org 70
i@@ -274,7 +275,7 @@ main(int argc, char **argv) Err bitreich.org 70
i usage(); Err bitreich.org 70
i Err bitreich.org 70
i tend = read_time_series(vbuf, tbuf); Err bitreich.org 70
i- vend = fill_gaps(tbuf, tend, vbuf, flag_o); Err bitreich.org 70
i+ vend = skip_gaps(tbuf, tend, vbuf, flag_o); Err bitreich.org 70
i Err bitreich.org 70
i plot(flag_h, vbuf, vend, flag_t); Err bitreich.org 70
i return 0; Err bitreich.org 70
.
Response:
text/plain