diff options
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 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) { |