diff options
| author | Niclas Zeising <zeising@FreeBSD.org> | 2016-01-27 11:48:09 +0000 |
|---|---|---|
| committer | Niclas Zeising <zeising@FreeBSD.org> | 2016-01-27 11:48:09 +0000 |
| commit | 780a75041fb23996c49a4c7f6c4a85fb68a4fb70 (patch) | |
| tree | 1fdca7026d5f7b5658ecb4e30116244882b0addb /databases/rrdtool/files/thirdparty-json.diff | |
| parent | - Add missing runtime dependency (diff) | |
Update to 1.5.5
Rework the DEJAVU option to actually work. [1]
Before this commit rrdtool
depends on x11-fonts/dejavu if that port is already installed, but not
otherwise, and this sort of implicit dependencies are bad.
Make the DEJAVU option default to on. If cairo and pango are built without
X11 support, please consider disabling this option to avoid pulling in large
parts of X11
Remove the JSON option. This is a third party patch that doesn't apply any
more. Feel free to port it to this version of RRDTool.
Discussed with: marino [1]
PR: 205883 [1]
Submitted by: marino [1]
Diffstat (limited to 'databases/rrdtool/files/thirdparty-json.diff')
| -rw-r--r-- | databases/rrdtool/files/thirdparty-json.diff | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/databases/rrdtool/files/thirdparty-json.diff b/databases/rrdtool/files/thirdparty-json.diff deleted file mode 100644 index 95159feb1add..000000000000 --- a/databases/rrdtool/files/thirdparty-json.diff +++ /dev/null @@ -1,112 +0,0 @@ ---- src/rrd_tool.c.orig 2012-01-24 08:08:48.000000000 -0200 -+++ src/rrd_tool.c 2012-05-11 15:57:51.000000000 -0300 -@@ -57,7 +57,7 @@ - N_ - ("Valid commands: create, update, updatev, graph, graphv, dump, restore,\n" - "\t\tlast, lastupdate, first, info, fetch, tune,\n" -- "\t\tresize, xport, flushcached\n"); -+ "\t\tresize, xport, json, flushcached\n"); - - const char *help_listremote = - N_("Valid remote commands: quit, ls, cd, mkdir, pwd\n"); -@@ -210,6 +210,13 @@ - "\t\t[--enumds] [--json]\n" "\t\t[DEF:vname=rrd:ds-name:CF]\n" - "\t\t[CDEF:vname=rpn-expression]\n" - "\t\t[XPORT:vname:legend]\n"); -+ const char *help_json = -+ N_("* json - generate JSON dump from one or several RRD\n\n" -+ "\trrdtool json [-s|--start seconds] [-e|--end seconds]\n" -+ "\t\t[-m|--maxrows rows]\n" "\t\t[--step seconds]\n" -+ "\t\t[DEF:vname=rrd:ds-name:CF]\n" -+ "\t\t[CDEF:vname=rpn-expression]\n" -+ "\t\t[XPORT:vname:legend]\n"); - const char *help_quit = - N_(" * quit - closing a session in remote mode\n\n" - "\trrdtool quit\n"); -@@ -232,7 +239,7 @@ - enum { C_NONE, C_CREATE, C_DUMP, C_INFO, C_RESTORE, C_LAST, - C_LASTUPDATE, C_FIRST, C_UPDATE, C_FETCH, C_GRAPH, C_GRAPHV, - C_TUNE, -- C_RESIZE, C_XPORT, C_QUIT, C_LS, C_CD, C_MKDIR, C_PWD, -+ C_RESIZE, C_XPORT, C_JSON, C_QUIT, C_LS, C_CD, C_MKDIR, C_PWD, - C_UPDATEV, C_FLUSHCACHED - }; - int help_cmd = C_NONE; -@@ -270,6 +277,8 @@ - help_cmd = C_RESIZE; - else if (!strcmp(cmd, "xport")) - help_cmd = C_XPORT; -+ else if (!strcmp(cmd, "json")) -+ help_cmd = C_JSON; - else if (!strcmp(cmd, "quit")) - help_cmd = C_QUIT; - else if (!strcmp(cmd, "ls")) -@@ -345,6 +354,9 @@ - case C_XPORT: - puts(_(help_xport)); - break; -+ case C_JSON: -+ puts(_(help_json)); -+ break; - case C_QUIT: - puts(_(help_quit)); - break; -@@ -844,6 +856,58 @@ - setlocale(LC_NUMERIC, old_locale); - } - free(vtag); -+ } else if (strcmp("json", argv[1]) == 0) { -+ int xxsize; -+ unsigned long int j = 0; -+ time_t start, end, ti; -+ unsigned long step, col_cnt; -+ rrd_value_t *data, *ptr; -+ char **legend_v; -+ int i; -+ -+ if (rrd_xport -+ (argc - 1, &argv[1], &xxsize, &start, &end, &step, &col_cnt, -+ &legend_v, &data) != -1) { -+ char *old_locale = setlocale(LC_NUMERIC, "C"); -+ printf("[\n"); -+ for (j = 0; j < col_cnt; j++) { -+ char *entry = NULL; -+ ptr = j + data; -+ entry = legend_v[j]; -+ -+ printf("\t{\n\t\t\"%s\": {\n", entry); -+ free(entry); -+ printf("\t\t\t\"%s\": %lld,\n", META_START_TAG, -+ (long long int) start + step); -+ printf("\t\t\t\"%s\": %lu,\n", META_STEP_TAG, step); -+ printf("\t\t\t\"%s\": %lld,\n", META_END_TAG, (long long int) end); -+ printf("\t\t\t\"data_points\": [\n"); -+ -+ for (ti = start + step; ti <= end; ti += step) { -+ rrd_value_t newval = DNAN; -+ newval = *ptr; -+ if (isnan(newval)) { -+ printf("null"); -+ } else { -+ printf("%0.5f", newval); -+ }; -+ if (ti < end) { -+ printf(", "); -+ } -+ ptr+=col_cnt; -+ } -+ -+ printf("\n\t\t\t]\n"); -+ printf("\t\t}\n"); -+ -+ printf("\t}%s\n", (j<col_cnt-1) ? "," : ""); -+ } -+ free(legend_v); -+ -+ free(data); -+ printf("]\n"); -+ setlocale(LC_NUMERIC, old_locale); -+ } - #else - rrd_set_error("the instance of rrdtool has been compiled without graphics"); - #endif |
