master
md 36 lines 1.29 KB
Rendered Raw
1 # Sum
2
3 This module sums all the values in the time-frame requested.
4
5 You can use `sum` to find the volume of something over a period.
6
7 ## how to use
8
9 Use it in alarms like this:
10
11 ```
12 alarm: my_alarm
13 on: my_chart
14 lookup: sum -1m unaligned of my_dimension
15 warn: $this > 1000
16 ```
17
18 `sum` does not change the units. For example, if the chart units is `requests/sec`, the result
19 will be again expressed in the same units.
20
21 It can also be used in APIs and badges as `&group=sum` in the URL.
22
23 ## Examples
24
25 Examining last 1 minute `successful` web server responses:
26
27 - ![](https://registry.my-netdata.io/api/v1/badge.svg?chart=web_log_nginx.response_statuses&options=unaligned&dimensions=success&group=min&after=-60&label=min)
28 - ![](https://registry.my-netdata.io/api/v1/badge.svg?chart=web_log_nginx.response_statuses&options=unaligned&dimensions=success&group=average&after=-60&label=average)
29 - ![](https://registry.my-netdata.io/api/v1/badge.svg?chart=web_log_nginx.response_statuses&options=unaligned&dimensions=success&group=max&after=-60&label=max)
30 - ![](https://registry.my-netdata.io/api/v1/badge.svg?chart=web_log_nginx.response_statuses&options=unaligned&dimensions=success&group=sum&after=-60&label=1m+sum&value_color=orange&units=requests)
31
32 ## References
33
34 - <https://en.wikipedia.org/wiki/Summation>.
35
36