summaryrefslogtreecommitdiffstats
path: root/web/api/badges
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-10 09:18:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-10 09:19:08 +0000
commita2d7dede737947d7c6afa20a88e1f0c64e0eb96c (patch)
treefed4aff7dbe0be00cf91de6261d98bc0eb9a2449 /web/api/badges
parentReleasing debian version 1.41.0-1. (diff)
downloadnetdata-a2d7dede737947d7c6afa20a88e1f0c64e0eb96c.tar.xz
netdata-a2d7dede737947d7c6afa20a88e1f0c64e0eb96c.zip
Merging upstream version 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.md2
-rw-r--r--web/api/badges/web_buffer_svg.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/web/api/badges/README.md b/web/api/badges/README.md
index e40e706eb..e83186bb2 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 36150b93e..9b81ba4fb 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) {