| 1 | # standard deviation (`stddev`) |
| 2 | |
| 3 | The standard deviation is a measure that is used to quantify the amount of variation or dispersion |
| 4 | of a set of data values. |
| 5 | |
| 6 | A low standard deviation indicates that the data points tend to be close to the mean (also called the |
| 7 | expected value) of the set, while a high standard deviation indicates that the data points are spread |
| 8 | out over a wider range of values. |
| 9 | |
| 10 | ## how to use |
| 11 | |
| 12 | Use it in alerts like this: |
| 13 | |
| 14 | ``` |
| 15 | alarm: my_alert |
| 16 | on: my_chart |
| 17 | lookup: stddev -1m unaligned of my_dimension |
| 18 | warn: $this > 1000 |
| 19 | ``` |
| 20 | |
| 21 | `stdev` does not change the units. For example, if the chart units is `requests/sec`, the standard |
| 22 | deviation will be again expressed in the same units. |
| 23 | |
| 24 | It can also be used in APIs and badges as `&group=stddev` in the URL. |
| 25 | |
| 26 | ## Examples |
| 27 | |
| 28 | Examining last 1 minute `successful` web server responses: |
| 29 | |
| 30 | -  |
| 31 | -  |
| 32 | -  |
| 33 | -  |
| 34 | |
| 35 | ## References |
| 36 | |
| 37 | Check <https://en.wikipedia.org/wiki/Standard_deviation>. |
| 38 | |
| 39 | --- |
| 40 | |
| 41 | # Coefficient of variation (`cv`) |
| 42 | |
| 43 | > This query is also available as `rsd`. |
| 44 | |
| 45 | The coefficient of variation (`cv`), also known as relative standard deviation (`rsd`), |
| 46 | is a standardized measure of dispersion of a probability distribution or frequency distribution. |
| 47 | |
| 48 | It is defined as the ratio of the **standard deviation** to the **mean**. |
| 49 | |
| 50 | In simple terms, it gives the percentage of change. So, if the average value of a metric is 1000 |
| 51 | and its standard deviation is 100 (meaning that it variates from 900 to 1100), then `cv` is 10%. |
| 52 | |
| 53 | This is an easy way to check the % variation, without using absolute values. |
| 54 | |
| 55 | For example, you may trigger an alert if your web server requests/sec `cv` is above 20 (`%`) |
| 56 | over the last minute. So if your web server was serving 1000 reqs/sec over the last minute, |
| 57 | it will trigger the alert if had spikes below 800/sec or above 1200/sec. |
| 58 | |
| 59 | ## how to use |
| 60 | |
| 61 | Use it in alerts like this: |
| 62 | |
| 63 | ``` |
| 64 | alarm: my_alert |
| 65 | on: my_chart |
| 66 | lookup: cv -1m unaligned of my_dimension |
| 67 | units: % |
| 68 | warn: $this > 20 |
| 69 | ``` |
| 70 | |
| 71 | The units reported by `cv` is always `%`. |
| 72 | |
| 73 | It can also be used in APIs and badges as `&group=cv` in the URL. |
| 74 | |
| 75 | ## Examples |
| 76 | |
| 77 | Examining last 1 minute `successful` web server responses: |
| 78 | |
| 79 | -  |
| 80 | -  |
| 81 | -  |
| 82 | -  |
| 83 | |
| 84 | ## References |
| 85 | |
| 86 | Check <https://en.wikipedia.org/wiki/Coefficient_of_variation>. |
| 87 | |
| 88 |