diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-08-10 09:18:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-08-10 09:18:49 +0000 |
commit | dd814a7c1a8de056a79f7238578b09236edd5506 (patch) | |
tree | 429e7eed5a634a4efe9a6877ce66da8e64aa1782 /web/api/badges | |
parent | Adding upstream version 1.41.0. (diff) | |
download | netdata-dd814a7c1a8de056a79f7238578b09236edd5506.tar.xz netdata-dd814a7c1a8de056a79f7238578b09236edd5506.zip |
Adding upstream version 1.42.0.upstream/1.42.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/api/badges')
-rw-r--r-- | web/api/badges/README.md | 2 | ||||
-rw-r--r-- | web/api/badges/web_buffer_svg.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/web/api/badges/README.md b/web/api/badges/README.md index e40e706e..e83186bb 100644 --- a/web/api/badges/README.md +++ b/web/api/badges/README.md @@ -157,7 +157,7 @@ Here is what you can put for `options` (these are standard Netdata API options): These fine tune various options of the API. Here is what you can use for badges (the API has more option, but only these are useful for badges): - - `percentage`, instead of returning the value, calculate the percentage of the sum of the selected dimensions, versus the sum of all the dimensions of the chart. This also sets the units to `%`. + - `percentage`, instead of returning a value, calculate the percentage of the sum of the values of the selected dimensions (selected sum / total sum * 100). This also sets the units to `%`. - `absolute` or `abs`, turn all values positive and then sum them. diff --git a/web/api/badges/web_buffer_svg.c b/web/api/badges/web_buffer_svg.c index 36150b93..9b81ba4f 100644 --- a/web/api/badges/web_buffer_svg.c +++ b/web/api/badges/web_buffer_svg.c @@ -1057,8 +1057,10 @@ int web_client_api_request_v1_badge(RRDHOST *host, struct web_client *w, char *u buffer_sprintf(w->response.header, "Refresh: %d\r\n", refresh); w->response.data->date = now_realtime_sec(); w->response.data->expires = w->response.data->date + refresh; + buffer_cacheable(w->response.data); } - else buffer_no_cacheable(w->response.data); + else + buffer_no_cacheable(w->response.data); if(!value_color) { switch(rc->status) { |