| 1 | # Average or Mean |
| 2 | |
| 3 | > This query is available as `average` and `mean`. |
| 4 | |
| 5 | An average is a single number taken as representative of a list of numbers. |
| 6 | |
| 7 | It is calculated as: |
| 8 | |
| 9 | ``` |
| 10 | average = sum(numbers) / count(numbers) |
| 11 | ``` |
| 12 | |
| 13 | ## how to use |
| 14 | |
| 15 | Use it in alerts like this: |
| 16 | |
| 17 | ``` |
| 18 | alarm: my_alert |
| 19 | on: my_chart |
| 20 | lookup: average -1m unaligned of my_dimension |
| 21 | warn: $this > 1000 |
| 22 | ``` |
| 23 | |
| 24 | `average` does not change the units. For example, if the chart units is `requests/sec`, the result |
| 25 | will be again expressed in the same units. |
| 26 | |
| 27 | It can also be used in APIs and badges as `&group=average` in the URL. |
| 28 | |
| 29 | ## Examples |
| 30 | |
| 31 | Examining last 1 minute `successful` web server responses: |
| 32 | |
| 33 | -  |
| 34 | -  |
| 35 | -  |
| 36 | |
| 37 | ## References |
| 38 | |
| 39 | - <https://en.wikipedia.org/wiki/Average>. |
| 40 | |
| 41 |