diff --git a/content/enterprise_influxdb/v1.9/flux/guides/monitor-states.md b/content/enterprise_influxdb/v1.9/flux/guides/monitor-states.md index 33a22916d..3c04fcdfc 100644 --- a/content/enterprise_influxdb/v1.9/flux/guides/monitor-states.md +++ b/content/enterprise_influxdb/v1.9/flux/guides/monitor-states.md @@ -106,7 +106,7 @@ calculates how many points have `closed` as their `_value`. ```js from(bucket: "doors") |> range(start: -5m) - |> stateDuration(fn: (r) => r._value == "closed", column: "door_closed") + |> stateCount(fn: (r) => r._value == "closed", column: "door_closed") ``` This example stores the **state count** in the `door_closed` column. diff --git a/content/influxdb/v2.0/query-data/flux/monitor-states.md b/content/influxdb/v2.0/query-data/flux/monitor-states.md index 116ef148f..d7c0ae2cc 100644 --- a/content/influxdb/v2.0/query-data/flux/monitor-states.md +++ b/content/influxdb/v2.0/query-data/flux/monitor-states.md @@ -105,7 +105,7 @@ The following query searches the `doors` bucket over the past 5 minutes and calc ```js from(bucket: "doors") |> range(start: -5m) - |> stateDuration(fn: (r) => r._value == "closed", column: "door_closed") + |> stateCount(fn: (r) => r._value == "closed", column: "door_closed") ``` This example stores the **state count** in the `door_closed` column. If you write data to the `doors` bucket every minute, the state count increases by `1` for each consecutive point where `_value` is `closed`. If `_value` is not `closed`, the state count is reset to `-1`. diff --git a/content/influxdb/v2.1/query-data/flux/monitor-states.md b/content/influxdb/v2.1/query-data/flux/monitor-states.md index 92268788a..6581ffaa7 100644 --- a/content/influxdb/v2.1/query-data/flux/monitor-states.md +++ b/content/influxdb/v2.1/query-data/flux/monitor-states.md @@ -105,7 +105,7 @@ The following query searches the `doors` bucket over the past 5 minutes and calc ```js from(bucket: "doors") |> range(start: -5m) - |> stateDuration(fn: (r) => r._value == "closed", column: "door_closed") + |> stateCount(fn: (r) => r._value == "closed", column: "door_closed") ``` This example stores the **state count** in the `door_closed` column. If you write data to the `doors` bucket every minute, the state count increases by `1` for each consecutive point where `_value` is `closed`. If `_value` is not `closed`, the state count is reset to `-1`. diff --git a/content/influxdb/v2.2/query-data/flux/monitor-states.md b/content/influxdb/v2.2/query-data/flux/monitor-states.md index 8b330621d..9786d7890 100644 --- a/content/influxdb/v2.2/query-data/flux/monitor-states.md +++ b/content/influxdb/v2.2/query-data/flux/monitor-states.md @@ -105,7 +105,7 @@ The following query searches the `doors` bucket over the past 5 minutes and calc ```js from(bucket: "doors") |> range(start: -5m) - |> stateDuration(fn: (r) => r._value == "closed", column: "door_closed") + |> stateCount(fn: (r) => r._value == "closed", column: "door_closed") ``` This example stores the **state count** in the `door_closed` column. If you write data to the `doors` bucket every minute, the state count increases by `1` for each consecutive point where `_value` is `closed`. If `_value` is not `closed`, the state count is reset to `-1`. diff --git a/content/influxdb/v2.3/query-data/flux/monitor-states.md b/content/influxdb/v2.3/query-data/flux/monitor-states.md index 6ddb18765..bc03597d6 100644 --- a/content/influxdb/v2.3/query-data/flux/monitor-states.md +++ b/content/influxdb/v2.3/query-data/flux/monitor-states.md @@ -105,7 +105,7 @@ The following query searches the `doors` bucket over the past 5 minutes and calc ```js from(bucket: "doors") |> range(start: -5m) - |> stateDuration(fn: (r) => r._value == "closed", column: "door_closed") + |> stateCount(fn: (r) => r._value == "closed", column: "door_closed") ``` This example stores the **state count** in the `door_closed` column. If you write data to the `doors` bucket every minute, the state count increases by `1` for each consecutive point where `_value` is `closed`. If `_value` is not `closed`, the state count is reset to `-1`.