Merge branch 'master' into clustered/install-reorg
commit
39fadc605f
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
title: influxdb.cardinality() function
|
title: influxdb.cardinality() function
|
||||||
description: >
|
description: >
|
||||||
`influxdb.cardinality()` returns the series cardinality of data stored in InfluxDB.
|
`influxdb.cardinality()` returns the series cardinality of data retrieved from InfluxDB.
|
||||||
menu:
|
menu:
|
||||||
flux_v0_ref:
|
flux_v0_ref:
|
||||||
name: influxdb.cardinality
|
name: influxdb.cardinality
|
||||||
|
@ -28,9 +28,16 @@ Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
|
||||||
|
|
||||||
------------------------------------------------------------------------------->
|
------------------------------------------------------------------------------->
|
||||||
|
|
||||||
`influxdb.cardinality()` returns the series cardinality of data stored in InfluxDB.
|
`influxdb.cardinality()` returns the series cardinality of data retrieved from InfluxDB.
|
||||||
|
|
||||||
|
|
||||||
|
{{% note %}}
|
||||||
|
Although this function is similar to InfluxQL's [`SHOW SERIES CARDINALITY`](/influxdb/v1/query_language/spec/#show-series-cardinality),
|
||||||
|
it works in a slightly different manner.
|
||||||
|
|
||||||
|
`influxdb.cardinality()` is time bounded and reports the cardinality of data that matches the conditions passed into it rather than that of the bucket as a whole.
|
||||||
|
{{% /note %}}
|
||||||
|
|
||||||
|
|
||||||
##### Function type signature
|
##### Function type signature
|
||||||
|
|
||||||
|
@ -107,6 +114,12 @@ The cardinality calculation excludes points that match the specified start time.
|
||||||
Use a relative duration or absolute time. For example, `-1h` or `2019-08-28T22:00:00Z`.
|
Use a relative duration or absolute time. For example, `-1h` or `2019-08-28T22:00:00Z`.
|
||||||
Durations are relative to `now()`. Default is `now()`.
|
Durations are relative to `now()`. Default is `now()`.
|
||||||
|
|
||||||
|
{{% note %}}
|
||||||
|
The default value is `now()`, so any points that have been written into the future will
|
||||||
|
not be counted unless a future `stop` date is provided.
|
||||||
|
{{% /note %}}
|
||||||
|
|
||||||
|
|
||||||
### predicate
|
### predicate
|
||||||
|
|
||||||
Predicate function that filters records.
|
Predicate function that filters records.
|
||||||
|
@ -120,15 +133,17 @@ Default is `(r) => true`.
|
||||||
- [Query series cardinality in a bucket](#query-series-cardinality-in-a-bucket)
|
- [Query series cardinality in a bucket](#query-series-cardinality-in-a-bucket)
|
||||||
- [Query series cardinality in a measurement//](#query-series-cardinality-in-a-measurement)
|
- [Query series cardinality in a measurement//](#query-series-cardinality-in-a-measurement)
|
||||||
- [Query series cardinality for a specific tag](#query-series-cardinality-for-a-specific-tag)
|
- [Query series cardinality for a specific tag](#query-series-cardinality-for-a-specific-tag)
|
||||||
|
- [Query series cardinality of Data Written In the Last 4 Hours](#query-series-cardinality-of-data-written-in-the-last-4-hours)
|
||||||
|
|
||||||
### Query series cardinality in a bucket
|
### Query series cardinality in a bucket
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import "influxdata/influxdb"
|
import "influxdata/influxdb"
|
||||||
|
|
||||||
influxdb.cardinality(bucket: "example-bucket", start: -1y)
|
influxdb.cardinality(bucket: "example-bucket", start: time(v: 1))
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Note: if points have been written into the future, you will need to add an appropriate `stop` date
|
||||||
|
|
||||||
|
|
||||||
### Query series cardinality in a measurement//
|
### Query series cardinality in a measurement//
|
||||||
|
@ -138,7 +153,7 @@ import "influxdata/influxdb"
|
||||||
|
|
||||||
influxdb.cardinality(
|
influxdb.cardinality(
|
||||||
bucket: "example-bucket",
|
bucket: "example-bucket",
|
||||||
start: -1y,
|
start: time(v: 1),
|
||||||
predicate: (r) => r._measurement == "example-measurement",
|
predicate: (r) => r._measurement == "example-measurement",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -150,7 +165,16 @@ influxdb.cardinality(
|
||||||
```js
|
```js
|
||||||
import "influxdata/influxdb"
|
import "influxdata/influxdb"
|
||||||
|
|
||||||
influxdb.cardinality(bucket: "example-bucket", start: -1y, predicate: (r) => r.exampleTag == "foo")
|
influxdb.cardinality(bucket: "example-bucket", start: time(v: 1), predicate: (r) => r.exampleTag == "foo")
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Query Cardinality of Data Written In the Last 4 hours
|
||||||
|
```js
|
||||||
|
import "influxdata/influxdb"
|
||||||
|
|
||||||
|
influxdb.cardinality(bucket: "example-bucket", start: -4h)
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1088,7 +1088,7 @@ Each InfluxDB Cloud organization has a series cardinality limit to prevent
|
||||||
runaway cardinality. For information about adjusting cardinality limits, see
|
runaway cardinality. For information about adjusting cardinality limits, see
|
||||||
[How do I increase my organization’s rate limits and quotas?](#how-do-i-increase-my-organizations-rate-limits-and-quotas).
|
[How do I increase my organization’s rate limits and quotas?](#how-do-i-increase-my-organizations-rate-limits-and-quotas).
|
||||||
|
|
||||||
{{% /oss-only %}}
|
{{% /cloud-only %}}
|
||||||
|
|
||||||
Use [`influxdb.cardinality()`](/flux/v0/stdlib/influxdata/influxdb/cardinality/) in Flux
|
Use [`influxdb.cardinality()`](/flux/v0/stdlib/influxdata/influxdb/cardinality/) in Flux
|
||||||
or [`SHOW SERIES CARDINALITY`](/influxdb/v1/query_language/spec/#show-series-cardinality)
|
or [`SHOW SERIES CARDINALITY`](/influxdb/v1/query_language/spec/#show-series-cardinality)
|
||||||
|
|
|
@ -920,11 +920,49 @@
|
||||||
aliases:
|
aliases:
|
||||||
- /influxdb/v2/reference/flux/stdlib/experimental/mqtt/
|
- /influxdb/v2/reference/flux/stdlib/experimental/mqtt/
|
||||||
- /influxdb/cloud/reference/flux/stdlib/experimental/mqtt/
|
- /influxdb/cloud/reference/flux/stdlib/experimental/mqtt/
|
||||||
|
prepend:
|
||||||
|
block: warn
|
||||||
|
content: |
|
||||||
|
#### Only supported in InfluxDB Cloud (TSM)
|
||||||
|
|
||||||
|
The `experimental/mqtt` package only supported in InfluxDB Cloud (TSM).
|
||||||
|
It is still available to import in InfluxDB OSS and Enterprise, but
|
||||||
|
functions will not successfully publish to an MQTT broker.
|
||||||
|
exclude_from:
|
||||||
|
nightly: true
|
||||||
|
oss: ^*
|
||||||
|
enterprise: ^*
|
||||||
|
|
||||||
/flux/v0/stdlib/experimental/mqtt/to.md: |
|
/flux/v0/stdlib/experimental/mqtt/to.md: |
|
||||||
aliases:
|
aliases:
|
||||||
- /influxdb/v2/reference/flux/stdlib/experimental/mqtt/to/
|
- /influxdb/v2/reference/flux/stdlib/experimental/mqtt/to/
|
||||||
- /influxdb/cloud/reference/flux/stdlib/experimental/mqtt/to/
|
- /influxdb/cloud/reference/flux/stdlib/experimental/mqtt/to/
|
||||||
|
prepend:
|
||||||
|
block: warn
|
||||||
|
content: |
|
||||||
|
#### Only supported in InfluxDB Cloud (TSM)
|
||||||
|
|
||||||
|
The `experimental/mqtt` package only supported in InfluxDB Cloud (TSM).
|
||||||
|
It is still available to import in InfluxDB OSS and Enterprise, but
|
||||||
|
functions will not successfully publish to an MQTT broker.
|
||||||
|
exclude_from:
|
||||||
|
nightly: true
|
||||||
|
oss: ^*
|
||||||
|
enterprise: ^*
|
||||||
|
|
||||||
|
/flux/v0/stdlib/experimental/mqtt/publish.md: |
|
||||||
|
prepend:
|
||||||
|
block: warn
|
||||||
|
content: |
|
||||||
|
#### Only supported in InfluxDB Cloud (TSM)
|
||||||
|
|
||||||
|
The `experimental/mqtt` package only supported in InfluxDB Cloud (TSM).
|
||||||
|
It is still available to import in InfluxDB OSS and Enterprise, but
|
||||||
|
functions will not successfully publish to an MQTT broker.
|
||||||
|
exclude_from:
|
||||||
|
nightly: true
|
||||||
|
oss: ^*
|
||||||
|
enterprise: ^*
|
||||||
|
|
||||||
/flux/v0/stdlib/experimental/oee/_index.md: |
|
/flux/v0/stdlib/experimental/oee/_index.md: |
|
||||||
aliases:
|
aliases:
|
||||||
|
|
|
@ -45,7 +45,8 @@
|
||||||
{{ $versionSemVer := split $value "." }}
|
{{ $versionSemVer := split $value "." }}
|
||||||
{{ $supported := cond (ge (index $versionSemVer 0) (index $introducedSemVer 0)) (cond (ge (index $versionSemVer 1) (index $introducedSemVer 1)) (cond (ge (index $versionSemVer 2) (index $introducedSemVer 2)) true false) false) false }}
|
{{ $supported := cond (ge (index $versionSemVer 0) (index $introducedSemVer 0)) (cond (ge (index $versionSemVer 1) (index $introducedSemVer 1)) (cond (ge (index $versionSemVer 2) (index $introducedSemVer 2)) true false) false) false }}
|
||||||
{{ $deprecated := and (isset $.Page.Params "deprecated") (cond (ge (index $versionSemVer 0) (index $deprecatedSemVer 0)) (cond (ge (index $versionSemVer 1) (index $deprecatedSemVer 1)) (cond (ge (index $versionSemVer 2) (index $deprecatedSemVer 2)) true false) false) false) }}
|
{{ $deprecated := and (isset $.Page.Params "deprecated") (cond (ge (index $versionSemVer 0) (index $deprecatedSemVer 0)) (cond (ge (index $versionSemVer 1) (index $deprecatedSemVer 1)) (cond (ge (index $versionSemVer 2) (index $deprecatedSemVer 2)) true false) false) false) }}
|
||||||
{{ $excluded := gt (len (findRE (string $excludePatternOSS) $key)) 0 }}
|
{{ $nightlyExcluded := and (eq $key "nightly") $.Page.Params.exclude_from.nightly }}
|
||||||
|
{{ $excluded := or (gt (len (findRE (string $excludePatternOSS) $key)) 0) $nightlyExcluded }}
|
||||||
<div class="version-row">
|
<div class="version-row">
|
||||||
<div class="version-col"><p>InfluxDB {{ $key }}</p></div>
|
<div class="version-col"><p>InfluxDB {{ $key }}</p></div>
|
||||||
<div class="version-col"><p>
|
<div class="version-col"><p>
|
||||||
|
|
Loading…
Reference in New Issue