updated increase doc, address PR feedback

pull/921/head
Scott Anderson 2020-04-07 15:40:01 -06:00
parent 46c2fa1454
commit b2f8ccd831
2 changed files with 14 additions and 9 deletions

View File

@ -4,8 +4,8 @@ seotitle: Calculate the increase in Flux
list_title: Increase list_title: Increase
description: > description: >
Use the [`increase()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase/) Use the [`increase()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase/)
to calculate the increase in values since the beginning of the series or table. to track increases across multiple columns in a table.
This function is especially useful when tracking changes in counter values which This function is especially useful when tracking changes in counter values that
wrap over time or periodically reset. wrap over time or periodically reset.
weight: 210 weight: 210
menu: menu:
@ -21,8 +21,8 @@ list_code_example: |
--- ---
Use the [`increase()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase/) Use the [`increase()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase/)
to calculate the increase of values in a table. to track increases across multiple columns in a table.
This function is especially useful when tracking changes in counter values which This function is especially useful when tracking changes in counter values that
wrap over time or periodically reset. wrap over time or periodically reset.
```js ```js
@ -30,6 +30,9 @@ data
|> increase() |> increase()
``` ```
`increase()` returns a cumulative sum of **non-negative** differences between rows in a table.
For example:
{{< flex >}} {{< flex >}}
{{% flex-content %}} {{% flex-content %}}
**Given the following input:** **Given the following input:**

View File

@ -1,6 +1,8 @@
--- ---
title: increase() function title: increase() function
description: The `increase()` function calculates the total non-negative difference between values in a table. description: >
The `increase()` function calculates the cumulative sum of **non-negative** differences
between subsequent values.
aliases: aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/increase - /v2.0/reference/flux/functions/transformations/aggregates/increase
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/increase/ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/increase/
@ -11,8 +13,8 @@ menu:
weight: 501 weight: 501
--- ---
The `increase()` function calculates the total non-negative difference between The `increase()` function calculates the cumulative sum of **non-negative** differences
subsequent values. between subsequent values.
A main use case is tracking changes in counter values which may wrap over time A main use case is tracking changes in counter values which may wrap over time
when they hit a threshold or are reset. when they hit a threshold or are reset.
In the case of a wrap/reset, we can assume that the absolute delta between two In the case of a wrap/reset, we can assume that the absolute delta between two
@ -58,8 +60,8 @@ Given the following input table:
| _time | _value | | _time | _value |
| ----- | ------ | | ----- | ------ |
| 00002 | 4 | | 00002 | 4 |
| 00003 | 7 | | 00003 | 4 |
| 00004 | 8 | | 00004 | 5 |
## Function definition ## Function definition
```js ```js