diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
new file mode 100644
index 0000000..adb2bad
--- /dev/null
+++ b/.github/workflows/docs.yml
@@ -0,0 +1,45 @@
+# Simple workflow for deploying static content to GitHub Pages
+name: Deploy Flux docs to Pages
+
+on:
+ # Runs on pushes targeting the default branch
+ push:
+ branches: ["main"]
+ paths:
+ - docs/**
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+
+# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
+# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
+concurrency:
+ group: "pages"
+ cancel-in-progress: false
+
+jobs:
+ # Single deploy job since we're just deploying
+ deploy:
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ - name: Setup Pages
+ uses: actions/configure-pages@v3
+ - name: Upload artifact
+ uses: actions/upload-pages-artifact@v2
+ with:
+ # Upload entire repository
+ path: './docs'
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@v2
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index 71a374c..50821c9 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -51,7 +51,6 @@ jobs:
if: steps.cacheflux.outputs.cache-hit != 'true'
run: |
cd flux
- git checkout tags/v0.194.3
go mod tidy
go get ./...
make
diff --git a/README.md b/README.md
index f018237..abe4d40 100644
--- a/README.md
+++ b/README.md
@@ -2,23 +2,25 @@
[![Build-n-Release](https://github.com/metrico/fluXpipe/actions/workflows/go.yml/badge.svg)](https://github.com/metrico/fluXpipe/actions/workflows/go.yml)
-**FluxPipe** is an *experimental* stand-alone **Flux API** for *serverless workers* and *embedded datasources*
+**FluxPipe** is an *experimental* stand-alone **Flux API** for *serverless workers* and *embedded datasources*
+Execute your Flux scripts locally, in serverless functions or anywhere else - _decoupled from the data and database._
-> [Flux](https://github.com/InfluxCommunity/flux) is a lightweight *scripting language* for querying databases and working with data. [^1]
-
-Need a practical Flux introduction? Check out the [official page](https://www.influxdata.com/products/flux/) or [3 Minutes to Flux](flux.md)
+_Fluxpipe runs at 141,6Km/h_[*](https://en.wikipedia.org/wiki/DeLorean_time_machine#:~:text=Various%20proposals%20have%20been%20brought,speedometer%2C%20modified%20for%20the%20movie.) and is compatible with **InfluxDB 3.0 / IOx, ClickHouse, Grafana** and _beyond!_
+> InfluxDB [Flux](https://github.com/InfluxCommunity/flux) is a lightweight *scripting language* for querying databases and working with data. [^1]
+> Need a practical Flux introduction? Check out the [official page](https://www.influxdata.com/products/flux/) or [3 Minutes to Flux](flux.md)
+
### Demo
Try our [serverless demo](https://fluxpipe.fly.dev/) or launch your own instance to instantly fall in love with *flux*
-
-
+
+
### Instructions
Download a [binary release](https://github.com/metrico/fluxpipe/releases/), [docker](https://github.com/metrico/fluXpipe/pkgs/container/fluxpipe) or build from source
@@ -56,7 +58,56 @@ Fluxpipe embeds a playground interface to instantly execute queries _(borrowed f
Fluxpipe serves a simple REST API loosely compatible with existing flux integrations and clients
##### Grafana Flux [^1]
-Usage with native **Grafana InfluxDB/Flux datasource** _(url + organization fields are required!)_
+Fluxpipe is compatible with the native **Grafana InfluxDB/Flux datasource** _(url + organization fields are required!)_
+
+
+
+##### ⭐ FlightSQL
+###### SQL
+You can query InfluxDB 3.0 IOx with raw SQL using the native `sql.from` handler
+```
+import "sql"
+
+sql.from(
+ driverName: "influxdb-iox",
+ dataSourceName: "iox://iox-server:443/qryn_logs",
+ query: "SELECT level, sender, body FROM logs WHERE body LIKE '%DELETE%' limit 10",
+)
+```
+
+![image](https://github.com/metrico/fluXpipe/assets/1423657/b6c2dcbe-079b-4329-9fee-a8601a8c853c)
+
+
+###### Flux
+You can query InfluxDB 3.0 IOx with Flux using the `iox.from` handler
+```
+> import "contrib/qxip/iox"
+ iox.from(
+ bucket: "test",
+ host: "eu-central-1-1.aws.cloud2.influxdata.com:443",
+ token: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+ limit: "10",
+ columns: "time, level, sender",
+ table: "logs",
+ start: -100d,
+ )
+```
+```
+ _time:time level:string sender:string
+------------------------------ ---------------------- ----------------------
+2023-08-31T00:00:00.091362490Z info logtest
+2023-08-31T00:00:00.091380034Z info logtest
+2023-08-31T00:00:00.091381374Z info logtest
+2023-08-31T00:00:00.091382470Z info logtest
+2023-08-31T00:00:00.091383354Z info logtest
+2023-08-31T00:00:00.091384514Z info logtest
+2023-08-31T00:00:00.091385496Z info logtest
+2023-08-31T00:00:00.091387718Z info logtest
+2023-08-31T00:00:00.091389187Z info logtest
+2023-08-31T00:00:00.091390136Z info logtest
+```
+
+
###### ⭐ ClickHouse SQL
```
@@ -153,7 +204,15 @@ cat scripts/sql.flux | ./fluxpipe-server -stdin
### Grafana Datasource
Configure your Grafana instance with our public demo endpoint _(limited resources)_
-![image](https://user-images.githubusercontent.com/1423657/185748494-0c6a95da-d112-46ab-b9db-b09438b63740.png)
+![image](https://github.com/metrico/fluXpipe/assets/1423657/c100050a-49a6-4788-86af-15eb7e59c5d1)
+
+
+
+### Documentation
+**Flux**(pipe) is built using the [InfluxCommunity/flux](https://github.com/InfluxCommunity/flux) fork which contains additional features and contributions.
+All the standard and additional functions available in Fluxpipe are included in the [Flux community documentation](https://metrico.github.io/fluXpipe/)
+
+
#### Status
diff --git a/build.sh b/build.sh
index 02c4db3..15974ea 100755
--- a/build.sh
+++ b/build.sh
@@ -1,4 +1,8 @@
#!/bin/sh
+
+# WARNING:
+# Make sure you have a complete flux build at `/usr/src/flux`
+
export PKG_CONFIG_PATH=$(pwd)
echo "Building fluxpipe-server ..."
diff --git a/docs/README.md b/docs/README.md
new file mode 100644
index 0000000..0867125
--- /dev/null
+++ b/docs/README.md
@@ -0,0 +1,13 @@
+![logo](https://user-images.githubusercontent.com/1423657/231777629-38f9c8f5-7968-4ff3-ae66-2fd2459ffa69.png ':size=200')
+
+# Flux Community Documentation
+
+Flux is an open source functional data scripting language designed for querying, analyzing, and acting on data. Flux supports multiple data source types, including:
+
+- Time series databases _(such as InfluxDB and IOx)_
+- Relational SQL databases _(such as MySQL, PostgreSQL, ClickHouse, etc)_
+- Local Files or Object Storage Data _(such as CSV, TSV, JSON, etc)_
+
+Flux unifies code for querying, processing, writing, and acting on data into a single syntax.
+
+The language is designed to be usable, readable, flexible, composable, testable, contributable, and shareable.
diff --git a/docs/_sidebar.md b/docs/_sidebar.md
new file mode 100644
index 0000000..ab10f87
--- /dev/null
+++ b/docs/_sidebar.md
@@ -0,0 +1,124 @@
+##
+
+- array
+ - [array](array.md)
+- bitwise
+ - [bitwise](bitwise.md)
+- contrib
+ - [naiveBayesClassifier](contrib/RohanSreerama5/naiveBayesClassifier.md)
+ - [anomalydetection](contrib/anaisdg/anomalydetection.md)
+ - [statsmodels](contrib/anaisdg/statsmodels.md)
+ - [alerta](contrib/bonitoo-io/alerta.md)
+ - [hex](contrib/bonitoo-io/hex.md)
+ - [servicenow](contrib/bonitoo-io/servicenow.md)
+ - [tickscript](contrib/bonitoo-io/tickscript.md)
+ - [victorops](contrib/bonitoo-io/victorops.md)
+ - [zenoss](contrib/bonitoo-io/zenoss.md)
+ - [discord](contrib/chobbs/discord.md)
+ - [influxdb](contrib/jsternberg/influxdb.md)
+ - [clickhouse](contrib/qxip/clickhouse.md)
+ - [hash](contrib/qxip/hash.md)
+ - [iox](contrib/qxip/iox.md)
+ - [logql](contrib/qxip/logql.md)
+ - [bigpanda](contrib/rhajek/bigpanda.md)
+ - [opsgenie](contrib/sranka/opsgenie.md)
+ - [sensu](contrib/sranka/sensu.md)
+ - [teams](contrib/sranka/teams.md)
+ - [telegram](contrib/sranka/telegram.md)
+ - [webexteams](contrib/sranka/webexteams.md)
+ - [events](contrib/tomhollingworth/events.md)
+- csv
+ - [csv](csv.md)
+- date
+ - [date](date.md)
+ - [boundaries](date/boundaries.md)
+- dict
+ - [dict](dict.md)
+- experimental
+ - [experimental](experimental.md)
+ - [aggregate](experimental/aggregate.md)
+ - [array](experimental/array.md)
+ - [bigtable](experimental/bigtable.md)
+ - [bitwise](experimental/bitwise.md)
+ - [csv](experimental/csv.md)
+ - [boundaries](experimental/date/boundaries.md)
+ - [dynamic](experimental/dynamic.md)
+ - [geo](experimental/geo.md)
+ - [http](experimental/http.md)
+ - [requests](experimental/http/requests.md)
+ - [influxdb](experimental/influxdb.md)
+ - [iox](experimental/iox.md)
+ - [json](experimental/json.md)
+ - [mqtt](experimental/mqtt.md)
+ - [oee](experimental/oee.md)
+ - [polyline](experimental/polyline.md)
+ - [prometheus](experimental/prometheus.md)
+ - [query](experimental/query.md)
+ - [record](experimental/record.md)
+ - [table](experimental/table.md)
+ - [usage](experimental/usage.md)
+- generate
+ - [generate](generate.md)
+- http
+ - [http](http.md)
+ - [requests](http/requests.md)
+- influxdata
+ - [influxdb](influxdata/influxdb.md)
+ - [monitor](influxdata/influxdb/monitor.md)
+ - [sample](influxdata/influxdb/sample.md)
+ - [schema](influxdata/influxdb/schema.md)
+ - [secrets](influxdata/influxdb/secrets.md)
+ - [tasks](influxdata/influxdb/tasks.md)
+ - [v1](influxdata/influxdb/v1.md)
+- internal
+ - [boolean](internal/boolean.md)
+ - [debug](internal/debug.md)
+ - [gen](internal/gen.md)
+ - [influxql](internal/influxql.md)
+ - [location](internal/location.md)
+ - [promql](internal/promql.md)
+ - [testing](internal/testing.md)
+ - [testutil](internal/testutil.md)
+- interpolate
+ - [interpolate](interpolate.md)
+- join
+ - [join](join.md)
+- json
+ - [json](json.md)
+- kafka
+ - [kafka](kafka.md)
+- math
+ - [math](math.md)
+- pagerduty
+ - [pagerduty](pagerduty.md)
+- planner
+ - [planner](planner.md)
+- profiler
+ - [profiler](profiler.md)
+- pushbullet
+ - [pushbullet](pushbullet.md)
+- regexp
+ - [regexp](regexp.md)
+- runtime
+ - [runtime](runtime.md)
+- sampledata
+ - [sampledata](sampledata.md)
+- slack
+ - [slack](slack.md)
+- socket
+ - [socket](socket.md)
+- sql
+ - [sql](sql.md)
+- strings
+ - [strings](strings.md)
+- system
+ - [system](system.md)
+- testing
+ - [testing](testing.md)
+ - [expect](testing/expect.md)
+- timezone
+ - [timezone](timezone.md)
+- types
+ - [types](types.md)
+- universe
+ - [universe](universe.md)
diff --git a/docs/array.md b/docs/array.md
new file mode 100644
index 0000000..7c88ee9
--- /dev/null
+++ b/docs/array.md
@@ -0,0 +1,78 @@
+## `array` package
+
+Package array provides functions for manipulating array and building tables from arrays.
+
+Import the `array` package:
+
+```flux
+import "array"
+```
+
+### Functions
+
+### `concat()`
+
+concat appends two arrays and returns a new array.
+
+#### Function type signature
+
+```flux
+(<-arr: [A], v: [A]) => [A]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| arr | arr: First array. Default is the piped-forward array (`<-`). | No |
+| v | v: Array to append to the first array. | Yes |
+### `filter()`
+
+filter iterates over an array, evaluates each element with a predicate function, and then returns
+a new array with only elements that match the predicate.
+
+#### Function type signature
+
+```flux
+(<-arr: [A], fn: (x: A) => bool) => [A]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| arr | arr: Array to filter. Default is the piped-forward array (`<-`). | No |
+| fn | fn: Predicate function to evaluate on each element.
+ The element is represented by `x` in the predicate function. | Yes |
+### `from()`
+
+from constructs a table from an array of records.
+
+#### Function type signature
+
+```flux
+(<-rows: [A]) => stream[A] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| rows | rows: Array of records to construct a table with. Default is the piped-forward array (`<-`). | No |
+### `map()`
+
+map iterates over an array, applies a function to each element to produce a new element,
+and then returns a new array.
+
+#### Function type signature
+
+```flux
+(<-arr: [A], fn: (x: A) => B) => [B]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| arr | arr: Array to operate on. Defaults is the piped-forward array (`<-`). | No |
+| fn | fn: Function to apply to elements. The element is represented by `x` in the function. | Yes |
diff --git a/docs/bitwise.md b/docs/bitwise.md
new file mode 100644
index 0000000..ce1acfb
--- /dev/null
+++ b/docs/bitwise.md
@@ -0,0 +1,239 @@
+## `bitwise` package
+
+Package bitwise provides functions for performing bitwise operations on integers.
+
+Import the `bitwise` package:
+
+```flux
+import "bitwise"
+```
+
+### Functions
+
+### `sand()`
+
+sand performs the bitwise operation, `a AND b`, with integers.
+
+#### Function type signature
+
+```flux
+(a: int, b: int) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Right hand operand. | Yes |
+### `sclear()`
+
+sclear performs the bitwise operation `a AND NOT b`.
+Both `a` and `b` are integers.
+
+#### Function type signature
+
+```flux
+(a: int, b: int) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Bits to clear. | Yes |
+### `slshift()`
+
+slshift shifts the bits in `a` left by `b` bits.
+Both `a` and `b` are integers.
+
+#### Function type signature
+
+```flux
+(a: int, b: int) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Number of bits to shift. | Yes |
+### `snot()`
+
+snot inverts every bit in `a`, an integer.
+
+#### Function type signature
+
+```flux
+(a: int) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Integer to invert. | Yes |
+### `sor()`
+
+sor performs the bitwise operation, `a OR b`, with integers.
+
+#### Function type signature
+
+```flux
+(a: int, b: int) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Right hand operand. | Yes |
+### `srshift()`
+
+srshift shifts the bits in `a` right by `b` bits.
+Both `a` and `b` are integers.
+
+#### Function type signature
+
+```flux
+(a: int, b: int) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Number of bits to shift. | Yes |
+### `sxor()`
+
+sxor performs the bitwise operation, `a XOR b`, with integers.
+
+#### Function type signature
+
+```flux
+(a: int, b: int) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Right hand operand. | Yes |
+### `uand()`
+
+uand performs the bitwise operation, `a AND b`, with unsigned integers.
+
+#### Function type signature
+
+```flux
+(a: uint, b: uint) => uint
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Right hand operand. | Yes |
+### `uclear()`
+
+uclear performs the bitwise operation `a AND NOT b`, with unsigned integers.
+
+#### Function type signature
+
+```flux
+(a: uint, b: uint) => uint
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Bits to clear. | Yes |
+### `ulshift()`
+
+ulshift shifts the bits in `a` left by `b` bits.
+Both `a` and `b` are unsigned integers.
+
+#### Function type signature
+
+```flux
+(a: uint, b: uint) => uint
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Number of bits to shift. | Yes |
+### `unot()`
+
+unot inverts every bit in `a`, an unsigned integer.
+
+#### Function type signature
+
+```flux
+(a: uint) => uint
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Unsigned integer to invert. | Yes |
+### `uor()`
+
+uor performs the bitwise operation, `a OR b`, with unsigned integers.
+
+#### Function type signature
+
+```flux
+(a: uint, b: uint) => uint
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Right hand operand. | Yes |
+### `urshift()`
+
+urshift shifts the bits in `a` right by `b` bits.
+Both `a` and `b` are unsigned integers.
+
+#### Function type signature
+
+```flux
+(a: uint, b: uint) => uint
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Number of bits to shift. | Yes |
+### `uxor()`
+
+uxor performs the bitwise operation, `a XOR b`, with unsigned integers.
+
+#### Function type signature
+
+```flux
+(a: uint, b: uint) => uint
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Right hand operand. | Yes |
diff --git a/docs/contrib/RohanSreerama5/naiveBayesClassifier.md b/docs/contrib/RohanSreerama5/naiveBayesClassifier.md
new file mode 100644
index 0000000..b7f7f9a
--- /dev/null
+++ b/docs/contrib/RohanSreerama5/naiveBayesClassifier.md
@@ -0,0 +1,36 @@
+## `naiveBayesClassifier` package
+
+Package naiveBayesClassifier provides an implementation of
+a naive Bayes classifier.
+
+Import the `naiveBayesClassifier` package:
+
+```flux
+import "naiveBayesClassifier"
+```
+
+### Functions
+
+### `naiveBayes()`
+
+naiveBayes performs a naive Bayes classification.
+
+#### Function type signature
+
+```flux
+(
+ <-tables: stream[{C with _time: time, _measurement: E, _field: D}],
+ myClass: string,
+ myField: A,
+ myMeasurement: B,
+) => stream[F] where A: Equatable, B: Equatable, D: Equatable, E: Equatable, F: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| myMeasurement | myMeasurement: Measurement to use as training data. | Yes |
+| myField | myField: Field to use as training data. | Yes |
+| myClass | myClass: Class to classify against. | Yes |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
diff --git a/docs/contrib/anaisdg/anomalydetection.md b/docs/contrib/anaisdg/anomalydetection.md
new file mode 100644
index 0000000..9b4f4c8
--- /dev/null
+++ b/docs/contrib/anaisdg/anomalydetection.md
@@ -0,0 +1,28 @@
+## `anomalydetection` package
+
+Package anomalydetection detects anomalies in time series data.
+
+Import the `anomalydetection` package:
+
+```flux
+import "anomalydetection"
+```
+
+### Functions
+
+### `mad()`
+
+mad uses the median absolute deviation (MAD) algorithm to detect anomalies in a data set.
+
+#### Function type signature
+
+```flux
+(<-table: stream[B], ?threshold: A) => stream[{C with level: string, _value_diff_med: D, _value_diff: D, _value: D}] where A: Comparable + Equatable, B: Record, D: Comparable + Divisible + Equatable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| threshold | threshold: Deviation threshold for anomalies. | No |
+| table | table: Input data. Default is piped-forward data (`<-`). | No |
diff --git a/docs/contrib/anaisdg/statsmodels.md b/docs/contrib/anaisdg/statsmodels.md
new file mode 100644
index 0000000..5c6a20b
--- /dev/null
+++ b/docs/contrib/anaisdg/statsmodels.md
@@ -0,0 +1,41 @@
+## `statsmodels` package
+
+Package statsmodels provides functions for calculating statistical models.
+
+Import the `statsmodels` package:
+
+```flux
+import "statsmodels"
+```
+
+### Functions
+
+### `linearRegression()`
+
+linearRegression performs a linear regression.
+
+#### Function type signature
+
+```flux
+(
+ <-tables: stream[A],
+) => stream[{
+ B with
+ y_hat: float,
+ y: float,
+ x: float,
+ sy: H,
+ sxy: G,
+ sxx: F,
+ sx: E,
+ slope: D,
+ errors: float,
+ N: C,
+}] where A: Record, D: Divisible + Subtractable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
diff --git a/docs/contrib/bonitoo-io/alerta.md b/docs/contrib/bonitoo-io/alerta.md
new file mode 100644
index 0000000..7b1d752
--- /dev/null
+++ b/docs/contrib/bonitoo-io/alerta.md
@@ -0,0 +1,98 @@
+## `alerta` package
+
+Package alerta provides functions that send alerts to [Alerta](https://alerta.io/).
+
+Import the `alerta` package:
+
+```flux
+import "alerta"
+```
+
+### Functions
+
+### `alert()`
+
+alert sends an alert to [Alerta](https://alerta.io/).
+
+#### Function type signature
+
+```flux
+(
+ apiKey: string,
+ attributes: A,
+ event: B,
+ resource: C,
+ severity: D,
+ url: string,
+ ?environment: E,
+ ?group: F,
+ ?origin: G,
+ ?service: H,
+ ?tags: I,
+ ?text: J,
+ ?timestamp: K,
+ ?type: L,
+ ?value: M,
+) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: (Required) Alerta URL. | Yes |
+| apiKey | apiKey: (Required) Alerta API key. | Yes |
+| resource | resource: (Required) Resource associated with the alert. | Yes |
+| event | event: (Required) Event name. | Yes |
+| environment | environment: Alerta environment. Valid values: "Production", "Development" or empty string (default). | No |
+| severity | severity: (Required) Event severity. See [Alerta severities](https://docs.alerta.io/en/latest/api/alert.html#alert-severities). | Yes |
+| service | service: List of affected services. Default is `[]`. | No |
+| group | group: Alerta event group. Default is `""`. | No |
+| value | value: Event value. Default is `""`. | No |
+| text | text: Alerta text description. Default is `""`. | No |
+| tags | tags: List of event tags. Default is `[]`. | No |
+| attributes | attributes: (Required) Alert attributes. | Yes |
+| origin | origin: monitoring component. | No |
+| type | type: Event type. Default is `""`. | No |
+| timestamp | timestamp: time alert was generated. Default is `now()`. | No |
+### `endpoint()`
+
+endpoint sends alerts to Alerta using data from input rows.
+
+#### Function type signature
+
+```flux
+(
+ apiKey: string,
+ url: string,
+ ?environment: A,
+ ?origin: B,
+) => (
+ mapFn: (
+ r: C,
+ ) => {
+ D with
+ value: O,
+ type: N,
+ timestamp: M,
+ text: L,
+ tags: K,
+ severity: J,
+ service: I,
+ resource: H,
+ group: G,
+ event: F,
+ attributes: E,
+ },
+) => (<-tables: stream[C]) => stream[{C with _sent: string}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: (Required) Alerta URL. | Yes |
+| apiKey | apiKey: (Required) Alerta API key. | Yes |
+| environment | environment: Alert environment. Default is `""`.
+ Valid values: "Production", "Development", or empty string (default). | No |
+| origin | origin: Alert origin. Default is `"InfluxDB"`. | No |
diff --git a/docs/contrib/bonitoo-io/hex.md b/docs/contrib/bonitoo-io/hex.md
new file mode 100644
index 0000000..dfd06e4
--- /dev/null
+++ b/docs/contrib/bonitoo-io/hex.md
@@ -0,0 +1,73 @@
+## `hex` package
+
+Package hex provides functions that perform hexadecimal conversion
+of `int`, `uint` or `bytes` values to and from `string` values.
+
+Import the `hex` package:
+
+```flux
+import "hex"
+```
+
+### Functions
+
+### `bytes()`
+
+bytes converts a hexadecimal string to bytes.
+
+#### Function type signature
+
+```flux
+(v: string) => bytes
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| v | v: String to convert. | Yes |
+### `int()`
+
+int converts a hexadecimal string to an integer.
+
+#### Function type signature
+
+```flux
+(v: string) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| v | v: String to convert. | Yes |
+### `string()`
+
+string converts a Flux basic type to a hexadecimal string.
+
+#### Function type signature
+
+```flux
+(v: A) => string
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| v | v: Value to convert. | Yes |
+### `uint()`
+
+uint converts a hexadecimal string to an unsigned integer.
+
+#### Function type signature
+
+```flux
+(v: string) => uint
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| v | v: String to convert. | Yes |
diff --git a/docs/contrib/bonitoo-io/servicenow.md b/docs/contrib/bonitoo-io/servicenow.md
new file mode 100644
index 0000000..1961a3b
--- /dev/null
+++ b/docs/contrib/bonitoo-io/servicenow.md
@@ -0,0 +1,93 @@
+## `servicenow` package
+
+Package servicenow provides functions for sending events to [ServiceNow](https://www.servicenow.com/).
+
+Import the `servicenow` package:
+
+```flux
+import "servicenow"
+```
+
+### Functions
+
+### `endpoint()`
+
+endpoint sends events to [ServiceNow](https://servicenow.com/) using data from input rows.
+
+#### Function type signature
+
+```flux
+(
+ password: string,
+ url: string,
+ username: string,
+ ?source: A,
+) => (
+ mapFn: (
+ r: B,
+ ) => {
+ C with
+ severity: J,
+ resource: I,
+ node: H,
+ metricType: G,
+ metricName: F,
+ messageKey: E,
+ description: D,
+ },
+) => (<-tables: stream[B]) => stream[{B with _sent: string}] where J: Equatable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: ServiceNow web service URL. | Yes |
+| username | username: ServiceNow username to use for HTTP BASIC authentication. | Yes |
+| password | password: ServiceNow password to use for HTTP BASIC authentication. | Yes |
+| source | source: Source name. Default is `"Flux"`. | No |
+### `event()`
+
+event sends an event to [ServiceNow](https://servicenow.com/).
+
+#### Function type signature
+
+```flux
+(
+ description: A,
+ password: string,
+ severity: B,
+ url: string,
+ username: string,
+ ?additionalInfo: C,
+ ?messageKey: D,
+ ?metricName: E,
+ ?metricType: F,
+ ?node: G,
+ ?resource: H,
+ ?source: I,
+) => int where B: Equatable, C: Equatable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: ServiceNow web service URL. | Yes |
+| username | username: ServiceNow username to use for HTTP BASIC authentication. | Yes |
+| password | password: ServiceNow password to use for HTTP BASIC authentication. | Yes |
+| description | description: Event description. | Yes |
+| severity | severity: Severity of the event. | Yes |
+| source | source: Source name. Default is `"Flux"`. | No |
+| node | node: Node name or IP address related to the event.
+ Default is an empty string (`""`). | No |
+| metricType | metricType: Metric type related to the event (for example, `CPU`).
+ Default is an empty string (`""`). | No |
+| resource | resource: Resource related to the event (for example, `CPU-1`).
+ Default is an empty string (`""`). | No |
+| metricName | metricName: Metric name related to the event (for example, `usage_idle`).
+ Default is an empty string (`""`). | No |
+| messageKey | messageKey: Unique identifier of the event (for example, the InfluxDB alert ID).
+ Default is an empty string (`""`).
+ If an empty string, ServiceNow generates a value. | No |
+| additionalInfo | additionalInfo: Additional information to include with the event. | No |
diff --git a/docs/contrib/bonitoo-io/tickscript.md b/docs/contrib/bonitoo-io/tickscript.md
new file mode 100644
index 0000000..c4d1c5d
--- /dev/null
+++ b/docs/contrib/bonitoo-io/tickscript.md
@@ -0,0 +1,260 @@
+## `tickscript` package
+
+Package tickscript provides functions to help migrate
+Kapacitor [TICKscripts](https://docs.influxdata.com/kapacitor/latest/tick/) to Flux tasks.
+
+Import the `tickscript` package:
+
+```flux
+import "tickscript"
+```
+
+### Functions
+
+### `alert()`
+
+alert identifies events of varying severity levels
+and writes them to the `statuses` measurement in the InfluxDB `_monitoring`
+system bucket.
+
+#### Function type signature
+
+```flux
+(
+ <-tables: stream[M],
+ check: {A with tags: E, _type: D, _check_name: C, _check_id: B},
+ ?crit: (r: {F with _time: H, _measurement: G}) => bool,
+ ?details: (r: {I with id: J, _check_name: C, _check_id: B}) => K,
+ ?id: (r: {I with _check_name: C, _check_id: B}) => J,
+ ?info: (r: {F with _time: H, _measurement: G}) => bool,
+ ?message: (
+ r: {
+ F with
+ _type: D,
+ _time: H,
+ _time: time,
+ _source_timestamp: int,
+ _source_measurement: G,
+ _measurement: G,
+ _measurement: string,
+ _level: string,
+ _check_name: C,
+ _check_id: B,
+ },
+ ) => L,
+ ?ok: (r: {F with _time: H, _measurement: G}) => bool,
+ ?topic: string,
+ ?warn: (r: {F with _time: H, _measurement: G}) => bool,
+) => stream[{
+ F with
+ _type: D,
+ _time: H,
+ _time: time,
+ _source_timestamp: int,
+ _source_measurement: G,
+ _message: L,
+ _measurement: G,
+ _measurement: string,
+ _level: string,
+ _check_name: C,
+ _check_id: B,
+}] where E: Record, I: Record, M: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| check | check: InfluxDB check data.
+ See `tickscript.defineCheck()`. | Yes |
+| id | id: Function that returns the InfluxDB check ID provided by the check record.
+ Default is `(r) => "${r._check_id}"`. | No |
+| details | details: Function to return the InfluxDB check details using data from input rows.
+ Default is `(r) => ""`. | No |
+| message | message: Function to return the InfluxDB check message using data from input rows.
+ Default is `(r) => "Threshold Check: ${r._check_name} is: ${r._level}"`. | No |
+| crit | crit: Predicate function to determine `crit` status. Default is `(r) => false`. | No |
+| warn | warn: Predicate function to determine `warn` status. Default is `(r) => false`. | No |
+| info | info: Predicate function to determine `info` status. Default is `(r) => false`. | No |
+| ok | ok: Predicate function to determine `ok` status. Default is `(r) => true`. | No |
+| topic | topic: Check topic. Default is `""`. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `compute()`
+
+compute is an alias for `tickscript.select()` that changes a column’s name and
+optionally applies an aggregate or selector function.
+
+#### Function type signature
+
+```flux
+(<-tables: B, as: string, ?column: A, ?fn: (<-: B, column: A) => stream[C]) => stream[D] where A: Equatable, C: Record, D: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| as | as: New column name. | Yes |
+| column | column: Column to operate on. Default is `_value`. | No |
+| fn | fn: Aggregate or selector function to apply. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `deadman()`
+
+deadman detects low data throughput and writes a point with a critical status to
+the InfluxDB `_monitoring` system bucket.
+
+#### Function type signature
+
+```flux
+(
+ <-tables: stream[M],
+ check: {A with tags: E, _type: D, _check_name: C, _check_id: B},
+ measurement: string,
+ ?id: (r: {F with _check_name: C, _check_id: B}) => G,
+ ?message: (
+ r: {
+ H with
+ dead: bool,
+ _type: D,
+ _time: J,
+ _time: time,
+ _source_timestamp: int,
+ _source_measurement: I,
+ _measurement: I,
+ _measurement: string,
+ _level: string,
+ _check_name: C,
+ _check_id: B,
+ },
+ ) => K,
+ ?threshold: L,
+ ?topic: string,
+) => stream[{
+ H with
+ dead: bool,
+ _type: D,
+ _time: J,
+ _time: time,
+ _source_timestamp: int,
+ _source_measurement: I,
+ _message: K,
+ _measurement: I,
+ _measurement: string,
+ _level: string,
+ _check_name: C,
+ _check_id: B,
+}] where E: Record, F: Record, L: Comparable + Equatable, M: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| check | check: InfluxDB check data. See `tickscript.defineCheck()`. | Yes |
+| measurement | measurement: Measurement name. Should match the queried measurement. | Yes |
+| threshold | threshold: Count threshold. Default is `0`. | No |
+| id | id: Function that returns the InfluxDB check ID provided by the check record.
+ Default is `(r) => "${r._check_id}"`. | No |
+| message | message: Function that returns the InfluxDB check message using data from input rows.
+ Default is `(r) => "Deadman Check: ${r._check_name} is: " + (if r.dead then "dead" else "alive")`. | No |
+| topic | topic: Check topic. Default is `""`. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `defineCheck()`
+
+defineCheck creates custom check data required by `alert()` and `deadman()`.
+
+#### Function type signature
+
+```flux
+(id: A, name: B, ?type: C) => {tags: {}, _type: C, _check_name: B, _check_id: A}
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| id | id: InfluxDB check ID. | Yes |
+| name | name: InfluxDB check name. | Yes |
+| type | type: InfluxDB check type. Default is `custom`. | No |
+### `groupBy()`
+
+groupBy groups results by the `_measurement` column and other specified columns.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[A], columns: [string]) => stream[A] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| columns | columns: List of columns to group by. | Yes |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `join()`
+
+join merges two input streams into a single output stream
+based on specified columns with equal values and appends a new measurement name.
+
+#### Function type signature
+
+```flux
+(measurement: A, tables: B, ?on: [string]) => stream[{C with _measurement: A}] where B: Record, C: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Map of two streams to join. | Yes |
+| on | on: List of columns to join on. Default is `["_time"]`. | No |
+| measurement | measurement: Measurement name to use in results. | Yes |
+### `select()`
+
+select changes a column’s name and optionally applies an aggregate or selector
+function to values in the column.
+
+#### Function type signature
+
+```flux
+(<-tables: B, as: string, ?column: A, ?fn: (<-: B, column: A) => stream[C]) => stream[D] where A: Equatable, C: Record, D: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| column | column: Column to operate on. Default is `_value`. | No |
+| fn | fn: Aggregate or selector function to apply. | No |
+| as | as: New column name. | Yes |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `selectWindow()`
+
+selectWindow changes a column’s name, windows rows by time, and then applies an
+aggregate or selector function the specified column for each window of time.
+
+#### Function type signature
+
+```flux
+(
+ <-tables: stream[D],
+ as: string,
+ defaultValue: A,
+ every: duration,
+ fn: (<-: stream[B], column: string) => stream[C],
+ ?column: string,
+) => stream[E] where B: Record, C: Record, D: Record, E: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| column | column: Column to operate on. Default is _value. | No |
+| fn | fn: Aggregate or selector function to apply. | Yes |
+| as | as: New column name. | Yes |
+| every | every: Duration of windows. | Yes |
+| defaultValue | defaultValue: Default fill value for null values in column.
+ Must be the same data type as column. | Yes |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
diff --git a/docs/contrib/bonitoo-io/victorops.md b/docs/contrib/bonitoo-io/victorops.md
new file mode 100644
index 0000000..797881d
--- /dev/null
+++ b/docs/contrib/bonitoo-io/victorops.md
@@ -0,0 +1,72 @@
+## `victorops` package
+
+Package victorops provides functions that send events to [VictorOps](https://victorops.com/).
+
+Import the `victorops` package:
+
+```flux
+import "victorops"
+```
+
+### Functions
+
+### `alert()`
+
+alert sends an alert to VictorOps.
+
+#### Function type signature
+
+```flux
+(
+ messageType: A,
+ url: string,
+ ?entityDisplayName: B,
+ ?entityID: C,
+ ?monitoringTool: D,
+ ?stateMessage: E,
+ ?timestamp: F,
+) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: VictorOps REST endpoint integration URL. | Yes |
+| monitoringTool | monitoringTool: Monitoring agent name. Default is `""`. | No |
+| messageType | messageType: VictorOps message type (alert behavior). | Yes |
+| entityID | entityID: Incident ID. Default is `""`. | No |
+| entityDisplayName | entityDisplayName: Incident display name or summary. Default is `""`. | No |
+| stateMessage | stateMessage: Verbose incident message. Default is `""`. | No |
+| timestamp | timestamp: Incident start time. Default is `now()`. | No |
+### `endpoint()`
+
+endpoint sends events to VictorOps using data from input rows.
+
+#### Function type signature
+
+```flux
+(
+ url: string,
+ ?monitoringTool: A,
+) => (
+ mapFn: (
+ r: B,
+ ) => {
+ C with
+ timestamp: H,
+ stateMessage: G,
+ messageType: F,
+ entityID: E,
+ entityDisplayName: D,
+ },
+) => (<-tables: stream[B]) => stream[{B with _sent: string}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: VictorOps REST endpoint integration URL. | Yes |
+| monitoringTool | monitoringTool: Tool to use for monitoring.
+ Default is `InfluxDB`. | No |
diff --git a/docs/contrib/bonitoo-io/zenoss.md b/docs/contrib/bonitoo-io/zenoss.md
new file mode 100644
index 0000000..d92a905
--- /dev/null
+++ b/docs/contrib/bonitoo-io/zenoss.md
@@ -0,0 +1,124 @@
+## `zenoss` package
+
+Package zenoss provides functions that send events to [Zenoss](https://www.zenoss.com/).
+
+Import the `zenoss` package:
+
+```flux
+import "zenoss"
+```
+
+### Functions
+
+### `endpoint()`
+
+endpoint sends events to Zenoss using data from input rows.
+
+#### Function type signature
+
+```flux
+(
+ url: string,
+ ?action: A,
+ ?apiKey: B,
+ ?method: C,
+ ?password: string,
+ ?tid: D,
+ ?type: E,
+ ?username: string,
+) => (
+ mapFn: (
+ r: F,
+ ) => {
+ G with
+ summary: O,
+ severity: N,
+ message: M,
+ eventClassKey: L,
+ eventClass: K,
+ device: J,
+ component: I,
+ collector: H,
+ },
+) => (<-tables: stream[F]) => stream[{F with _sent: string}] where B: Equatable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: Zenoss [router endpoint URL](https://help.zenoss.com/zsd/RM/configuring-resource-manager/enabling-access-to-browser-interfaces/creating-and-changing-public-endpoints). | Yes |
+| username | username: Zenoss username to use for HTTP BASIC authentication.
+ Default is `""` (no authentication). | No |
+| password | password: Zenoss password to use for HTTP BASIC authentication.
+ Default is `""` (no authentication). | No |
+| apiKey | apiKey: Zenoss cloud API key.
+ Default is `""` (no API key). | No |
+| action | action: Zenoss router name.
+ Default is `"EventsRouter"`. | No |
+| method | method: EventsRouter method.
+ Default is `"add_event"`. | No |
+| type | type: Event type. Default is `"rpc"`. | No |
+| tid | tid: Temporary request transaction ID.
+ Default is `1`. | No |
+### `event()`
+
+event sends an event to [Zenoss](https://www.zenoss.com/).
+
+#### Function type signature
+
+```flux
+(
+ severity: A,
+ url: string,
+ ?action: B,
+ ?apiKey: C,
+ ?collector: D,
+ ?component: E,
+ ?device: F,
+ ?eventClass: G,
+ ?eventClassKey: H,
+ ?message: I,
+ ?method: J,
+ ?password: string,
+ ?summary: K,
+ ?tid: L,
+ ?type: M,
+ ?username: string,
+) => int where C: Equatable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: Zenoss [router endpoint URL](https://help.zenoss.com/zsd/RM/configuring-resource-manager/enabling-access-to-browser-interfaces/creating-and-changing-public-endpoints). | Yes |
+| username | username: Zenoss username to use for HTTP BASIC authentication.
+ Default is `""` (no authentication). | No |
+| password | password: Zenoss password to use for HTTP BASIC authentication.
+ Default is `""` (no authentication). | No |
+| apiKey | apiKey: Zenoss cloud API key.
+ Default is `""` (no API key). | No |
+| action | action: Zenoss router name.
+ Default is "EventsRouter". | No |
+| method | method: [EventsRouter method](https://help.zenoss.com/dev/collection-zone-and-resource-manager-apis/codebase/routers/router-reference/eventsrouter).
+ Default is "add_event". | No |
+| type | type: Event type.
+ Default is "rpc". | No |
+| tid | tid: Temporary request transaction ID.
+ Default is `1`. | No |
+| summary | summary: Event summary.
+ Default is `""`. | No |
+| device | device: Related device.
+ Default is `""`. | No |
+| component | component: Related component.
+ Default is `""`. | No |
+| severity | severity: [Event severity level](https://help.zenoss.com/zsd/RM/administering-resource-manager/event-management/event-severity-levels). | Yes |
+| eventClass | eventClass: [Event class](https://help.zenoss.com/zsd/RM/administering-resource-manager/event-management/understanding-event-classes).
+ Default is `""`. | No |
+| eventClassKey | eventClassKey: Event [class key](https://help.zenoss.com/zsd/RM/administering-resource-manager/event-management/event-fields).
+ Default is `""`. | No |
+| collector | collector: Zenoss [collector](https://help.zenoss.com/zsd/RM/administering-resource-manager/event-management/event-fields).
+ Default is `""`. | No |
+| message | message: Related message.
+ Default is `""`. | No |
diff --git a/docs/contrib/chobbs/discord.md b/docs/contrib/chobbs/discord.md
new file mode 100644
index 0000000..c4a0276
--- /dev/null
+++ b/docs/contrib/chobbs/discord.md
@@ -0,0 +1,77 @@
+## `discord` package
+
+Package discord provides functions for sending messages to [Discord](https://discord.com/).
+
+Import the `discord` package:
+
+```flux
+import "discord"
+```
+
+### Functions
+
+### `discordURL()`
+
+discordURL is the Discord webhook URL.
+Default is `https://discordapp.com/api/webhooks/`.
+
+#### Function type signature
+
+```flux
+string
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `endpoint()`
+
+endpoint sends a single message to a Discord channel using a
+[Discord webhook](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks&?page=3)
+and data from table rows.
+
+#### Function type signature
+
+```flux
+(
+ username: A,
+ webhookID: string,
+ webhookToken: string,
+ ?avatar_url: B,
+) => (mapFn: (r: C) => {D with content: E}) => (<-tables: stream[C]) => stream[{C with _sent: string}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| webhookToken | webhookToken: Discord [webhook token](https://discord.com/developers/docs/resources/webhook). | Yes |
+| webhookID | webhookID: Discord [webhook ID](https://discord.com/developers/docs/resources/webhook). | Yes |
+| username | username: Override the Discord webhook’s default username. | Yes |
+| avatar_url | avatar_url: Override the Discord webhook’s default avatar. | No |
+### `send()`
+
+send sends a single message to a Discord channel using a Discord webhook.
+
+#### Function type signature
+
+```flux
+(
+ content: A,
+ username: B,
+ webhookID: string,
+ webhookToken: string,
+ ?avatar_url: C,
+) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| webhookToken | webhookToken: Discord [webhook token](https://discord.com/developers/docs/resources/webhook). | Yes |
+| webhookID | webhookID: Discord [webhook ID](https://discord.com/developers/docs/resources/webhook). | Yes |
+| username | username: Override the Discord webhook’s default username. | Yes |
+| content | content: Message to send to Discord (2000 character limit). | Yes |
+| avatar_url | avatar_url: Override the Discord webhook’s default avatar. | No |
diff --git a/docs/contrib/jsternberg/influxdb.md b/docs/contrib/jsternberg/influxdb.md
new file mode 100644
index 0000000..6b68e0c
--- /dev/null
+++ b/docs/contrib/jsternberg/influxdb.md
@@ -0,0 +1,95 @@
+## `influxdb` package
+
+Package influxdb provides additional functions for querying data from InfluxDB.
+
+Import the `influxdb` package:
+
+```flux
+import "influxdb"
+```
+
+### Functions
+
+### `from()`
+
+from retrieves data from an InfluxDB bucket between the `start` and `stop` times.
+
+#### Function type signature
+
+```flux
+(
+ bucket: string,
+ start: A,
+ ?host: string,
+ ?org: string,
+ ?stop: B,
+ ?token: string,
+) => stream[{
+ C with
+ _value: D,
+ _time: time,
+ _stop: time,
+ _start: time,
+ _measurement: string,
+ _field: string,
+}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| bucket | bucket: Name of the bucket to query. | Yes |
+| start | start: Earliest time to include in results. | Yes |
+| stop | stop: Latest time to include in results. Default is `now()`. | No |
+| host | host: URL of the InfluxDB instance to query. | No |
+| org | org: Organization name. | No |
+| token | token: InfluxDB [API token](https://docs.influxdata.com/influxdb/latest/security/tokens/). | No |
+### `select()`
+
+select is an alternate implementation of `from()`,
+`range()`, `filter()` and `pivot()` that returns pivoted query results and masks
+the `_measurement`, `_start`, and `_stop` columns. Results are similar to those
+returned by InfluxQL `SELECT` statements.
+
+#### Function type signature
+
+```flux
+(
+ from: string,
+ m: A,
+ start: B,
+ ?fields: [string],
+ ?host: string,
+ ?org: string,
+ ?stop: C,
+ ?token: string,
+ ?where: (
+ r: {
+ D with
+ _value: E,
+ _time: time,
+ _stop: time,
+ _start: time,
+ _measurement: string,
+ _field: string,
+ },
+ ) => bool,
+) => stream[F] where A: Equatable, F: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| from | from: Name of the bucket to query. | Yes |
+| start | start: Earliest time to include in results. | Yes |
+| stop | stop: Latest time to include in results. Default is `now()`. | No |
+| m | m: Name of the measurement to query. | Yes |
+| fields | fields: List of fields to query. Default is`[]`. | No |
+| where | where: Single argument predicate function that evaluates `true` or `false`
+ and filters results based on tag values.
+ Default is `(r) => true`. | No |
+| host | host: URL of the InfluxDB instance to query. | No |
+| org | org: Organization name. | No |
+| token | token: InfluxDB [API token](https://docs.influxdata.com/influxdb/latest/security/tokens/). | No |
diff --git a/docs/contrib/qxip/clickhouse.md b/docs/contrib/qxip/clickhouse.md
new file mode 100644
index 0000000..8597eb2
--- /dev/null
+++ b/docs/contrib/qxip/clickhouse.md
@@ -0,0 +1,53 @@
+## `clickhouse` package
+
+Package clickhouse provides functions to query [ClickHouse](https://clickhouse.com/) using the ClickHouse HTTP API.
+
+Import the `clickhouse` package:
+
+```flux
+import "clickhouse"
+```
+
+### Functions
+
+### `defaultURL()`
+
+defaultURL is the default ClickHouse HTTP API URL.
+
+#### Function type signature
+
+```flux
+string
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `query()`
+
+query queries data from ClickHouse using specified parameters.
+
+#### Function type signature
+
+```flux
+(
+ query: string,
+ ?cors: string,
+ ?format: string,
+ ?limit: A,
+ ?max_bytes: B,
+ ?url: string,
+) => stream[C] where A: Stringable, B: Stringable, C: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: ClickHouse HTTP API URL. Default is `http://127.0.0.1:8123`. | No |
+| query | query: ClickHouse query to execute. | Yes |
+| limit | limit: Query rows limit. Defaults is `100`. | No |
+| cors | cors: Request remote CORS headers. Defaults is `1`. | No |
+| max_bytes | max_bytes: Query bytes limit. Default is `10000000`. | No |
+| format | format: Query format. Default is `CSVWithNames`. | No |
diff --git a/docs/contrib/qxip/hash.md b/docs/contrib/qxip/hash.md
new file mode 100644
index 0000000..597438e
--- /dev/null
+++ b/docs/contrib/qxip/hash.md
@@ -0,0 +1,118 @@
+## `hash` package
+
+Package hash provides functions that convert string values to hashes.
+
+Import the `hash` package:
+
+```flux
+import "hash"
+```
+
+### Functions
+
+### `b64()`
+
+b64 converts a string value to a Base64 string.
+
+#### Function type signature
+
+```flux
+(v: A) => string
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| v | v: String to hash. | Yes |
+### `cityhash64()`
+
+cityhash64 converts a string value to a 64-bit hexadecimal hash using the CityHash64 algorithm.
+
+#### Function type signature
+
+```flux
+(v: A) => string
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| v | v: String to hash. | Yes |
+### `hmac()`
+
+hmac converts a string value to an MD5-signed SHA-1 hash.
+
+#### Function type signature
+
+```flux
+(k: A, v: A) => string
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| v | v: String to hash. | Yes |
+| k | k: Key to sign hash. | Yes |
+### `md5()`
+
+md5 converts a string value to an MD5 hash.
+
+#### Function type signature
+
+```flux
+(v: A) => string
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| v | v: String to hash. | Yes |
+### `sha1()`
+
+sha1 converts a string value to a hexadecimal hash using the SHA-1 hash algorithm.
+
+#### Function type signature
+
+```flux
+(v: A) => string
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| v | v: String to hash. | Yes |
+### `sha256()`
+
+sha256 converts a string value to a hexadecimal hash using the SHA 256 hash algorithm.
+
+#### Function type signature
+
+```flux
+(v: A) => string
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| v | v: String to hash. | Yes |
+### `xxhash64()`
+
+xxhash64 converts a string value to a 64-bit hexadecimal hash using the xxHash algorithm.
+
+#### Function type signature
+
+```flux
+(v: A) => string
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| v | v: String to hash. | Yes |
diff --git a/docs/contrib/qxip/iox.md b/docs/contrib/qxip/iox.md
new file mode 100644
index 0000000..c53bdc6
--- /dev/null
+++ b/docs/contrib/qxip/iox.md
@@ -0,0 +1,47 @@
+## `iox` package
+
+Package iox provides additional functions for querying data from InfluxDB IOx.
+
+Import the `iox` package:
+
+```flux
+import "iox"
+```
+
+### Functions
+
+### `from()`
+
+from retrieves data from an IOx bucket between the `start` and `stop` times.
+
+#### Function type signature
+
+```flux
+(
+ bucket: A,
+ ?columns: B,
+ ?host: C,
+ ?limit: D,
+ ?org: E,
+ ?secure: F,
+ ?start: G,
+ ?stop: H,
+ ?table: I,
+ ?token: J,
+) => stream[K] where A: Stringable, B: Stringable, C: Equatable + Stringable, D: Stringable, E: Equatable + Stringable, F: Stringable, G: Timeable, H: Timeable, I: Stringable, J: Equatable + Stringable, K: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| bucket | bucket: Name of the IOx bucket to query. | Yes |
+| start | start: Earliest time to include in results. | No |
+| stop | stop: Latest time to include in results. Default is `now()`. | No |
+| host | host: URL of the IOx instance to query. | No |
+| org | org: Organization name. | No |
+| token | token: [API token](https://docs.influxdata.com/influxdb/latest/security/tokens/). | No |
+| table | table: Table used in the FlightSQL query. | No |
+| limit | limit: Limit for the FlightSQL query. Default is `1000`. | No |
+| columns | columns: Columns selected by the FlightSQL query. Default is `*`. | No |
+| secure | secure: Secure connection to IOx instance. Default is `true`. | No |
diff --git a/docs/contrib/qxip/logql.md b/docs/contrib/qxip/logql.md
new file mode 100644
index 0000000..8ebbc32
--- /dev/null
+++ b/docs/contrib/qxip/logql.md
@@ -0,0 +1,73 @@
+## `logql` package
+
+Package logql provides functions for using [LogQL](https://grafana.com/docs/loki/latest/logql/) to query a [Loki](https://grafana.com/oss/loki/) data source.
+
+Import the `logql` package:
+
+```flux
+import "logql"
+```
+
+### Functions
+
+### `defaultAPI()`
+
+defaultAPI is the default LogQL Query Range API Path.
+
+#### Function type signature
+
+```flux
+string
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `defaultURL()`
+
+defaultURL is the default LogQL HTTP API URL.
+
+#### Function type signature
+
+```flux
+string
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `query_range()`
+
+query_range queries data from a specified LogQL query within given time bounds,
+filters data by query, timerange, and optional limit expressions.
+All values are returned as string values (using `raw` mode in `csv.from`)
+
+#### Function type signature
+
+```flux
+(
+ query: string,
+ ?end: A,
+ ?limit: B,
+ ?orgid: string,
+ ?path: string,
+ ?start: C,
+ ?step: D,
+ ?url: string,
+) => stream[E] where A: Timeable, B: Stringable, C: Timeable, D: Stringable, E: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: LogQL/qryn URL and port. Default is `http://qryn:3100`. | No |
+| path | path: LogQL query_range API path. | No |
+| limit | limit: Query limit. Default is 100. | No |
+| query | query: LogQL query to execute. | Yes |
+| start | start: Earliest time to include in results. Default is `-1h`. | No |
+| end | end: Latest time to include in results. Default is `now()`. | No |
+| step | step: Query resolution step width in seconds. Default is 10. | No |
+| orgid | orgid: Optional Loki organization ID for partitioning. Default is `""`. | No |
diff --git a/docs/contrib/rhajek/bigpanda.md b/docs/contrib/rhajek/bigpanda.md
new file mode 100644
index 0000000..2212a76
--- /dev/null
+++ b/docs/contrib/rhajek/bigpanda.md
@@ -0,0 +1,106 @@
+## `bigpanda` package
+
+Package bigpanda provides functions for sending alerts to [BigPanda](https://www.bigpanda.io/).
+
+Import the `bigpanda` package:
+
+```flux
+import "bigpanda"
+```
+
+### Functions
+
+### `defaultTokenPrefix()`
+
+defaultTokenPrefix is the default HTTP authentication scheme to use when authenticating with BigPanda.
+Default is `Bearer`.
+
+#### Function type signature
+
+```flux
+string
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `defaultUrl()`
+
+defaultUrl is the default [BigPanda alerts API URL](https://docs.bigpanda.io/reference#alerts-how-it-works)
+for functions in the `bigpanda` package.
+Default is `https://api.bigpanda.io/data/v2/alerts`.
+
+#### Function type signature
+
+```flux
+string
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `endpoint()`
+
+endpoint sends alerts to BigPanda using data from input rows.
+
+#### Function type signature
+
+```flux
+(
+ appKey: A,
+ token: string,
+ ?url: string,
+) => (mapFn: (r: B) => {C with status: D}) => (<-tables: stream[B]) => stream[{B with _sent: string}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: BigPanda [alerts API URL](https://docs.bigpanda.io/reference#alerts-how-it-works).
+ Default is the value of the `bigpanda.defaultURL` option. | No |
+| token | token: BigPanda [API Authorization token (API key)](https://docs.bigpanda.io/docs/api-key-management). | Yes |
+| appKey | appKey: BigPanda [App Key](https://docs.bigpanda.io/reference#integrating-monitoring-systems). | Yes |
+### `sendAlert()`
+
+sendAlert sends an alert to [BigPanda](https://www.bigpanda.io/).
+
+#### Function type signature
+
+```flux
+(
+ appKey: A,
+ rec: B,
+ status: C,
+ token: string,
+ url: string,
+) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: BigPanda [alerts API URL](https://docs.bigpanda.io/reference#alerts-how-it-works).
+ Default is the value of the `bigpanda.defaultURL` option. | Yes |
+| token | token: BigPanda [API Authorization token (API key)](https://docs.bigpanda.io/docs/api-key-management). | Yes |
+| appKey | appKey: BigPanda [App Key](https://docs.bigpanda.io/reference#integrating-monitoring-systems). | Yes |
+| status | status: BigPanda [alert status](https://docs.bigpanda.io/reference#alerts). | Yes |
+| rec | rec: Additional [alert parameters](https://docs.bigpanda.io/reference#alert-object) to send to the BigPanda alert API. | Yes |
+### `statusFromLevel()`
+
+statusFromLevel converts an alert level to a BigPanda status.
+
+#### Function type signature
+
+```flux
+(level: string) => string
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| level | level: Alert level. | Yes |
diff --git a/docs/contrib/sranka/opsgenie.md b/docs/contrib/sranka/opsgenie.md
new file mode 100644
index 0000000..457ff31
--- /dev/null
+++ b/docs/contrib/sranka/opsgenie.md
@@ -0,0 +1,112 @@
+## `opsgenie` package
+
+Package opsgenie provides functions that send alerts to
+[Atlassian Opsgenie](https://www.atlassian.com/software/opsgenie)
+using the [Opsgenie v2 API](https://docs.opsgenie.com/docs/alert-api#create-alert).
+
+Import the `opsgenie` package:
+
+```flux
+import "opsgenie"
+```
+
+### Functions
+
+### `endpoint()`
+
+endpoint sends an alert message to Opsgenie using data from table rows.
+
+#### Function type signature
+
+```flux
+(
+ apiKey: string,
+ ?entity: string,
+ ?url: string,
+) => (
+ mapFn: (
+ r: A,
+ ) => {
+ B with
+ visibleTo: [string],
+ tags: E,
+ responders: [string],
+ priority: string,
+ message: string,
+ details: D,
+ description: string,
+ alias: string,
+ actions: C,
+ },
+) => (<-tables: stream[A]) => stream[{A with _sent: string}] where D: Stringable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: Opsgenie API URL. Defaults to `https://api.opsgenie.com/v2/alerts`. | No |
+| apiKey | apiKey: (Required) Opsgenie API authorization key. | Yes |
+| entity | entity: Alert entity used to specify the alert domain. | No |
+### `respondersToJSON()`
+
+respondersToJSON converts an array of Opsgenie responder strings
+to a string-encoded JSON array that can be embedded in an alert message.
+
+#### Function type signature
+
+```flux
+(v: [string]) => string
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| v | v: (Required) Array of Opsgenie responder strings.
+ Responder strings must begin with
+ `user: `, `team: `, `escalation: `, or `schedule: `. | Yes |
+### `sendAlert()`
+
+sendAlert sends an alert message to Opsgenie.
+
+#### Function type signature
+
+```flux
+(
+ apiKey: string,
+ message: string,
+ ?actions: A,
+ ?alias: string,
+ ?description: string,
+ ?details: B,
+ ?entity: string,
+ ?priority: string,
+ ?responders: [string],
+ ?tags: C,
+ ?url: string,
+ ?visibleTo: [string],
+) => int where B: Stringable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: Opsgenie API URL. Defaults to `https://api.opsgenie.com/v2/alerts`. | No |
+| apiKey | apiKey: (Required) Opsgenie API authorization key. | Yes |
+| message | message: (Required) Alert message text.
+ 130 characters or less. | Yes |
+| alias | alias: Opsgenie alias usee to de-deduplicate alerts.
+ 250 characters or less.
+ Defaults to [message](https://docs.influxdata.com/flux/v0.x/stdlib/contrib/sranka/opsgenie/sendalert/#message). | No |
+| description | description: Alert description. 15000 characters or less. | No |
+| priority | priority: Opsgenie alert priority. | No |
+| responders | responders: List of responder teams or users.
+ Use the `user: ` prefix for users and `teams: ` prefix for teams. | No |
+| tags | tags: Alert tags. | No |
+| entity | entity: Alert entity used to specify the alert domain. | No |
+| actions | actions: List of actions available for the alert. | No |
+| details | details: Additional alert details. Must be a JSON-encoded map of key-value string pairs. | No |
+| visibleTo | visibleTo: List of teams and users the alert will be visible to without sending notifications.
+ Use the `user: ` prefix for users and `teams: ` prefix for teams. | No |
diff --git a/docs/contrib/sranka/sensu.md b/docs/contrib/sranka/sensu.md
new file mode 100644
index 0000000..4a82d1e
--- /dev/null
+++ b/docs/contrib/sranka/sensu.md
@@ -0,0 +1,100 @@
+## `sensu` package
+
+Package sensu provides functions for sending events to [Sensu Go](https://docs.sensu.io/sensu-go/latest/).
+
+Import the `sensu` package:
+
+```flux
+import "sensu"
+```
+
+### Functions
+
+### `endpoint()`
+
+endpoint sends an event
+to the [Sensu Events API](https://docs.sensu.io/sensu-go/latest/api/events/#create-a-new-event)
+using data from table rows.
+
+#### Function type signature
+
+```flux
+(
+ apiKey: string,
+ url: string,
+ ?entityName: string,
+ ?handlers: A,
+ ?namespace: string,
+) => (
+ mapFn: (r: B) => {C with text: E, status: D, checkName: string},
+) => (<-tables: stream[B]) => stream[{B with _sent: string}] where D: Equatable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: Base URL of [Sensu API](https://docs.sensu.io/sensu-go/latest/migrate/#architecture)
+ *without a trailing slash*.
+ Example: `http://localhost:8080`. | Yes |
+| apiKey | apiKey: Sensu [API Key](https://docs.sensu.io/sensu-go/latest/operations/control-access/). | Yes |
+| handlers | handlers: [Sensu handlers](https://docs.sensu.io/sensu-go/latest/reference/handlers/) to execute.
+ Default is `[]`. | No |
+| namespace | namespace: [Sensu namespace](https://docs.sensu.io/sensu-go/latest/reference/rbac/).
+ Default is `default`. | No |
+| entityName | entityName: Event source.
+ Default is `influxdb`. | No |
+### `event()`
+
+event sends a single event to the [Sensu Events API](https://docs.sensu.io/sensu-go/latest/api/events/#create-a-new-event).
+
+#### Function type signature
+
+```flux
+(
+ apiKey: string,
+ checkName: string,
+ text: A,
+ url: string,
+ ?entityName: string,
+ ?handlers: B,
+ ?namespace: string,
+ ?state: string,
+ ?status: C,
+) => int where C: Equatable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: Base URL of [Sensu API](https://docs.sensu.io/sensu-go/latest/migrate/#architecture)
+ without a trailing slash. | Yes |
+| apiKey | apiKey: Sensu [API Key](https://docs.sensu.io/sensu-go/latest/operations/control-access/). | Yes |
+| checkName | checkName: Check name. | Yes |
+| text | text: Event text. | Yes |
+| handlers | handlers: Sensu handlers to execute. Default is `[]`. | No |
+| status | status: Event status code that indicates [state](https://docs.influxdata.com/flux/v0.x/stdlib/contrib/sranka/sensu/event/#state).
+ Default is `0`. | No |
+| state | state: Event state.
+ Default is `"passing"` for `0` [status](https://docs.influxdata.com/flux/v0.x/stdlib/contrib/sranka/sensu/event/#status) and `"failing"` for other statuses. | No |
+| namespace | namespace: [Sensu namespace](https://docs.sensu.io/sensu-go/latest/reference/rbac/).
+ Default is `"default"`. | No |
+| entityName | entityName: Event source.
+ Default is `influxdb`. | No |
+### `toSensuName()`
+
+toSensuName translates a string value to a Sensu name
+by replacing non-alphanumeric characters (`[a-zA-Z0-9_.-]`) with underscores (`_`).
+
+#### Function type signature
+
+```flux
+(v: string) => string
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| v | v: String to operate on. | Yes |
diff --git a/docs/contrib/sranka/teams.md b/docs/contrib/sranka/teams.md
new file mode 100644
index 0000000..4a534fe
--- /dev/null
+++ b/docs/contrib/sranka/teams.md
@@ -0,0 +1,68 @@
+## `teams` package
+
+Package teams (Microsoft Teams) provides functions
+for sending messages to a [Microsoft Teams](https://www.microsoft.com/microsoft-365/microsoft-teams/group-chat-software)
+channel using an [incoming webhook](https://docs.microsoft.com/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook).
+
+Import the `teams` package:
+
+```flux
+import "teams"
+```
+
+### Functions
+
+### `endpoint()`
+
+endpoint sends a message to a Microsoft Teams channel using data from table rows.
+
+#### Function type signature
+
+```flux
+(
+ url: string,
+) => (
+ mapFn: (r: A) => {B with title: C, text: string, summary: string},
+) => (<-tables: stream[A]) => stream[{A with _sent: string}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: Incoming webhook URL. | Yes |
+### `message()`
+
+message sends a single message to a Microsoft Teams channel using an
+[incoming webhook](https://docs.microsoft.com/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook).
+
+#### Function type signature
+
+```flux
+(text: string, title: A, url: string, ?summary: string) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: Incoming webhook URL. | Yes |
+| title | title: Message card title. | Yes |
+| text | text: Message card text. | Yes |
+| summary | summary: Message card summary.
+ Default is `""`. | No |
+### `summaryCutoff()`
+
+summaryCutoff is the limit for message summaries.
+Default is `70`.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
diff --git a/docs/contrib/sranka/telegram.md b/docs/contrib/sranka/telegram.md
new file mode 100644
index 0000000..5793ace
--- /dev/null
+++ b/docs/contrib/sranka/telegram.md
@@ -0,0 +1,131 @@
+## `telegram` package
+
+Package telegram provides functions for sending messages to [Telegram](https://telegram.org/)
+using the [Telegram Bot API](https://core.telegram.org/bots/api).
+
+Import the `telegram` package:
+
+```flux
+import "telegram"
+```
+
+### Functions
+
+### `defaultDisableWebPagePreview()`
+
+defaultDisableWebPagePreview - Use Telegram web page preview by default. Default is `false`.
+
+#### Function type signature
+
+```flux
+bool
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `defaultParseMode()`
+
+defaultParseMode is the default [Telegram parse mode](https://core.telegram.org/bots/api#formatting-options). Default is `MarkdownV2`.
+
+#### Function type signature
+
+```flux
+string
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `defaultSilent()`
+
+defaultSilent - Send silent Telegram notifications by default. Default is `true`.
+
+#### Function type signature
+
+```flux
+bool
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `defaultURL()`
+
+defaultURL is the default Telegram bot URL. Default is `https://api.telegram.org/bot`.
+
+#### Function type signature
+
+```flux
+string
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `endpoint()`
+
+endpoint sends a message to a Telegram channel using data from table rows.
+
+#### Function type signature
+
+```flux
+(
+ token: string,
+ ?disableWebPagePreview: A,
+ ?parseMode: B,
+ ?url: string,
+) => (
+ mapFn: (r: C) => {D with text: G, silent: F, channel: E},
+) => (<-tables: stream[C]) => stream[{C with _sent: string}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: URL of the Telegram bot endpoint. Default is `https://api.telegram.org/bot`. | No |
+| token | token: Telegram bot token. | Yes |
+| parseMode | parseMode: [Parse mode](https://core.telegram.org/bots/api#formatting-options)
+ of the message text.
+ Default is `MarkdownV2`. | No |
+| disableWebPagePreview | disableWebPagePreview: Disable preview of web links in the sent message.
+ Default is false. | No |
+### `message()`
+
+message sends a single message to a Telegram channel
+using the [`sendMessage`](https://core.telegram.org/bots/api#sendmessage) method of the Telegram Bot API.
+
+#### Function type signature
+
+```flux
+(
+ channel: A,
+ text: B,
+ token: string,
+ ?disableWebPagePreview: C,
+ ?parseMode: D,
+ ?silent: E,
+ ?url: string,
+) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: URL of the Telegram bot endpoint. Default is `https://api.telegram.org/bot`. | No |
+| token | token: Telegram bot token. | Yes |
+| channel | channel: Telegram channel ID. | Yes |
+| text | text: Message text. | Yes |
+| parseMode | parseMode: [Parse mode](https://core.telegram.org/bots/api#formatting-options)
+ of the message text.
+ Default is `MarkdownV2`. | No |
+| disableWebPagePreview | disableWebPagePreview: Disable preview of web links in the sent message.
+ Default is `false`. | No |
+| silent | silent: Send message [silently](https://telegram.org/blog/channels-2-0#silent-messages).
+ Default is `true`. | No |
diff --git a/docs/contrib/sranka/webexteams.md b/docs/contrib/sranka/webexteams.md
new file mode 100644
index 0000000..e39341a
--- /dev/null
+++ b/docs/contrib/sranka/webexteams.md
@@ -0,0 +1,62 @@
+## `webexteams` package
+
+Package webexteams provides functions that send messages
+to [Webex Teams](https://www.webex.com/team-collaboration.html).
+
+Import the `webexteams` package:
+
+```flux
+import "webexteams"
+```
+
+### Functions
+
+### `endpoint()`
+
+endpoint returns a function that sends a message that includes data from input rows to a Webex room.
+
+#### Function type signature
+
+```flux
+(
+ token: string,
+ ?url: string,
+) => (
+ mapFn: (r: A) => {B with text: E, roomId: D, markdown: C},
+) => (<-tables: stream[A]) => stream[{A with _sent: string}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: Base URL of Webex API endpoint (without a trailing slash).
+ Default is `https://webexapis.com`. | No |
+| token | token: [Webex API access token](https://developer.webex.com/docs/api/getting-started). | Yes |
+### `message()`
+
+message sends a single message to Webex
+using the [Webex messages API](https://developer.webex.com/docs/api/v1/messages/create-a-message).
+
+#### Function type signature
+
+```flux
+(
+ markdown: A,
+ roomId: B,
+ text: C,
+ token: string,
+ ?url: string,
+) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: Base URL of Webex API endpoint (without a trailing slash).
+ Default is `https://webexapis.com`. | No |
+| token | token: [Webex API access token](https://developer.webex.com/docs/api/getting-started). | Yes |
+| roomId | roomId: Room ID to send the message to. | Yes |
+| text | text: Plain text message. | Yes |
+| markdown | markdown: [Markdown formatted message](https://developer.webex.com/docs/api/basics#formatting-messages). | Yes |
diff --git a/docs/contrib/tomhollingworth/events.md b/docs/contrib/tomhollingworth/events.md
new file mode 100644
index 0000000..2d5e6b4
--- /dev/null
+++ b/docs/contrib/tomhollingworth/events.md
@@ -0,0 +1,43 @@
+## `events` package
+
+Package events provides tools for analyzing event-based data.
+
+Import the `events` package:
+
+```flux
+import "events"
+```
+
+### Functions
+
+### `duration()`
+
+duration calculates the duration of events.
+
+#### Function type signature
+
+```flux
+(
+ <-tables: stream[A],
+ ?columnName: string,
+ ?stop: time,
+ ?stopColumn: string,
+ ?timeColumn: string,
+ ?unit: duration,
+) => stream[B] where A: Record, B: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| unit | unit: Duration unit of the calculated state duration.
+ Default is `1ns`. | No |
+| columnName | columnName: Name of the result column.
+ Default is `"duration"`. | No |
+| timeColumn | timeColumn: Name of the time column.
+ Default is `"_time"`. | No |
+| stopColumn | stopColumn: Name of the stop column.
+ Default is `"_stop"`. | No |
+| stop | stop: The latest time to use when calculating results. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
diff --git a/docs/csv.md b/docs/csv.md
new file mode 100644
index 0000000..f128002
--- /dev/null
+++ b/docs/csv.md
@@ -0,0 +1,30 @@
+## `csv` package
+
+Package csv provides tools for working with data in annotated CSV format.
+
+Import the `csv` package:
+
+```flux
+import "csv"
+```
+
+### Functions
+
+### `from()`
+
+from retrieves data from a comma separated value (CSV) data source and
+returns a stream of tables.
+
+#### Function type signature
+
+```flux
+(?csv: string, ?file: string, ?mode: string) => stream[A] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| csv | csv: CSV data. | No |
+| file | file: File path of the CSV file to query. | No |
+| mode | mode: is the CSV parsing mode. Default is `annotations`. | No |
diff --git a/docs/date.md b/docs/date.md
new file mode 100644
index 0000000..9a1d22b
--- /dev/null
+++ b/docs/date.md
@@ -0,0 +1,583 @@
+## `date` package
+
+Package date provides date and time constants and functions.
+
+Import the `date` package:
+
+```flux
+import "date"
+```
+
+### Functions
+
+### `April()`
+
+April is a constant that represents the month of April.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `August()`
+
+August is a constant that represents the month of August.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `December()`
+
+December is a constant that represents the month of December.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `February()`
+
+February is a constant that represents the month of February.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `Friday()`
+
+Friday is a constant that represents Friday as a day of the week.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `January()`
+
+January is a constant that represents the month of January.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `July()`
+
+July is a constant that represents the month of July.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `June()`
+
+June is a constant that represents the month of June.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `March()`
+
+March is a constant that represents the month of March.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `May()`
+
+May is a constant that represents the month of May.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `Monday()`
+
+Monday is a constant that represents Monday as a day of the week.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `November()`
+
+November is a constant that represents the month of November.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `October()`
+
+October is a constant that represents the month of October.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `Saturday()`
+
+Saturday is a constant that represents Saturday as a day of the week.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `September()`
+
+September is a constant that represents the month of September.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `Sunday()`
+
+Sunday is a constant that represents Sunday as a day of the week.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `Thursday()`
+
+Thursday is a constant that represents Thursday as a day of the week.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `Tuesday()`
+
+Tuesday is a constant that represents Tuesday as a day of the week.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `Wednesday()`
+
+Wednesday is a constant that represents Wednesday as a day of the week.
+
+#### Function type signature
+
+```flux
+int
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `add()`
+
+add adds a duration to a time value and returns the resulting time value.
+
+#### Function type signature
+
+```flux
+(d: duration, to: A, ?location: {zone: string, offset: duration}) => time where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| d | d: Duration to add. | Yes |
+| to | to: Time to add the duration to. | Yes |
+| location | location: Location to use for the time value. | No |
+### `hour()`
+
+hour returns the hour of a specified time. Results range from `[0 - 23]`.
+
+#### Function type signature
+
+```flux
+(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| t | t: Time to operate on. | Yes |
+| location | location: Location used to determine timezone.
+ Default is the `location` option. | No |
+### `microsecond()`
+
+microsecond returns the microseconds for a specified time.
+Results range `from [0-999999]`.
+
+#### Function type signature
+
+```flux
+(t: A) => int where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| t | t: Time to operate on. | Yes |
+### `millisecond()`
+
+millisecond returns the milliseconds for a specified time.
+Results range from `[0-999]`.
+
+#### Function type signature
+
+```flux
+(t: A) => int where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| t | t: Time to operate on. | Yes |
+### `minute()`
+
+minute returns the minute of a specified time. Results range from `[0 - 59]`.
+
+#### Function type signature
+
+```flux
+(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| t | t: Time to operate on. | Yes |
+| location | location: Location used to determine timezone.
+ Default is the `location` option. | No |
+### `month()`
+
+month returns the month of a specified time. Results range from `[1 - 12]`.
+
+#### Function type signature
+
+```flux
+(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| t | t: Time to operate on. | Yes |
+| location | location: Location used to determine timezone.
+ Default is the `location` option. | No |
+### `monthDay()`
+
+monthDay returns the day of the month for a specified time.
+Results range from `[1 - 31]`.
+
+#### Function type signature
+
+```flux
+(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| t | t: Time to operate on. | Yes |
+| location | location: Location used to determine timezone.
+ Default is the `location` option. | No |
+### `nanosecond()`
+
+nanosecond returns the nanoseconds for a specified time.
+Results range from `[0-999999999]`.
+
+#### Function type signature
+
+```flux
+(t: A) => int where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| t | t: Time to operate on. | Yes |
+### `quarter()`
+
+quarter returns the quarter for a specified time. Results range from `[1-4]`.
+
+#### Function type signature
+
+```flux
+(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| t | t: Time to operate on. | Yes |
+| location | location: Location used to determine timezone.
+ Default is the `location` option. | No |
+### `scale()`
+
+scale will multiply the duration by the given value.
+
+#### Function type signature
+
+```flux
+(d: duration, n: int) => duration
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| d | d: Duration to scale. | Yes |
+| n | n: Amount to scale the duration by. | Yes |
+### `second()`
+
+second returns the second of a specified time. Results range from `[0 - 59]`.
+
+#### Function type signature
+
+```flux
+(t: A) => int where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| t | t: Time to operate on. | Yes |
+### `sub()`
+
+sub subtracts a duration from a time value and returns the resulting time value.
+
+#### Function type signature
+
+```flux
+(d: duration, from: A, ?location: {zone: string, offset: duration}) => time where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| from | from: Time to subtract the duration from. | Yes |
+| d | d: Duration to subtract. | Yes |
+| location | location: Location to use for the time value. | No |
+### `time()`
+
+time returns the time value of a specified relative duration or time.
+
+#### Function type signature
+
+```flux
+(t: A, ?location: {zone: string, offset: duration}) => time where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| t | t: Duration or time value. | Yes |
+| location | location: Location used to determine timezone.
+ Default is the `location` option. | No |
+### `truncate()`
+
+truncate returns a time truncated to the specified duration unit.
+
+#### Function type signature
+
+```flux
+(t: A, unit: duration, ?location: {zone: string, offset: duration}) => time where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| t | t: Time to operate on. | Yes |
+| unit | unit: Unit of time to truncate to. | Yes |
+| location | location: Location used to determine timezone.
+ Default is the `location` option. | No |
+### `week()`
+
+week returns the ISO week of the year for a specified time.
+Results range from `[1 - 53]`.
+
+#### Function type signature
+
+```flux
+(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| t | t: Time to operate on. | Yes |
+| location | location: Location used to determine timezone.
+ Default is the `location` option. | No |
+### `weekDay()`
+
+weekDay returns the day of the week for a specified time.
+Results range from `[0 - 6]`.
+
+#### Function type signature
+
+```flux
+(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| t | t: Time to operate on. | Yes |
+| location | location: Location used to determine timezone.
+ Default is the `location` option. | No |
+### `year()`
+
+year returns the year of a specified time.
+
+#### Function type signature
+
+```flux
+(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| t | t: Time to operate on. | Yes |
+| location | location: Location used to determine timezone.
+ Default is the `location` option. | No |
+### `yearDay()`
+
+yearDay returns the day of the year for a specified time.
+Results can include leap days and range from `[1 - 366]`.
+
+#### Function type signature
+
+```flux
+(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| t | t: Time to operate on. | Yes |
+| location | location: Location used to determine timezone.
+ Default is the `location` option. | No |
diff --git a/docs/date/boundaries.md b/docs/date/boundaries.md
new file mode 100644
index 0000000..d55ceb8
--- /dev/null
+++ b/docs/date/boundaries.md
@@ -0,0 +1,157 @@
+## `boundaries` package
+
+Package boundaries provides operators for finding the boundaries around certain days, months, and weeks.
+
+Import the `boundaries` package:
+
+```flux
+import "boundaries"
+```
+
+### Functions
+
+### `friday()`
+
+friday returns a record with `start` and `stop` boundary timestamps for last Friday.
+
+#### Function type signature
+
+```flux
+() => {stop: time, start: time}
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `monday()`
+
+monday returns a record with `start` and `stop` boundary timestamps of last Monday.
+Last Monday is relative to `now()`. If today is Monday, the function returns boundaries for the previous Monday.
+
+#### Function type signature
+
+```flux
+() => {stop: time, start: time}
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `month()`
+
+month returns a record with `start` and `stop` boundary timestamps for the current month.
+
+#### Function type signature
+
+```flux
+(?month_offset: int) => {stop: time, start: time}
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| month_offset | month_offset: Number of months to offset from the current month. Default is `0`. | No |
+### `saturday()`
+
+saturday returns a record with `start` and `stop` boundary timestamps for last Saturday.
+
+#### Function type signature
+
+```flux
+() => {stop: time, start: time}
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `sunday()`
+
+sunday returns a record with `start` and `stop` boundary timestamps for last Sunday.
+
+#### Function type signature
+
+```flux
+() => {stop: time, start: time}
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `thursday()`
+
+thursday returns a record with `start` and `stop` boundary timestamps for last Thursday.
+
+#### Function type signature
+
+```flux
+() => {stop: time, start: time}
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `tuesday()`
+
+tuesday returns a record with `start` and `stop` boundary timestamps of last Tuesday.
+
+#### Function type signature
+
+```flux
+() => {stop: time, start: time}
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `wednesday()`
+
+wednesday returns a record with `start` and `stop` boundary timestamps for last Wednesday.
+
+#### Function type signature
+
+```flux
+() => {stop: time, start: time}
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `week()`
+
+week returns a record with `start` and `stop` boundary timestamps of the current week.
+By default, weeks start on Monday.
+
+#### Function type signature
+
+```flux
+(?start_sunday: bool, ?week_offset: int) => {stop: time, start: time}
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| start_sunday | start_sunday: Indicate if the week starts on Sunday. Default is `false`. | No |
+| week_offset | week_offset: Number of weeks to offset from the current week. Default is `0`. | No |
+### `yesterday()`
+
+yesterday returns a record with `start` and `stop` boundary timestamps for yesterday.
+
+#### Function type signature
+
+```flux
+() => {stop: time, start: time}
+```
+
+#### Parameters
+
+No parameters provided.
+
diff --git a/docs/dict.md b/docs/dict.md
new file mode 100644
index 0000000..1c2cf75
--- /dev/null
+++ b/docs/dict.md
@@ -0,0 +1,85 @@
+## `dict` package
+
+Package dict provides functions for interacting with dictionary types.
+
+Import the `dict` package:
+
+```flux
+import "dict"
+```
+
+### Functions
+
+### `fromList()`
+
+fromList creates a dictionary from a list of records with `key` and `value`
+properties.
+
+#### Function type signature
+
+```flux
+(pairs: [{value: B, key: A}]) => [A:B] where A: Comparable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| pairs | pairs: List of records with `key` and `value` properties. | Yes |
+### `get()`
+
+get returns the value of a specified key in a dictionary or a default value
+if the key does not exist.
+
+#### Function type signature
+
+```flux
+(default: A, dict: [B:A], key: B) => A where B: Comparable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| dict | dict: Dictionary to return a value from. | Yes |
+| key | key: Key to return from the dictionary. | Yes |
+| default | default: Default value to return if the key does not exist in the
+ dictionary. Must be the same type as values in the dictionary. | Yes |
+### `insert()`
+
+insert inserts a key-value pair into a dictionary and returns a new,
+updated dictionary.
+
+#### Function type signature
+
+```flux
+(dict: [A:B], key: A, value: B) => [A:B] where A: Comparable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| dict | dict: Dictionary to update. | Yes |
+| key | key: Key to insert into the dictionary.
+ Must be the same type as the existing keys in the dictionary. | Yes |
+| value | value: Value to insert into the dictionary.
+ Must be the same type as the existing values in the dictionary. | Yes |
+### `remove()`
+
+remove removes a key value pair from a dictionary and returns an updated
+dictionary.
+
+#### Function type signature
+
+```flux
+(dict: [A:B], key: A) => [A:B] where A: Comparable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| dict | dict: Dictionary to remove the key-value pair from. | Yes |
+| key | key: Key to remove from the dictionary.
+ Must be the same type as existing keys in the dictionary. | Yes |
diff --git a/docs/docsify.js b/docs/docsify.js
new file mode 100644
index 0000000..3ac0c85
--- /dev/null
+++ b/docs/docsify.js
@@ -0,0 +1,17 @@
+window.$docsify = {
+ name: 'Flux Community',
+ repo: 'https://github.com/InfluxCommunity/flux',
+ loadSidebar: true,
+ auto2top: true,
+ coverpage: true,
+ basePath: '.', // Adjust this base path as needed
+ alias: {
+ '/_sidebar.md': '_sidebar.md',
+ },
+};
+
+// Initialize Docsify
+document.addEventListener('DOMContentLoaded', function () {
+ docsify.init();
+});
+
diff --git a/docs/experimental.md b/docs/experimental.md
new file mode 100644
index 0000000..ea7f430
--- /dev/null
+++ b/docs/experimental.md
@@ -0,0 +1,600 @@
+## `experimental` package
+
+Package experimental includes experimental functions and packages.
+
+Import the `experimental` package:
+
+```flux
+import "experimental"
+```
+
+### Functions
+
+### `addDuration()`
+
+addDuration adds a duration to a time value and returns the resulting time value.
+
+#### Function type signature
+
+```flux
+(d: duration, to: A, ?location: {zone: string, offset: duration}) => time where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| d | d: Duration to add. | Yes |
+| to | to: Time to add the duration to. | Yes |
+| location | location: Location to use for the time value. | No |
+### `alignTime()`
+
+alignTime shifts time values in input tables to all start at a common start time.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[B], ?alignTo: A) => stream[C] where B: Record, C: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| alignTo | alignTo: Time to align tables to. Default is `1970-01-01T00:00:00Z`. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `catch()`
+
+catch calls a function and returns any error as a string value.
+If the function does not error the returned value is made into a string and returned.
+
+#### Function type signature
+
+```flux
+(fn: () => A) => {value: A, msg: string, code: uint}
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| fn | fn: Function to call. | Yes |
+### `chain()`
+
+chain runs two queries in a single Flux script sequentially and outputs the
+results of the second query.
+
+#### Function type signature
+
+```flux
+(first: stream[A], second: stream[B]) => stream[B] where A: Record, B: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| first | first: First query to execute. | Yes |
+| second | second: Second query to execute. | Yes |
+### `count()`
+
+count returns the number of records in each input table.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with _value: B}]) => stream[{A with _value: int}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `diff()`
+
+diff takes two table streams as input and produces a diff.
+
+#### Function type signature
+
+```flux
+(<-got: stream[A], want: stream[A]) => stream[{A with _diff: string}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| want | want: Input stream for the `-` side of the diff. | Yes |
+| got | got: Input stream for the `+` side of the diff. | No |
+### `distinct()`
+
+distinct returns unique values from the `_value` column.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `fill()`
+
+fill replaces all null values in the `_value` column with a non-null value.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{B with _value: A}], ?usePrevious: bool, ?value: A) => stream[{B with _value: A}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| value | value: Value to replace null values with.
+ Data type must match the type of the `_value` column. | No |
+| usePrevious | usePrevious: Replace null values with the value of the previous non-null row. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `first()`
+
+first returns the first record with a non-null value in the `_value` column
+for each input table.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `group()`
+
+group introduces an `extend` mode to the existing `group()` function.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[A], columns: [string], mode: string) => stream[A] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| columns | columns: List of columns to use in the grouping operation. Default is `[]`. | Yes |
+| mode | mode: Grouping mode. `extend` is the only mode available to `experimental.group()`. | Yes |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `histogram()`
+
+histogram approximates the cumulative distribution of a dataset by counting
+data frequencies for a list of bins.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with _value: float}], bins: [float], ?normalize: bool) => stream[{A with le: float, _value: float}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| bins | bins: List of upper bounds to use when computing histogram frequencies,
+ including the maximum value of the data set. | Yes |
+| normalize | normalize: Convert count values into frequency values between 0 and 1.
+ Default is `false`. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `histogramQuantile()`
+
+histogramQuantile approximates a quantile given a histogram with the
+cumulative distribution of the dataset.
+
+#### Function type signature
+
+```flux
+(
+ <-tables: stream[{A with le: float, _value: float}],
+ ?minValue: float,
+ ?quantile: float,
+) => stream[{A with _value: float}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| quantile | quantile: Quantile to compute (`[0.0 - 1.0]`). | No |
+| minValue | minValue: Assumed minimum value of the dataset. Default is `0.0`. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `integral()`
+
+integral computes the area under the curve per unit of time of subsequent non-null records.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with _value: B, _time: time}], ?interpolate: string, ?unit: duration) => stream[{A with _value: B}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| unit | unit: Time duration used to compute the integral. | No |
+| interpolate | interpolate: Type of interpolation to use. Default is `""` (no interpolation). | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `join()`
+
+join joins two streams of tables on the **group key and `_time` column**.
+
+#### Function type signature
+
+```flux
+(fn: (left: A, right: B) => C, left: stream[A], right: stream[B]) => stream[C] where A: Record, B: Record, C: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| left | left: First of two streams of tables to join. | Yes |
+| right | right: Second of two streams of tables to join. | Yes |
+| fn | fn: Function with left and right arguments that maps a new output record
+ using values from the `left` and `right` input records.
+ The return value must be a record. | Yes |
+### `kaufmansAMA()`
+
+kaufmansAMA calculates the Kaufman's Adaptive Moving Average (KAMA) of input
+tables using the `_value` column in each table.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with _value: B}], n: int) => stream[{A with _value: float}] where B: Numeric
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| n | n: Period or number of points to use in the calculation. | Yes |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `last()`
+
+last returns the last record with a non-null value in the `_value` column
+for each input table.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `max()`
+
+max returns the record with the highest value in the `_value` column for each
+input table.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `mean()`
+
+mean computes the mean or average of non-null values in the `_value` column
+of each input table.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with _value: float}]) => stream[{A with _value: float}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `min()`
+
+min returns the record with the lowest value in the `_value` column for each
+input table.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `mode()`
+
+mode computes the mode or value that occurs most often in the `_value` column
+in each input table.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `objectKeys()`
+
+objectKeys returns an array of property keys in a specified record.
+
+#### Function type signature
+
+```flux
+(o: A) => [string] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| o | o: Record to return property keys from. | Yes |
+### `preview()`
+
+preview limits the number of rows and tables in the stream.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[A], ?nrows: int, ?ntables: int) => stream[A] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| nrows | nrows: Maximum number of rows per table to return. Default is `5`. | No |
+| ntables | ntables: Maximum number of tables to return.
+ Default is `5`. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `quantile()`
+
+quantile returns non-null records with values in the `_value` column that
+fall within the specified quantile or represent the specified quantile.
+
+#### Function type signature
+
+```flux
+(
+ <-tables: stream[{A with _value: float}],
+ q: float,
+ ?compression: float,
+ ?method: string,
+) => stream[{A with _value: float}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| q | q: Quantile to compute (`[0 - 1]`). | Yes |
+| method | method: Computation method. Default is `estimate_tdigest`. | No |
+| compression | compression: Number of centroids to use when compressing the dataset.
+ Default is `1000.0`. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `set()`
+
+set sets multiple static column values on all records.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[B], o: A) => stream[C] where A: Record, B: Record, C: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| o | o: Record that defines the columns and values to set. | Yes |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `skew()`
+
+skew returns the skew of non-null values in the `_value` column for each
+input table as a float.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with _value: float}]) => stream[{A with _value: float}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `spread()`
+
+spread returns the difference between the minimum and maximum values in the
+`_value` column for each input table.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}] where B: Numeric
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `stddev()`
+
+stddev returns the standard deviation of non-null values in the `_value`
+column for each input table.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with _value: float}], ?mode: string) => stream[{A with _value: float}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| mode | mode: Standard deviation mode or type of standard deviation to calculate.
+ Default is `sample`. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `subDuration()`
+
+subDuration subtracts a duration from a time value and returns the resulting time value.
+
+#### Function type signature
+
+```flux
+(d: duration, from: A, ?location: {zone: string, offset: duration}) => time where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| from | from: Time to subtract the duration from. | Yes |
+| d | d: Duration to subtract. | Yes |
+| location | location: Location to use for the time value. | No |
+### `sum()`
+
+sum returns the sum of non-null values in the `_value` column for each input table.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}] where B: Numeric
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `to()`
+
+to writes _pivoted_ data to an InfluxDB 2.x or InfluxDB Cloud bucket.
+
+#### Function type signature
+
+```flux
+(
+ <-tables: stream[A],
+ ?bucket: string,
+ ?bucketID: string,
+ ?host: string,
+ ?org: string,
+ ?orgID: string,
+ ?token: string,
+) => stream[A] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| bucket | bucket: Name of the bucket to write to.
+ _`bucket` and `bucketID` are mutually exclusive_. | No |
+| bucketID | bucketID: String-encoded bucket ID to to write to.
+ _`bucket` and `bucketID` are mutually exclusive_. | No |
+| host | host: URL of the InfluxDB instance to write to. | No |
+| org | org: Organization name.
+ _`org` and `orgID` are mutually exclusive_. | No |
+| orgID | orgID: String-encoded organization ID to query.
+ _`org` and `orgID` are mutually exclusive_. | No |
+| token | token: InfluxDB API token. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `unique()`
+
+unique returns all records containing unique values in the `_value` column.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `unpivot()`
+
+unpivot creates `_field` and `_value` columns pairs using all columns (other than `_time`)
+_not_ in the group key.
+The `_field` column contains the original column label and the `_value` column
+contains the original column value.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with _time: time}], ?otherColumns: [string]) => stream[{B with _value: C, _field: string}] where A: Record, B: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+| otherColumns | otherColumns: List of column names that are not in the group key but are also not field columns. Default is `["_time"]`. | No |
+### `window()`
+
+window groups records based on time.
+
+#### Function type signature
+
+```flux
+(
+ <-tables: stream[{A with _time: time, _stop: time, _start: time}],
+ ?createEmpty: bool,
+ ?every: duration,
+ ?location: {zone: string, offset: duration},
+ ?offset: duration,
+ ?period: duration,
+) => stream[{A with _time: time, _stop: time, _start: time}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| every | every: Duration of time between windows. Default is the `0s`. | No |
+| period | period: Duration of the window. Default is `0s`. | No |
+| offset | offset: Duration to shift the window boundaries by. Default is 0s. | No |
+| location | location: Location used to determine timezone. Default is the `location` option. | No |
+| createEmpty | createEmpty: Create empty tables for empty windows. Default is `false`. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
diff --git a/docs/experimental/aggregate.md b/docs/experimental/aggregate.md
new file mode 100644
index 0000000..157c9b7
--- /dev/null
+++ b/docs/experimental/aggregate.md
@@ -0,0 +1,31 @@
+## `aggregate` package
+
+Package aggregate provides functions to simplify common aggregate operations.
+
+Import the `aggregate` package:
+
+```flux
+import "aggregate"
+```
+
+### Functions
+
+### `rate()`
+
+rate calculates the average rate of increase per window of time for each
+input table.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[A], every: duration, ?groupColumns: [string], ?unit: duration) => stream[B] where A: Record, B: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| every | every: Duration of time windows. | Yes |
+| groupColumns | groupColumns: List of columns to group by. Default is `[]`. | No |
+| unit | unit: Time duration to use when calculating the rate. Default is `1s`. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
diff --git a/docs/experimental/array.md b/docs/experimental/array.md
new file mode 100644
index 0000000..57db3e8
--- /dev/null
+++ b/docs/experimental/array.md
@@ -0,0 +1,183 @@
+## `array` package
+
+Package array provides functions for manipulating arrays and for building tables from Flux arrays.
+
+Import the `array` package:
+
+```flux
+import "array"
+```
+
+### Functions
+
+### `concat()`
+
+concat appends two arrays and returns a new array.
+
+#### Function type signature
+
+```flux
+(<-arr: [A], v: [A]) => [A]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| arr | arr: First array. Default is the piped-forward array (`<-`). | No |
+| v | v: Array to append to the first array. | Yes |
+### `filter()`
+
+filter iterates over an array, evaluates each element with a predicate function, and then returns
+a new array with only elements that match the predicate.
+
+#### Function type signature
+
+```flux
+(<-arr: [A], fn: (x: A) => bool) => [A]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| arr | arr: Array to filter. Default is the piped-forward array (`<-`). | No |
+| fn | fn: Predicate function to evaluate on each element.
+ The element is represented by `x` in the predicate function. | Yes |
+### `from()`
+
+from constructs a table from an array of records.
+
+#### Function type signature
+
+```flux
+(<-rows: [A]) => stream[A] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| rows | rows: Array of records to construct a table with. | No |
+### `map()`
+
+map iterates over an array, applies a function to each element to produce a new element,
+and then returns a new array.
+
+#### Function type signature
+
+```flux
+(<-arr: [A], fn: (x: A) => B) => [B]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| arr | arr: Array to operate on. Defaults is the piped-forward array (`<-`). | No |
+| fn | fn: Function to apply to elements. The element is represented by `x` in the function. | Yes |
+### `toBool()`
+
+toBool converts all values in an array to booleans.
+
+#### Function type signature
+
+```flux
+(<-arr: [A]) => [bool]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| arr | arr: Array of values to convert. Default is the piped-forward array (`<-`). | No |
+### `toDuration()`
+
+toDuration converts all values in an array to durations.
+
+#### Function type signature
+
+```flux
+(<-arr: [A]) => [duration]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| arr | arr: Array of values to convert. Default is the piped-forward array (`<-`). | No |
+### `toFloat()`
+
+toFloat converts all values in an array to floats.
+
+#### Function type signature
+
+```flux
+(<-arr: [A]) => [float]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| arr | arr: Array of values to convert. Default is the piped-forward array (`<-`). | No |
+### `toInt()`
+
+toInt converts all values in an array to integers.
+
+#### Function type signature
+
+```flux
+(<-arr: [A]) => [int]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| arr | arr: Array of values to convert. Default is the piped-forward array (`<-`). | No |
+### `toString()`
+
+toString converts all values in an array to strings.
+
+#### Function type signature
+
+```flux
+(<-arr: [A]) => [string]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| arr | arr: Array of values to convert. Default is the piped-forward array (`<-`). | No |
+### `toTime()`
+
+toTime converts all values in an array to times.
+
+#### Function type signature
+
+```flux
+(<-arr: [A]) => [time]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| arr | arr: Array of values to convert. Default is the piped-forward array (`<-`). | No |
+### `toUInt()`
+
+toUInt converts all values in an array to unsigned integers.
+
+#### Function type signature
+
+```flux
+(<-arr: [A]) => [uint]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| arr | arr: Array of values to convert. Default is the piped-forward array (`<-`). | No |
diff --git a/docs/experimental/bigtable.md b/docs/experimental/bigtable.md
new file mode 100644
index 0000000..6b17535
--- /dev/null
+++ b/docs/experimental/bigtable.md
@@ -0,0 +1,31 @@
+## `bigtable` package
+
+Package bigtable provides tools for working with data in
+[Google Cloud Bigtable](https://cloud.google.com/bigtable/) databases.
+
+Import the `bigtable` package:
+
+```flux
+import "bigtable"
+```
+
+### Functions
+
+### `from()`
+
+from retrieves data from a [Google Cloud Bigtable](https://cloud.google.com/bigtable/) data source.
+
+#### Function type signature
+
+```flux
+(instance: string, project: string, table: string, token: string) => stream[A] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| token | token: Google Cloud IAM token to use to access the Cloud Bigtable database. | Yes |
+| project | project: Cloud Bigtable project ID. | Yes |
+| instance | instance: Cloud Bigtable instance ID. | Yes |
+| table | table: Cloud Bigtable table name. | Yes |
diff --git a/docs/experimental/bitwise.md b/docs/experimental/bitwise.md
new file mode 100644
index 0000000..ce1acfb
--- /dev/null
+++ b/docs/experimental/bitwise.md
@@ -0,0 +1,239 @@
+## `bitwise` package
+
+Package bitwise provides functions for performing bitwise operations on integers.
+
+Import the `bitwise` package:
+
+```flux
+import "bitwise"
+```
+
+### Functions
+
+### `sand()`
+
+sand performs the bitwise operation, `a AND b`, with integers.
+
+#### Function type signature
+
+```flux
+(a: int, b: int) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Right hand operand. | Yes |
+### `sclear()`
+
+sclear performs the bitwise operation `a AND NOT b`.
+Both `a` and `b` are integers.
+
+#### Function type signature
+
+```flux
+(a: int, b: int) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Bits to clear. | Yes |
+### `slshift()`
+
+slshift shifts the bits in `a` left by `b` bits.
+Both `a` and `b` are integers.
+
+#### Function type signature
+
+```flux
+(a: int, b: int) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Number of bits to shift. | Yes |
+### `snot()`
+
+snot inverts every bit in `a`, an integer.
+
+#### Function type signature
+
+```flux
+(a: int) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Integer to invert. | Yes |
+### `sor()`
+
+sor performs the bitwise operation, `a OR b`, with integers.
+
+#### Function type signature
+
+```flux
+(a: int, b: int) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Right hand operand. | Yes |
+### `srshift()`
+
+srshift shifts the bits in `a` right by `b` bits.
+Both `a` and `b` are integers.
+
+#### Function type signature
+
+```flux
+(a: int, b: int) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Number of bits to shift. | Yes |
+### `sxor()`
+
+sxor performs the bitwise operation, `a XOR b`, with integers.
+
+#### Function type signature
+
+```flux
+(a: int, b: int) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Right hand operand. | Yes |
+### `uand()`
+
+uand performs the bitwise operation, `a AND b`, with unsigned integers.
+
+#### Function type signature
+
+```flux
+(a: uint, b: uint) => uint
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Right hand operand. | Yes |
+### `uclear()`
+
+uclear performs the bitwise operation `a AND NOT b`, with unsigned integers.
+
+#### Function type signature
+
+```flux
+(a: uint, b: uint) => uint
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Bits to clear. | Yes |
+### `ulshift()`
+
+ulshift shifts the bits in `a` left by `b` bits.
+Both `a` and `b` are unsigned integers.
+
+#### Function type signature
+
+```flux
+(a: uint, b: uint) => uint
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Number of bits to shift. | Yes |
+### `unot()`
+
+unot inverts every bit in `a`, an unsigned integer.
+
+#### Function type signature
+
+```flux
+(a: uint) => uint
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Unsigned integer to invert. | Yes |
+### `uor()`
+
+uor performs the bitwise operation, `a OR b`, with unsigned integers.
+
+#### Function type signature
+
+```flux
+(a: uint, b: uint) => uint
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Right hand operand. | Yes |
+### `urshift()`
+
+urshift shifts the bits in `a` right by `b` bits.
+Both `a` and `b` are unsigned integers.
+
+#### Function type signature
+
+```flux
+(a: uint, b: uint) => uint
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Number of bits to shift. | Yes |
+### `uxor()`
+
+uxor performs the bitwise operation, `a XOR b`, with unsigned integers.
+
+#### Function type signature
+
+```flux
+(a: uint, b: uint) => uint
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| a | a: Left hand operand. | Yes |
+| b | b: Right hand operand. | Yes |
diff --git a/docs/experimental/csv.md b/docs/experimental/csv.md
new file mode 100644
index 0000000..dec9a6c
--- /dev/null
+++ b/docs/experimental/csv.md
@@ -0,0 +1,27 @@
+## `csv` package
+
+Package csv provides functions for retrieving annotated CSV.
+
+Import the `csv` package:
+
+```flux
+import "csv"
+```
+
+### Functions
+
+### `from()`
+
+from retrieves [annotated CSV](https://docs.influxdata.com/influxdb/latest/reference/syntax/annotated-csv/) **from a URL**.
+
+#### Function type signature
+
+```flux
+(url: string) => stream[A] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: URL to retrieve annotated CSV from. | Yes |
diff --git a/docs/experimental/date/boundaries.md b/docs/experimental/date/boundaries.md
new file mode 100644
index 0000000..d55ceb8
--- /dev/null
+++ b/docs/experimental/date/boundaries.md
@@ -0,0 +1,157 @@
+## `boundaries` package
+
+Package boundaries provides operators for finding the boundaries around certain days, months, and weeks.
+
+Import the `boundaries` package:
+
+```flux
+import "boundaries"
+```
+
+### Functions
+
+### `friday()`
+
+friday returns a record with `start` and `stop` boundary timestamps for last Friday.
+
+#### Function type signature
+
+```flux
+() => {stop: time, start: time}
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `monday()`
+
+monday returns a record with `start` and `stop` boundary timestamps of last Monday.
+Last Monday is relative to `now()`. If today is Monday, the function returns boundaries for the previous Monday.
+
+#### Function type signature
+
+```flux
+() => {stop: time, start: time}
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `month()`
+
+month returns a record with `start` and `stop` boundary timestamps for the current month.
+
+#### Function type signature
+
+```flux
+(?month_offset: int) => {stop: time, start: time}
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| month_offset | month_offset: Number of months to offset from the current month. Default is `0`. | No |
+### `saturday()`
+
+saturday returns a record with `start` and `stop` boundary timestamps for last Saturday.
+
+#### Function type signature
+
+```flux
+() => {stop: time, start: time}
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `sunday()`
+
+sunday returns a record with `start` and `stop` boundary timestamps for last Sunday.
+
+#### Function type signature
+
+```flux
+() => {stop: time, start: time}
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `thursday()`
+
+thursday returns a record with `start` and `stop` boundary timestamps for last Thursday.
+
+#### Function type signature
+
+```flux
+() => {stop: time, start: time}
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `tuesday()`
+
+tuesday returns a record with `start` and `stop` boundary timestamps of last Tuesday.
+
+#### Function type signature
+
+```flux
+() => {stop: time, start: time}
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `wednesday()`
+
+wednesday returns a record with `start` and `stop` boundary timestamps for last Wednesday.
+
+#### Function type signature
+
+```flux
+() => {stop: time, start: time}
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `week()`
+
+week returns a record with `start` and `stop` boundary timestamps of the current week.
+By default, weeks start on Monday.
+
+#### Function type signature
+
+```flux
+(?start_sunday: bool, ?week_offset: int) => {stop: time, start: time}
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| start_sunday | start_sunday: Indicate if the week starts on Sunday. Default is `false`. | No |
+| week_offset | week_offset: Number of weeks to offset from the current week. Default is `0`. | No |
+### `yesterday()`
+
+yesterday returns a record with `start` and `stop` boundary timestamps for yesterday.
+
+#### Function type signature
+
+```flux
+() => {stop: time, start: time}
+```
+
+#### Parameters
+
+No parameters provided.
+
diff --git a/docs/experimental/dynamic.md b/docs/experimental/dynamic.md
new file mode 100644
index 0000000..8f81331
--- /dev/null
+++ b/docs/experimental/dynamic.md
@@ -0,0 +1,88 @@
+## `dynamic` package
+
+Package dynamic provides tools for working with values of unknown types.
+
+Import the `dynamic` package:
+
+```flux
+import "dynamic"
+```
+
+### Functions
+
+### `asArray()`
+
+asArray converts a dynamic value into an array of dynamic elements.
+
+#### Function type signature
+
+```flux
+(<-v: dynamic) => [dynamic]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| v | v: Dynamic value to convert. Default is the piped-forward value (`<-`). | No |
+### `dynamic()`
+
+dynamic wraps a value so it can be used as a `dynamic` value.
+
+#### Function type signature
+
+```flux
+(v: A) => dynamic
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| v | v: Value to wrap as dynamic. | Yes |
+### `isType()`
+
+isType tests if a dynamic type holds a value of a specified type.
+
+#### Function type signature
+
+```flux
+(type: string, v: dynamic) => bool
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| v | v: Value to test. | Yes |
+| type | type: String describing the type to check against. | Yes |
+### `jsonEncode()`
+
+jsonEncode converts a dynamic value into JSON bytes.
+
+#### Function type signature
+
+```flux
+(v: dynamic) => bytes
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| v | v: Value to encode into JSON. | Yes |
+### `jsonParse()`
+
+jsonParse takes JSON data as bytes and returns dynamic values.
+
+#### Function type signature
+
+```flux
+(data: bytes) => dynamic
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| data | data: JSON data (as bytes) to parse. | Yes |
diff --git a/docs/experimental/geo.md b/docs/experimental/geo.md
new file mode 100644
index 0000000..7fccfa9
--- /dev/null
+++ b/docs/experimental/geo.md
@@ -0,0 +1,449 @@
+## `geo` package
+
+Package geo provides tools for working with geotemporal data, such as
+filtering and grouping by geographic location.
+
+Import the `geo` package:
+
+```flux
+import "geo"
+```
+
+### Functions
+
+### `ST_Contains()`
+
+ST_Contains returns boolean indicating whether the defined region contains a
+specified GIS geometry.
+
+#### Function type signature
+
+```flux
+(geometry: A, region: B, ?units: {distance: string}) => bool where A: Record, B: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| region | region: Region to test. Specify record properties for the shape. | Yes |
+| geometry | geometry: GIS geometry to test. Can be either point or linestring geometry. | Yes |
+| units | units: Record that defines the unit of measurement for distance.
+ Default is the `geo.units` option. | No |
+### `ST_DWithin()`
+
+ST_DWithin tests if the specified region is within a defined distance from
+the specified GIS geometry and returns `true` or `false`.
+
+#### Function type signature
+
+```flux
+(distance: A, geometry: B, region: C, ?units: {distance: string}) => bool where A: Comparable + Equatable, B: Record, C: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| region | region: Region to test. Specify record properties for the shape. | Yes |
+| geometry | geometry: GIS geometry to test. Can be either point or linestring geometry. | Yes |
+| distance | distance: Maximum distance allowed between the region and geometry.
+ Define distance units with the `geo.units` option. | Yes |
+| units | units: Record that defines the unit of measurement for distance.
+ Default is the `geo.units` option. | No |
+### `ST_Distance()`
+
+ST_Distance returns the distance from a given region to a specified GIS geometry.
+
+#### Function type signature
+
+```flux
+(geometry: A, region: B, ?units: {distance: string}) => float where A: Record, B: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| region | region: Region to test. Specify record properties for the shape. | Yes |
+| geometry | geometry: GIS geometry to test. Can be either point or linestring geometry. | Yes |
+| units | units: Record that defines the unit of measurement for distance.
+ Default is the `geo.units` option. | No |
+### `ST_Intersects()`
+
+ST_Intersects tests if the specified GIS geometry intersects with the
+specified region and returns `true` or `false`.
+
+#### Function type signature
+
+```flux
+(geometry: A, region: B, ?units: {distance: string}) => bool where A: Record, B: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| region | region: Region to test. Specify record properties for the shape. | Yes |
+| geometry | geometry: GIS geometry to test. Can be either point or linestring geometry. | Yes |
+| units | units: Record that defines the unit of measurement for distance.
+ Default is the `geo.units` option. | No |
+### `ST_Length()`
+
+ST_Length returns the [spherical length or distance](https://mathworld.wolfram.com/SphericalDistance.html)
+of the specified GIS geometry.
+
+#### Function type signature
+
+```flux
+(geometry: A, ?units: {distance: string}) => float where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| geometry | geometry: GIS geometry to test. Can be either point or linestring geometry.
+ Point geometry will always return `0.0`. | Yes |
+| units | units: Record that defines the unit of measurement for distance. | No |
+### `ST_LineString()`
+
+ST_LineString converts a series of geographic points into linestring.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{A with lon: C, lat: B}]) => stream[D] where D: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `asTracks()`
+
+asTracks groups rows into tracks (sequential, related data points).
+
+#### Function type signature
+
+```flux
+(<-tables: stream[A], ?groupBy: [string], ?orderBy: [string]) => stream[A] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| groupBy | groupBy: Columns to group by. These columns should uniquely identify each track.
+ Default is `["id","tid"]`. | No |
+| orderBy | orderBy: Columns to order results by. Default is `["_time"]`. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `filterRows()`
+
+filterRows filters data by a specified geographic region with the option of strict filtering.
+
+#### Function type signature
+
+```flux
+(
+ <-tables: stream[{B with s2_cell_id: string, lon: D, lat: C}],
+ region: A,
+ ?level: int,
+ ?maxSize: int,
+ ?minSize: int,
+ ?s2cellIDLevel: int,
+ ?strict: bool,
+) => stream[{B with s2_cell_id: string, lon: D, lat: C}] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| region | region: Region containing the desired data points. | Yes |
+| minSize | minSize: Minimum number of cells that cover the specified region.
+ Default is `24`. | No |
+| maxSize | maxSize: Maximum number of cells that cover the specified region.
+ Default is `-1` (unlimited). | No |
+| level | level: [S2 cell level](https://s2geometry.io/resources/s2cell_statistics.html)
+ of grid cells. Default is `-1`. | No |
+| s2cellIDLevel | s2cellIDLevel: [S2 cell level](https://s2geometry.io/resources/s2cell_statistics.html)
+ used in the `s2_cell_id` tag. Default is `-1` (detects S2 cell level from the `s2_cell_id` tag). | No |
+| strict | strict: Enable strict geographic data filtering. Default is `true`. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `getGrid()`
+
+getGrid calculates a grid or set of cell ID tokens for a specified region.
+
+#### Function type signature
+
+```flux
+(
+ region: A,
+ units: {distance: string},
+ ?level: int,
+ ?maxLevel: int,
+ ?maxSize: int,
+ ?minSize: int,
+) => {set: [string], level: int} where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| region | region: Region used to return S2 cell ID tokens.
+ Specify record properties for the region shape. | Yes |
+| minSize | minSize: Minimum number of cells that cover the specified region. | No |
+| maxSize | maxSize: Minimum number of cells that cover the specified region. | No |
+| level | level: S2 cell level of grid cells. | No |
+| maxLevel | maxLevel: Maximumn S2 cell level of grid cells. | No |
+| units | units: Record that defines the unit of measurement for distance. | Yes |
+### `getLevel()`
+
+getLevel returns the S2 cell level of specified cell ID token.
+
+#### Function type signature
+
+```flux
+(token: string) => int
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| token | token: S2 cell ID token. | Yes |
+### `gridFilter()`
+
+gridFilter filters data by a specified geographic region.
+
+#### Function type signature
+
+```flux
+(
+ <-tables: stream[{B with s2_cell_id: string}],
+ region: A,
+ ?level: int,
+ ?maxSize: int,
+ ?minSize: int,
+ ?s2cellIDLevel: int,
+ ?units: {distance: string},
+) => stream[{B with s2_cell_id: string}] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| region | region: Region containing the desired data points. | Yes |
+| minSize | minSize: Minimum number of cells that cover the specified region.
+ Default is `24`. | No |
+| maxSize | maxSize: Maximum number of cells that cover the specified region.
+ Default is `-1` (unlimited). | No |
+| level | level: [S2 cell level](https://s2geometry.io/resources/s2cell_statistics.html)
+ of grid cells. Default is `-1`. | No |
+| s2cellIDLevel | s2cellIDLevel: [S2 cell level](https://s2geometry.io/resources/s2cell_statistics.html)
+ used in the `s2_cell_id` tag. Default is `-1` (detects S2 cell level from the S2 cell ID token). | No |
+| units | units: Record that defines the unit of measurement for distance.
+ Default is the `geo.units` option. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `groupByArea()`
+
+groupByArea groups rows by geographic area.
+
+#### Function type signature
+
+```flux
+(
+ <-tables: stream[{A with s2_cell_id: string, lon: float, lat: float}],
+ level: int,
+ newColumn: string,
+ ?s2cellIDLevel: int,
+) => stream[B] where B: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| newColumn | newColumn: Name of the new column for the unique identifier for each geographic area. | Yes |
+| level | level: [S2 Cell level](https://s2geometry.io/resources/s2cell_statistics.html)
+ used to determine the size of each geographic area. | Yes |
+| s2cellIDLevel | s2cellIDLevel: [S2 Cell level](https://s2geometry.io/resources/s2cell_statistics.html)
+ used in the `s2_cell_id` tag. Default is `-1` (detects S2 cell level from the `s2_cell_id` tag). | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `s2CellIDToken()`
+
+s2CellIDToken returns and S2 cell ID token for given cell or point at a
+specified S2 cell level.
+
+#### Function type signature
+
+```flux
+(level: int, ?point: {lon: float, lat: float}, ?token: string) => string
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| token | token: S2 cell ID token to update. | No |
+| point | point: Record with `lat` and `lon` properties that specify the latitude and
+ longitude in decimal degrees (WGS 84) of a point. | No |
+| level | level: S2 cell level to use when generating the S2 cell ID token. | Yes |
+### `s2CellLatLon()`
+
+s2CellLatLon returns the latitude and longitude of the center of an S2 cell.
+
+#### Function type signature
+
+```flux
+(token: string) => {lon: float, lat: float}
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| token | token: S2 cell ID token. | Yes |
+### `shapeData()`
+
+shapeData renames existing latitude and longitude fields to **lat** and **lon**
+and adds an **s2\_cell\_id** tag.
+
+#### Function type signature
+
+```flux
+(
+ <-tables: stream[{C with _field: string}],
+ latField: A,
+ level: int,
+ lonField: B,
+) => stream[{D with s2_cell_id: string, lon: float, lat: float}] where A: Equatable, B: Equatable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| latField | latField: Name of the existing field that contains the latitude value in decimal degrees (WGS 84). | Yes |
+| lonField | lonField: Name of the existing field that contains the longitude value in decimal degrees (WGS 84). | Yes |
+| level | level: [S2 cell level](https://s2geometry.io/resources/s2cell_statistics.html)
+ to use when generating the S2 cell ID token. | Yes |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `stContains()`
+
+stContains returns boolean indicating whether the defined region contains a specified GIS geometry.
+
+#### Function type signature
+
+```flux
+(geometry: A, region: B, units: {distance: string}) => bool where A: Record, B: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| region | region: Region to test. Specify record properties for the shape. | Yes |
+| geometry | geometry: GIS geometry to test. Can be either point or linestring geometry. | Yes |
+| units | units: Record that defines the unit of measurement for distance. | Yes |
+### `stDistance()`
+
+stDistance returns the distance from a given region to a specified GIS geometry.
+
+#### Function type signature
+
+```flux
+(geometry: A, region: B, units: {distance: string}) => float where A: Record, B: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| region | region: Region to test. Specify record properties for the shape. | Yes |
+| geometry | geometry: GIS geometry to test. Can be either point or linestring geometry. | Yes |
+| units | units: Record that defines the unit of measurement for distance. | Yes |
+### `stLength()`
+
+stLength returns the [spherical length or distance](https://mathworld.wolfram.com/SphericalDistance.html)
+of the specified GIS geometry.
+
+#### Function type signature
+
+```flux
+(geometry: A, units: {distance: string}) => float where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| geometry | geometry: GIS geometry to test. Can be either point or linestring geometry.
+ Point geometry will always return `0.0`. | Yes |
+| units | units: Record that defines the unit of measurement for distance. | Yes |
+### `strictFilter()`
+
+strictFilter filters data by latitude and longitude in a specified region.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{B with lon: D, lat: C}], region: A) => stream[{B with lon: D, lat: C}] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| region | region: Region containing the desired data points. | Yes |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `toRows()`
+
+toRows pivots fields into columns based on time.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[A]) => stream[B] where A: Record, B: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `totalDistance()`
+
+totalDistance calculates the total distance covered by subsequent points
+in each input table.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{B with lon: float, lat: float}], ?outputColumn: A) => stream[C] where C: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| outputColumn | outputColumn: Total distance output column. Default is `_value`. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `units()`
+
+units defines the unit of measurment used in geotemporal operations.
+
+#### Function type signature
+
+```flux
+{distance: string}
+```
+
+#### Parameters
+
+No parameters provided.
+
diff --git a/docs/experimental/http.md b/docs/experimental/http.md
new file mode 100644
index 0000000..60a5bfd
--- /dev/null
+++ b/docs/experimental/http.md
@@ -0,0 +1,30 @@
+## `http` package
+
+Package http provides functions for transferring data using HTTP protocol.
+
+Import the `http` package:
+
+```flux
+import "http"
+```
+
+### Functions
+
+### `get()`
+
+get submits an HTTP GET request to the specified URL and returns the HTTP
+status code, response body, and response headers.
+
+#### Function type signature
+
+```flux
+(url: string, ?headers: A, ?timeout: duration) => {statusCode: int, headers: B, body: bytes} where A: Record, B: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: URL to send the GET request to. | Yes |
+| headers | headers: Headers to include with the GET request. | No |
+| timeout | timeout: Timeout for the GET request. Default is `30s`. | No |
diff --git a/docs/experimental/http/requests.md b/docs/experimental/http/requests.md
new file mode 100644
index 0000000..d2c694c
--- /dev/null
+++ b/docs/experimental/http/requests.md
@@ -0,0 +1,129 @@
+## `requests` package
+
+Package requests provides functions for transferring data using the HTTP protocol.
+
+Import the `requests` package:
+
+```flux
+import "requests"
+```
+
+### Functions
+
+### `defaultConfig()`
+
+defaultConfig is the global default for all http requests using the requests package.
+Changing this config will affect all other packages using the requests package.
+To change the config for a single request, pass a new config directly into the corresponding function.
+
+#### Function type signature
+
+```flux
+{timeout: duration, insecureSkipVerify: bool}
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `do()`
+
+do makes an http request.
+
+#### Function type signature
+
+```flux
+(
+ method: string,
+ url: string,
+ ?body: bytes,
+ ?config: {A with timeout: duration, insecureSkipVerify: bool},
+ ?headers: [string:string],
+ ?params: [string:[string]],
+) => {statusCode: int, headers: [string:string], duration: duration, body: bytes}
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| method | method: method of the http request.
+ Supported methods: DELETE, GET, HEAD, PATCH, POST, PUT. | Yes |
+| url | url: URL to request. This should not include any query parameters. | Yes |
+| params | params: Set of key value pairs to add to the URL as query parameters.
+ Query parameters will be URL encoded.
+ All values for a key will be appended to the query. | No |
+| headers | headers: Set of key values pairs to include on the request. | No |
+| body | body: Data to send with the request. | No |
+| config | config: Set of options to control how the request should be performed. | No |
+### `get()`
+
+get makes a http GET request. This identical to calling `request.do(method: "GET", ...)`.
+
+#### Function type signature
+
+```flux
+(
+ url: string,
+ ?body: bytes,
+ ?config: {A with timeout: duration, insecureSkipVerify: bool},
+ ?headers: [string:string],
+ ?params: [string:[string]],
+) => {statusCode: int, headers: [string:string], duration: duration, body: bytes}
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: URL to request. This should not include any query parameters. | Yes |
+| params | params: Set of key value pairs to add to the URL as query parameters.
+ Query parameters will be URL encoded.
+ All values for a key will be appended to the query. | No |
+| headers | headers: Set of key values pairs to include on the request. | No |
+| body | body: Data to send with the request. | No |
+| config | config: Set of options to control how the request should be performed. | No |
+### `peek()`
+
+peek converts an HTTP response into a table for easy inspection.
+
+#### Function type signature
+
+```flux
+(
+ response: {A with statusCode: E, headers: D, duration: C, body: B},
+) => stream[{statusCode: E, headers: string, duration: int, body: string}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| response | response: Response data from an HTTP request. | Yes |
+### `post()`
+
+post makes a http POST request. This identical to calling `request.do(method: "POST", ...)`.
+
+#### Function type signature
+
+```flux
+(
+ url: string,
+ ?body: bytes,
+ ?config: {A with timeout: duration, insecureSkipVerify: bool},
+ ?headers: [string:string],
+ ?params: [string:[string]],
+) => {statusCode: int, headers: [string:string], duration: duration, body: bytes}
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: URL to request. This should not include any query parameters. | Yes |
+| params | params: Set of key value pairs to add to the URL as query parameters.
+ Query parameters will be URL encoded.
+ All values for a key will be appended to the query. | No |
+| headers | headers: Set of key values pairs to include on the request. | No |
+| body | body: Data to send with the request. | No |
+| config | config: Set of options to control how the request should be performed. | No |
diff --git a/docs/experimental/influxdb.md b/docs/experimental/influxdb.md
new file mode 100644
index 0000000..374b7c7
--- /dev/null
+++ b/docs/experimental/influxdb.md
@@ -0,0 +1,47 @@
+## `influxdb` package
+
+Package influxdb provides tools for working with the InfluxDB API.
+
+Import the `influxdb` package:
+
+```flux
+import "influxdb"
+```
+
+### Functions
+
+### `api()`
+
+api submits an HTTP request to the specified InfluxDB API path and returns a
+record containing the HTTP status code, response headers, and the response body.
+
+#### Function type signature
+
+```flux
+(
+ method: string,
+ path: string,
+ ?body: bytes,
+ ?headers: [string:string],
+ ?host: string,
+ ?query: [string:string],
+ ?timeout: duration,
+ ?token: string,
+) => {statusCode: int, headers: [string:string], body: bytes}
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| method | method: HTTP request method. | Yes |
+| path | path: InfluxDB API path. | Yes |
+| host | host: InfluxDB host URL _(Required when executed outside of InfluxDB)_.
+ Default is `""`. | No |
+| token | token: [InfluxDB API token](https://docs.influxdata.com/influxdb/cloud/security/tokens/)
+ _(Required when executed outside of InfluxDB)_.
+ Default is `""`. | No |
+| headers | headers: HTTP request headers. | No |
+| query | query: URL query parameters. | No |
+| timeout | timeout: HTTP request timeout. Default is `30s`. | No |
+| body | body: HTTP request body as bytes. | No |
diff --git a/docs/experimental/iox.md b/docs/experimental/iox.md
new file mode 100644
index 0000000..3484656
--- /dev/null
+++ b/docs/experimental/iox.md
@@ -0,0 +1,59 @@
+## `iox` package
+
+Package iox provides functions for querying data from IOx.
+
+Import the `iox` package:
+
+```flux
+import "iox"
+```
+
+### Functions
+
+### `from()`
+
+from reads from the selected bucket and measurement in an IOx storage node.
+
+#### Function type signature
+
+```flux
+(bucket: string, measurement: string) => stream[{A with _time: time}] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| bucket | bucket: IOx bucket to read data from. | Yes |
+| measurement | measurement: Measurement to read data from. | Yes |
+### `sql()`
+
+sql executes an SQL query against a bucket in an IOx storage node.
+
+#### Function type signature
+
+```flux
+(bucket: string, query: string) => stream[A] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| bucket | bucket: IOx bucket to read data from. | Yes |
+| query | query: SQL query to execute. | Yes |
+### `sqlInterval()`
+
+sqlInterval converts a duration value to a SQL interval string.
+
+#### Function type signature
+
+```flux
+(d: A) => string
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| d | d: Duration value to convert to SQL interval string. | Yes |
diff --git a/docs/experimental/json.md b/docs/experimental/json.md
new file mode 100644
index 0000000..aa8d401
--- /dev/null
+++ b/docs/experimental/json.md
@@ -0,0 +1,27 @@
+## `json` package
+
+Package json provides tools for working with JSON.
+
+Import the `json` package:
+
+```flux
+import "json"
+```
+
+### Functions
+
+### `parse()`
+
+parse takes JSON data as bytes and returns a value.
+
+#### Function type signature
+
+```flux
+(data: bytes) => A
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| data | data: JSON data (as bytes) to parse. | Yes |
diff --git a/docs/experimental/mqtt.md b/docs/experimental/mqtt.md
new file mode 100644
index 0000000..d0b6014
--- /dev/null
+++ b/docs/experimental/mqtt.md
@@ -0,0 +1,92 @@
+## `mqtt` package
+
+Package mqtt provides tools for working with Message Queuing Telemetry Transport (MQTT) protocol.
+
+Import the `mqtt` package:
+
+```flux
+import "mqtt"
+```
+
+### Functions
+
+### `publish()`
+
+publish sends data to an MQTT broker using MQTT protocol.
+
+#### Function type signature
+
+```flux
+(
+ broker: string,
+ message: string,
+ topic: string,
+ ?clientid: string,
+ ?password: string,
+ ?qos: int,
+ ?retain: bool,
+ ?timeout: duration,
+ ?username: string,
+) => bool
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| broker | broker: MQTT broker connection string. | Yes |
+| topic | topic: MQTT topic to send data to. | Yes |
+| message | message: Message to send to the MQTT broker. | Yes |
+| qos | qos: MQTT Quality of Service (QoS) level. Values range from `[0-2]`.
+ Default is `0`. | No |
+| retain | retain: MQTT retain flag. Default is `false`. | No |
+| clientid | clientid: MQTT client ID. | No |
+| username | username: Username to send to the MQTT broker. | No |
+| password | password: Password to send to the MQTT broker. | No |
+| timeout | timeout: MQTT connection timeout. Default is `1s`. | No |
+### `to()`
+
+to outputs data from a stream of tables to an MQTT broker using MQTT protocol.
+
+#### Function type signature
+
+```flux
+(
+ <-tables: stream[A],
+ broker: string,
+ ?clientid: string,
+ ?name: string,
+ ?password: string,
+ ?qos: int,
+ ?retain: bool,
+ ?tagColumns: [string],
+ ?timeColumn: string,
+ ?timeout: duration,
+ ?topic: string,
+ ?username: string,
+ ?valueColumns: [string],
+) => stream[B] where A: Record, B: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| broker | broker: MQTT broker connection string. | Yes |
+| topic | topic: MQTT topic to send data to. | No |
+| qos | qos: MQTT Quality of Service (QoS) level. Values range from `[0-2]`. Default is `0`. | No |
+| retain | retain: MQTT retain flag. Default is `false`. | No |
+| clientid | clientid: MQTT client ID. | No |
+| username | username: Username to send to the MQTT broker. | No |
+| password | password: Password to send to the MQTT broker.
+ Password is only required if the broker requires authentication.
+ If you provide a password, you must provide a username. | No |
+| name | name: Name for the MQTT message. | No |
+| timeout | timeout: MQTT connection timeout. Default is `1s`. | No |
+| timeColumn | timeColumn: Column to use as time values in the output line protocol.
+ Default is `"_time"`. | No |
+| tagColumns | tagColumns: Columns to use as tag sets in the output line protocol.
+ Default is `[]`. | No |
+| valueColumns | valueColumns: Columns to use as field values in the output line protocol.
+ Default is `["_value"]`. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
diff --git a/docs/experimental/oee.md b/docs/experimental/oee.md
new file mode 100644
index 0000000..1a5ec0e
--- /dev/null
+++ b/docs/experimental/oee.md
@@ -0,0 +1,83 @@
+## `oee` package
+
+Package oee provides functions for calculating overall equipment effectiveness (OEE).
+
+Import the `oee` package:
+
+```flux
+import "oee"
+```
+
+### Functions
+
+### `APQ()`
+
+APQ computes availability, performance, quality (APQ) and overall equipment
+effectiveness (OEE) in producing parts.
+
+#### Function type signature
+
+```flux
+(
+ <-tables: stream[D],
+ idealCycleTime: A,
+ plannedTime: B,
+ runningState: C,
+) => stream[{
+ E with
+ runTime: G,
+ quality: float,
+ performance: float,
+ oee: float,
+ availability: float,
+ _time: F,
+ _stop: F,
+}] where C: Equatable, D: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| runningState | runningState: State value that represents a running state. | Yes |
+| plannedTime | plannedTime: Total time that equipment is expected to produce parts. | Yes |
+| idealCycleTime | idealCycleTime: Ideal minimum time to produce one part. | Yes |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+### `computeAPQ()`
+
+computeAPQ computes availability, performance, and quality (APQ)
+and overall equipment effectiveness (OEE) using two separate input streams:
+**production events** and **part events**.
+
+#### Function type signature
+
+```flux
+(
+ idealCycleTime: A,
+ partEvents: stream[B],
+ plannedTime: C,
+ productionEvents: stream[D],
+ runningState: E,
+) => stream[{
+ F with
+ runTime: H,
+ quality: float,
+ performance: float,
+ oee: float,
+ availability: float,
+ _time: G,
+ _stop: G,
+}] where B: Record, D: Record, E: Equatable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| productionEvents | productionEvents: Production events stream that contains the production
+ state or start and stop events. | Yes |
+| partEvents | partEvents: Part events that contains the running totals of parts produced and
+ parts that do not meet quality standards. | Yes |
+| runningState | runningState: State value that represents a running state. | Yes |
+| plannedTime | plannedTime: Total time that equipment is expected to produce parts. | Yes |
+| idealCycleTime | idealCycleTime: Ideal minimum time to produce one part. | Yes |
diff --git a/docs/experimental/polyline.md b/docs/experimental/polyline.md
new file mode 100644
index 0000000..087ae61
--- /dev/null
+++ b/docs/experimental/polyline.md
@@ -0,0 +1,38 @@
+## `polyline` package
+
+Package polyline provides methods for polyline simplication, an efficient way of downsampling curves while retaining moments of variation throughout the path.
+
+Import the `polyline` package:
+
+```flux
+import "polyline"
+```
+
+### Functions
+
+### `rdp()`
+
+rdp applies the Ramer Douglas Peucker (RDP) algorithm to input data to downsample curves composed
+of line segments into visually indistinguishable curves with fewer points.
+
+#### Function type signature
+
+```flux
+(
+ <-tables: stream[A],
+ ?epsilon: float,
+ ?retention: float,
+ ?timeColumn: string,
+ ?valColumn: string,
+) => stream[B] where A: Record, B: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| valColumn | valColumn: Column with Y axis values of the given curve. Default is `_value`. | No |
+| timeColumn | timeColumn: Column with X axis values of the given curve. Default is `_time`. | No |
+| epsilon | epsilon: Maximum tolerance value that determines the amount of compression. | No |
+| retention | retention: Percentage of points to retain after downsampling. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
diff --git a/docs/experimental/prometheus.md b/docs/experimental/prometheus.md
new file mode 100644
index 0000000..9ace133
--- /dev/null
+++ b/docs/experimental/prometheus.md
@@ -0,0 +1,51 @@
+## `prometheus` package
+
+Package prometheus provides tools for working with
+[Prometheus-formatted metrics](https://prometheus.io/docs/instrumenting/exposition_formats/).
+
+Import the `prometheus` package:
+
+```flux
+import "prometheus"
+```
+
+### Functions
+
+### `histogramQuantile()`
+
+histogramQuantile calculates a quantile on a set of Prometheus histogram values.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[{B with le: D, _field: C}], quantile: float, ?metricVersion: A, ?onNonmonotonic: string) => stream[E] where A: Equatable, C: Equatable, E: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| quantile | quantile: Quantile to compute. Must be a float value between 0.0 and 1.0. | Yes |
+| metricVersion | metricVersion: [Prometheus metric parsing format](https://docs.influxdata.com/influxdb/latest/reference/prometheus-metrics/)
+ used to parse queried Prometheus data.
+ Available versions are `1` and `2`.
+ Default is `2`. | No |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
+| onNonmonotonic | onNonmonotonic: Describes behavior when counts are not monotonically increasing
+ when sorted by upper bound. Default is `error`. | No |
+### `scrape()`
+
+scrape scrapes Prometheus metrics from an HTTP-accessible endpoint and returns
+them as a stream of tables.
+
+#### Function type signature
+
+```flux
+(url: string) => stream[A] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: URL to scrape Prometheus metrics from. | Yes |
diff --git a/docs/experimental/query.md b/docs/experimental/query.md
new file mode 100644
index 0000000..50b6ed8
--- /dev/null
+++ b/docs/experimental/query.md
@@ -0,0 +1,120 @@
+## `query` package
+
+Package query provides functions meant to simplify common InfluxDB queries.
+
+Import the `query` package:
+
+```flux
+import "query"
+```
+
+### Functions
+
+### `filterFields()`
+
+filterFields filters input data by field.
+
+#### Function type signature
+
+```flux
+(<-table: stream[{B with _field: A}], ?fields: [A]) => stream[{B with _field: A}] where A: Nullable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| fields | fields: Fields to filter by. Default is `[]`. | No |
+| table | table: Input data. Default is piped-forward data (`<-`). | No |
+### `filterMeasurement()`
+
+filterMeasurement filters input data by measurement.
+
+#### Function type signature
+
+```flux
+(<-table: stream[{B with _measurement: C}], measurement: A) => stream[{B with _measurement: C}] where A: Equatable, C: Equatable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| measurement | measurement: InfluxDB measurement name to filter by. | Yes |
+| table | table: Input data. Default is piped-forward data (`<-`). | No |
+### `fromRange()`
+
+fromRange returns all data from a specified bucket within given time bounds.
+
+#### Function type signature
+
+```flux
+(
+ bucket: string,
+ start: A,
+ ?stop: B,
+) => stream[{
+ C with
+ _value: D,
+ _time: time,
+ _stop: time,
+ _start: time,
+ _measurement: string,
+ _field: string,
+}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| bucket | bucket: InfluxDB bucket name. | Yes |
+| start | start: Earliest time to include in results. | Yes |
+| stop | stop: Latest time to include in results. Default is `now()`. | No |
+### `inBucket()`
+
+inBucket queries data from a specified InfluxDB bucket within given time bounds,
+filters data by measurement, field, and optional predicate expressions.
+
+#### Function type signature
+
+```flux
+(
+ bucket: string,
+ measurement: A,
+ start: B,
+ ?fields: [string],
+ ?predicate: (
+ r: {
+ C with
+ _value: D,
+ _time: time,
+ _stop: time,
+ _start: time,
+ _measurement: string,
+ _field: string,
+ },
+ ) => bool,
+ ?stop: E,
+) => stream[{
+ C with
+ _value: D,
+ _time: time,
+ _stop: time,
+ _start: time,
+ _measurement: string,
+ _field: string,
+}] where A: Equatable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| bucket | bucket: InfluxDB bucket name. | Yes |
+| measurement | measurement: InfluxDB measurement name to filter by. | Yes |
+| start | start: Earliest time to include in results. | Yes |
+| stop | stop: Latest time to include in results. Default is `now()`. | No |
+| fields | fields: Fields to filter by. Default is `[]`. | No |
+| predicate | predicate: Predicate function that evaluates column values and returns `true` or `false`.
+ Default is `(r) => true`. | No |
diff --git a/docs/experimental/record.md b/docs/experimental/record.md
new file mode 100644
index 0000000..d3a484b
--- /dev/null
+++ b/docs/experimental/record.md
@@ -0,0 +1,45 @@
+## `record` package
+
+Package record provides tools for working with Flux records.
+
+Import the `record` package:
+
+```flux
+import "record"
+```
+
+### Functions
+
+### `any()`
+
+any is a polymorphic record value that can be used as a default record value
+when input record property types are not known.
+
+#### Function type signature
+
+```flux
+A where A: Record
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `get()`
+
+get returns a value from a record by key name or a default value if the key
+doesn’t exist in the record.
+
+#### Function type signature
+
+```flux
+(default: A, key: string, r: B) => A where B: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| r | r: Record to retrieve the value from. | Yes |
+| key | key: Property key to retrieve. | Yes |
+| default | default: Default value to return if the specified key does not exist in the record. | Yes |
diff --git a/docs/experimental/table.md b/docs/experimental/table.md
new file mode 100644
index 0000000..68cb5d9
--- /dev/null
+++ b/docs/experimental/table.md
@@ -0,0 +1,27 @@
+## `table` package
+
+Package table provides tools working with Flux tables.
+
+Import the `table` package:
+
+```flux
+import "table"
+```
+
+### Functions
+
+### `fill()`
+
+fill adds a single row to empty tables in a stream of tables.
+
+#### Function type signature
+
+```flux
+(<-tables: stream[A]) => stream[A] where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| tables | tables: Input data. Default is piped-forward data (`<-`). | No |
diff --git a/docs/experimental/usage.md b/docs/experimental/usage.md
new file mode 100644
index 0000000..f14ff60
--- /dev/null
+++ b/docs/experimental/usage.md
@@ -0,0 +1,62 @@
+## `usage` package
+
+Package usage provides tools for collecting usage and usage limit data from
+**InfluxDB Cloud**.
+
+Import the `usage` package:
+
+```flux
+import "usage"
+```
+
+### Functions
+
+### `from()`
+
+from returns usage data from an **InfluxDB Cloud** organization.
+
+#### Function type signature
+
+```flux
+(
+ start: A,
+ stop: B,
+ ?host: string,
+ ?orgID: string,
+ ?raw: C,
+ ?token: string,
+) => stream[D] where D: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| start | start: Earliest time to include in results. | Yes |
+| stop | stop: Latest time to include in results. | Yes |
+| host | host: [InfluxDB Cloud region URL](https://docs.influxdata.com/influxdb/cloud/reference/regions/).
+ Default is `""`. | No |
+| orgID | orgID: InfluxDB Cloud organization ID. Default is `""`. | No |
+| token | token: InfluxDB Cloud [API token](https://docs.influxdata.com/influxdb/cloud/security/tokens/).
+ Default is `""`. | No |
+| raw | raw: Return raw, high resolution usage data instead of downsampled usage data.
+ Default is `false`. | No |
+### `limits()`
+
+limits returns a record containing usage limits for an **InfluxDB Cloud** organization.
+
+#### Function type signature
+
+```flux
+(?host: string, ?orgID: string, ?token: string) => A
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| host | host: [InfluxDB Cloud region URL](https://docs.influxdata.com/influxdb/cloud/reference/regions/).
+ Default is `""`. | No |
+| orgID | orgID: InfluxDB Cloud organization ID. Default is `""`. | No |
+| token | token: InfluxDB Cloud [API token](https://docs.influxdata.com/influxdb/cloud/security/tokens/).
+ Default is `""`. | No |
diff --git a/docs/favicon.png b/docs/favicon.png
new file mode 100644
index 0000000..bb57a44
Binary files /dev/null and b/docs/favicon.png differ
diff --git a/docs/flux-docs-short.json b/docs/flux-docs-short.json
new file mode 100644
index 0000000..309a53d
--- /dev/null
+++ b/docs/flux-docs-short.json
@@ -0,0 +1 @@
+[{"path":"array","name":"array","headline":"Package array provides functions for manipulating array and building tables from arrays.","description":null,"members":{"concat":{"kind":"Function","name":"concat","headline":"concat appends two arrays and returns a new array.","description":null,"parameters":[{"name":"arr","headline":"arr: First array. Default is the piped-forward array (`<-`).","description":null,"required":false},{"name":"v","headline":"v: Array to append to the first array.","description":null,"required":true}],"flux_type":"(<-arr: [A], v: [A]) => [A]","is_option":false,"source_location":{"file":"array/array.flux","start":{"line":76,"column":1},"end":{"line":76,"column":45},"source":"builtin concat : (<-arr: [A], v: [A]) => [A]"},"examples":[],"metadata":{"introduced":"0.173.0"}},"filter":{"kind":"Function","name":"filter","headline":"filter iterates over an array, evaluates each element with a predicate function, and then returns\na new array with only elements that match the predicate.","description":null,"parameters":[{"name":"arr","headline":"arr: Array to filter. Default is the piped-forward array (`<-`).","description":null,"required":false},{"name":"fn","headline":"fn: Predicate function to evaluate on each element.\n The element is represented by `x` in the predicate function.","description":null,"required":true}],"flux_type":"(<-arr: [A], fn: (x: A) => bool) => [A]","is_option":false,"source_location":{"file":"array/array.flux","start":{"line":128,"column":1},"end":{"line":128,"column":57},"source":"builtin filter : (<-arr: [A], fn: (x: A) => bool) => [A]"},"examples":[],"metadata":{"introduced":"0.173.0"}},"from":{"kind":"Function","name":"from","headline":"from constructs a table from an array of records.","description":null,"parameters":[{"name":"rows","headline":"rows: Array of records to construct a table with. Default is the piped-forward array (`<-`).","description":null,"required":false}],"flux_type":"(<-rows: [A]) => stream[A] where A: Record","is_option":false,"source_location":{"file":"array/array.flux","start":{"line":48,"column":1},"end":{"line":48,"column":58},"source":"builtin from : (<-rows: [A]) => stream[A] where A: Record"},"examples":[],"metadata":{"tags":"inputs"}},"map":{"kind":"Function","name":"map","headline":"map iterates over an array, applies a function to each element to produce a new element,\nand then returns a new array.","description":null,"parameters":[{"name":"arr","headline":"arr: Array to operate on. Defaults is the piped-forward array (`<-`).","description":null,"required":false},{"name":"fn","headline":"fn: Function to apply to elements. The element is represented by `x` in the function.","description":null,"required":true}],"flux_type":"(<-arr: [A], fn: (x: A) => B) => [B]","is_option":false,"source_location":{"file":"array/array.flux","start":{"line":101,"column":1},"end":{"line":101,"column":51},"source":"builtin map : (<-arr: [A], fn: (x: A) => B) => [B]"},"examples":[],"metadata":{"introduced":"0.173.0"}}},"examples":[],"metadata":{"introduced":"0.103.0","tags":"array,tables"}},{"path":"bitwise","name":"bitwise","headline":"Package bitwise provides functions for performing bitwise operations on integers.","description":null,"members":{"sand":{"kind":"Function","name":"sand","headline":"sand performs the bitwise operation, `a AND b`, with integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Right hand operand.","description":null,"required":true}],"flux_type":"(a: int, b: int) => int","is_option":false,"source_location":{"file":"bitwise/bitwise.flux","start":{"line":230,"column":1},"end":{"line":230,"column":39},"source":"builtin sand : (a: int, b: int) => int"},"examples":[],"metadata":null},"sclear":{"kind":"Function","name":"sclear","headline":"sclear performs the bitwise operation `a AND NOT b`.\nBoth `a` and `b` are integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Bits to clear.","description":null,"required":true}],"flux_type":"(a: int, b: int) => int","is_option":false,"source_location":{"file":"bitwise/bitwise.flux","start":{"line":338,"column":1},"end":{"line":338,"column":41},"source":"builtin sclear : (a: int, b: int) => int"},"examples":[],"metadata":null},"slshift":{"kind":"Function","name":"slshift","headline":"slshift shifts the bits in `a` left by `b` bits.\nBoth `a` and `b` are integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Number of bits to shift.","description":null,"required":true}],"flux_type":"(a: int, b: int) => int","is_option":false,"source_location":{"file":"bitwise/bitwise.flux","start":{"line":366,"column":1},"end":{"line":366,"column":42},"source":"builtin slshift : (a: int, b: int) => int"},"examples":[],"metadata":null},"snot":{"kind":"Function","name":"snot","headline":"snot inverts every bit in `a`, an integer.","description":null,"parameters":[{"name":"a","headline":"a: Integer to invert.","description":null,"required":true}],"flux_type":"(a: int) => int","is_option":false,"source_location":{"file":"bitwise/bitwise.flux","start":{"line":283,"column":1},"end":{"line":283,"column":31},"source":"builtin snot : (a: int) => int"},"examples":[],"metadata":null},"sor":{"kind":"Function","name":"sor","headline":"sor performs the bitwise operation, `a OR b`, with integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Right hand operand.","description":null,"required":true}],"flux_type":"(a: int, b: int) => int","is_option":false,"source_location":{"file":"bitwise/bitwise.flux","start":{"line":257,"column":1},"end":{"line":257,"column":38},"source":"builtin sor : (a: int, b: int) => int"},"examples":[],"metadata":null},"srshift":{"kind":"Function","name":"srshift","headline":"srshift shifts the bits in `a` right by `b` bits.\nBoth `a` and `b` are integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Number of bits to shift.","description":null,"required":true}],"flux_type":"(a: int, b: int) => int","is_option":false,"source_location":{"file":"bitwise/bitwise.flux","start":{"line":394,"column":1},"end":{"line":394,"column":42},"source":"builtin srshift : (a: int, b: int) => int"},"examples":[],"metadata":null},"sxor":{"kind":"Function","name":"sxor","headline":"sxor performs the bitwise operation, `a XOR b`, with integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Right hand operand.","description":null,"required":true}],"flux_type":"(a: int, b: int) => int","is_option":false,"source_location":{"file":"bitwise/bitwise.flux","start":{"line":310,"column":1},"end":{"line":310,"column":39},"source":"builtin sxor : (a: int, b: int) => int"},"examples":[],"metadata":null},"uand":{"kind":"Function","name":"uand","headline":"uand performs the bitwise operation, `a AND b`, with unsigned integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Right hand operand.","description":null,"required":true}],"flux_type":"(a: uint, b: uint) => uint","is_option":false,"source_location":{"file":"bitwise/bitwise.flux","start":{"line":40,"column":1},"end":{"line":40,"column":42},"source":"builtin uand : (a: uint, b: uint) => uint"},"examples":[],"metadata":null},"uclear":{"kind":"Function","name":"uclear","headline":"uclear performs the bitwise operation `a AND NOT b`, with unsigned integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Bits to clear.","description":null,"required":true}],"flux_type":"(a: uint, b: uint) => uint","is_option":false,"source_location":{"file":"bitwise/bitwise.flux","start":{"line":147,"column":1},"end":{"line":147,"column":44},"source":"builtin uclear : (a: uint, b: uint) => uint"},"examples":[],"metadata":null},"ulshift":{"kind":"Function","name":"ulshift","headline":"ulshift shifts the bits in `a` left by `b` bits.\nBoth `a` and `b` are unsigned integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Number of bits to shift.","description":null,"required":true}],"flux_type":"(a: uint, b: uint) => uint","is_option":false,"source_location":{"file":"bitwise/bitwise.flux","start":{"line":175,"column":1},"end":{"line":175,"column":45},"source":"builtin ulshift : (a: uint, b: uint) => uint"},"examples":[],"metadata":null},"unot":{"kind":"Function","name":"unot","headline":"unot inverts every bit in `a`, an unsigned integer.","description":null,"parameters":[{"name":"a","headline":"a: Unsigned integer to invert.","description":null,"required":true}],"flux_type":"(a: uint) => uint","is_option":false,"source_location":{"file":"bitwise/bitwise.flux","start":{"line":93,"column":1},"end":{"line":93,"column":33},"source":"builtin unot : (a: uint) => uint"},"examples":[],"metadata":null},"uor":{"kind":"Function","name":"uor","headline":"uor performs the bitwise operation, `a OR b`, with unsigned integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Right hand operand.","description":null,"required":true}],"flux_type":"(a: uint, b: uint) => uint","is_option":false,"source_location":{"file":"bitwise/bitwise.flux","start":{"line":67,"column":1},"end":{"line":67,"column":41},"source":"builtin uor : (a: uint, b: uint) => uint"},"examples":[],"metadata":null},"urshift":{"kind":"Function","name":"urshift","headline":"urshift shifts the bits in `a` right by `b` bits.\nBoth `a` and `b` are unsigned integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Number of bits to shift.","description":null,"required":true}],"flux_type":"(a: uint, b: uint) => uint","is_option":false,"source_location":{"file":"bitwise/bitwise.flux","start":{"line":203,"column":1},"end":{"line":203,"column":45},"source":"builtin urshift : (a: uint, b: uint) => uint"},"examples":[],"metadata":null},"uxor":{"kind":"Function","name":"uxor","headline":"uxor performs the bitwise operation, `a XOR b`, with unsigned integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Right hand operand.","description":null,"required":true}],"flux_type":"(a: uint, b: uint) => uint","is_option":false,"source_location":{"file":"bitwise/bitwise.flux","start":{"line":120,"column":1},"end":{"line":120,"column":42},"source":"builtin uxor : (a: uint, b: uint) => uint"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.173.0","tags":"bitwise"}},{"path":"contrib/RohanSreerama5/naiveBayesClassifier","name":"naiveBayesClassifier","headline":"Package naiveBayesClassifier provides an implementation of\na naive Bayes classifier.","description":null,"members":{"naiveBayes":{"kind":"Function","name":"naiveBayes","headline":"naiveBayes performs a naive Bayes classification.","description":null,"parameters":[{"name":"myMeasurement","headline":"myMeasurement: Measurement to use as training data.","description":null,"required":true},{"name":"myField","headline":"myField: Field to use as training data.","description":null,"required":true},{"name":"myClass","headline":"myClass: Class to classify against.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[{C with _time: time, _measurement: E, _field: D}],\n myClass: string,\n myField: A,\n myMeasurement: B,\n) => stream[F] where A: Equatable, B: Equatable, D: Equatable, E: Equatable, F: Record","is_option":false,"source_location":{"file":"contrib/RohanSreerama5/naiveBayesClassifier/naiveBayesClassifier.flux","start":{"line":30,"column":1},"end":{"line":124,"column":2},"source":"naiveBayes = (tables=<-, myClass, myField, myMeasurement) => {\n training_data =\n tables\n //data for 3 days\n |> range(start: 2020-01-02T00:00:00Z, stop: 2020-01-06T23:00:00Z)\n |> filter(fn: (r) => r[\"_measurement\"] == myMeasurement and r[\"_field\"] == myField)\n |> group()\n\n //|> yield(name: \"trainingData\")\n test_data =\n tables\n //data for 1 day\n |> range(start: 2020-01-01T00:00:00Z, stop: 2020-01-01T23:00:00Z)\n |> filter(fn: (r) => r[\"_measurement\"] == myMeasurement and r[\"_field\"] == myField)\n |> group()\n\n //|> yield(name: \"test data\")\n //data preparation\n r =\n training_data\n |> group(columns: [\"_field\"])\n |> count()\n |> tableFind(fn: (key) => key._field == myField)\n r2 = getRecord(table: r, idx: 0)\n total_count = r2._value\n P_Class_k =\n training_data\n |> group(columns: [myClass, \"_field\"])\n |> count()\n |> map(\n fn: (r) =>\n ({r with p_k: float(v: r._value) / float(v: total_count), tc: total_count}),\n )\n |> group()\n\n //one table for each class, where r.p_k == P(Class_k)\n P_value_x =\n training_data\n |> group(columns: [\"_value\", \"_field\"])\n |> count(column: myClass)\n |> map(\n fn: (r) =>\n ({r with p_x: float(v: r.airborne) / float(v: total_count), tc: total_count}),\n )\n\n // one table for each value, where r.p_x == P(value_x)\n P_k_x =\n training_data\n |> group(columns: [\"_field\", \"_value\", myClass])\n |> reduce(fn: (r, accumulator) => ({sum: 1.0 + accumulator.sum}), identity: {sum: 0.0})\n |> group()\n\n // one table for each value and Class pair, where r.p_k_x == P(value_x | Class_k)\n P_k_x_class =\n join(tables: {P_k_x: P_k_x, P_Class_k: P_Class_k}, on: [myClass], method: \"inner\")\n |> group(columns: [myClass, \"_value_P_k_x\"])\n |> limit(n: 1)\n |> map(fn: (r) => ({r with P_x_k: r.sum / float(v: r._value_P_Class_k)}))\n |> drop(columns: [\"_field_P_Class_k\", \"_value_P_Class_k\"])\n |> rename(columns: {_field_P_k_x: \"_field\", _value_P_k_x: \"_value\"})\n P_k_x_class_Drop =\n join(tables: {P_k_x: P_k_x, P_Class_k: P_Class_k}, on: [myClass], method: \"inner\")\n |> drop(columns: [\"_field_P_Class_k\", \"_value_P_Class_k\", \"_field_P_k_x\"])\n |> group(columns: [myClass, \"_value_P_k_x\"])\n |> limit(n: 1)\n |> map(fn: (r) => ({r with P_x_k: r.sum / float(v: r._value_P_Class_k)}))\n\n //added P(value_x) to table\n //calculated probabilities for training data\n Probability_table =\n join(\n tables: {P_k_x_class: P_k_x_class, P_value_x: P_value_x},\n on: [\"_value\", \"_field\"],\n method: \"inner\",\n )\n |> map(fn: (r) => ({r with Probability: r.P_x_k * r.p_k / r.p_x}))\n\n //|> yield(name: \"final\")\n //predictions for test data computed\n predictOverall = (tables=<-) => {\n r =\n tables\n |> keep(columns: [\"_value\", \"Animal_name\", \"_field\"])\n output =\n join(\n tables: {Probability_table: Probability_table, r: r},\n on: [\"_value\"],\n method: \"inner\",\n )\n\n return output\n }\n\n return test_data |> predictOverall()\n}"},"examples":[],"metadata":{"tags":"transformations"}}},"examples":[],"metadata":{"introduced":"v0.86.0"}},{"path":"contrib/anaisdg/anomalydetection","name":"anomalydetection","headline":"Package anomalydetection detects anomalies in time series data.","description":null,"members":{"mad":{"kind":"Function","name":"mad","headline":"mad uses the median absolute deviation (MAD) algorithm to detect anomalies in a data set.","description":null,"parameters":[{"name":"threshold","headline":"threshold: Deviation threshold for anomalies.","description":null,"required":false},{"name":"table","headline":"table: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-table: stream[B], ?threshold: A) => stream[{C with level: string, _value_diff_med: D, _value_diff: D, _value: D}] where A: Comparable + Equatable, B: Record, D: Comparable + Divisible + Equatable","is_option":false,"source_location":{"file":"contrib/anaisdg/anomalydetection/mad.flux","start":{"line":38,"column":1},"end":{"line":73,"column":2},"source":"mad = (table=<-, threshold=3.0) => {\n // MEDiXi = med(x)\n data = table |> group(columns: [\"_time\"], mode: \"by\")\n med = data |> median(column: \"_value\")\n\n // diff = |Xi - MEDiXi| = math.abs(xi-med(xi))\n diff =\n join(tables: {data: data, med: med}, on: [\"_time\"], method: \"inner\")\n |> map(fn: (r) => ({r with _value: math.abs(x: r._value_data - r._value_med)}))\n |> drop(columns: [\"_start\", \"_stop\", \"_value_med\", \"_value_data\"])\n\n // The constant k is needed to make the estimator consistent for the parameter of interest.\n // In the case of the usual parameter at Gaussian distributions k = 1.4826\n k = 1.4826\n\n // MAD = k * MEDi * |Xi - MEDiXi|\n diff_med =\n diff\n |> median(column: \"_value\")\n |> map(fn: (r) => ({r with MAD: k * r._value}))\n |> filter(fn: (r) => r.MAD > 0.0)\n output =\n join(tables: {diff: diff, diff_med: diff_med}, on: [\"_time\"], method: \"inner\")\n |> map(fn: (r) => ({r with _value: r._value_diff / r._value_diff_med}))\n |> map(\n fn: (r) =>\n ({r with level:\n if r._value >= threshold then\n \"anomaly\"\n else\n \"normal\",\n }),\n )\n\n return output\n}"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.90.0"}},{"path":"contrib/anaisdg/statsmodels","name":"statsmodels","headline":"Package statsmodels provides functions for calculating statistical models.","description":null,"members":{"linearRegression":{"kind":"Function","name":"linearRegression","headline":"linearRegression performs a linear regression.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n) => stream[{\n B with\n y_hat: float,\n y: float,\n x: float,\n sy: H,\n sxy: G,\n sxx: F,\n sx: E,\n slope: D,\n errors: float,\n N: C,\n}] where A: Record, D: Divisible + Subtractable","is_option":false,"source_location":{"file":"contrib/anaisdg/statsmodels/linearreg.flux","start":{"line":45,"column":1},"end":{"line":93,"column":2},"source":"linearRegression = (tables=<-) => {\n renameAndSum =\n tables\n |> rename(columns: {_value: \"y\"})\n |> map(fn: (r) => ({r with x: 1.0}))\n |> cumulativeSum(columns: [\"x\"])\n t =\n renameAndSum\n |> reduce(\n fn: (r, accumulator) =>\n ({\n sx: r.x + accumulator.sx,\n sy: r.y + accumulator.sy,\n N: accumulator.N + 1.0,\n sxy: r.x * r.y + accumulator.sxy,\n sxx: r.x * r.x + accumulator.sxx,\n }),\n identity: {\n sxy: 0.0,\n sx: 0.0,\n sy: 0.0,\n sxx: 0.0,\n N: 0.0,\n },\n )\n |> tableFind(fn: (key) => true)\n |> getRecord(idx: 0)\n xbar = t.sx / t.N\n ybar = t.sy / t.N\n slope = (t.sxy - xbar * ybar * t.N) / (t.sxx - t.N * xbar * xbar)\n intercept = ybar - slope * xbar\n y_hat = (r) =>\n ({r with\n y_hat: slope * r.x + intercept,\n slope: slope,\n sx: t.sx,\n sxy: t.sxy,\n sxx: t.sxx,\n N: t.N,\n sy: t.sy,\n })\n rse = (r) => ({r with errors: (r.y - r.y_hat) ^ 2.0})\n output =\n renameAndSum\n |> map(fn: y_hat)\n |> map(fn: rse)\n\n return output\n}"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.90.0"}},{"path":"contrib/bonitoo-io/alerta","name":"alerta","headline":"Package alerta provides functions that send alerts to [Alerta](https://alerta.io/).","description":null,"members":{"alert":{"kind":"Function","name":"alert","headline":"alert sends an alert to [Alerta](https://alerta.io/).","description":null,"parameters":[{"name":"url","headline":"url: (Required) Alerta URL.","description":null,"required":true},{"name":"apiKey","headline":"apiKey: (Required) Alerta API key.","description":null,"required":true},{"name":"resource","headline":"resource: (Required) Resource associated with the alert.","description":null,"required":true},{"name":"event","headline":"event: (Required) Event name.","description":null,"required":true},{"name":"environment","headline":"environment: Alerta environment. Valid values: \"Production\", \"Development\" or empty string (default).","description":null,"required":false},{"name":"severity","headline":"severity: (Required) Event severity. See [Alerta severities](https://docs.alerta.io/en/latest/api/alert.html#alert-severities).","description":null,"required":true},{"name":"service","headline":"service: List of affected services. Default is `[]`.","description":null,"required":false},{"name":"group","headline":"group: Alerta event group. Default is `\"\"`.","description":null,"required":false},{"name":"value","headline":"value: Event value. Default is `\"\"`.","description":null,"required":false},{"name":"text","headline":"text: Alerta text description. Default is `\"\"`.","description":null,"required":false},{"name":"tags","headline":"tags: List of event tags. Default is `[]`.","description":null,"required":false},{"name":"attributes","headline":"attributes: (Required) Alert attributes.","description":null,"required":true},{"name":"origin","headline":"origin: monitoring component.","description":null,"required":false},{"name":"type","headline":"type: Event type. Default is `\"\"`.","description":null,"required":false},{"name":"timestamp","headline":"timestamp: time alert was generated. Default is `now()`.","description":null,"required":false}],"flux_type":"(\n apiKey: string,\n attributes: A,\n event: B,\n resource: C,\n severity: D,\n url: string,\n ?environment: E,\n ?group: F,\n ?origin: G,\n ?service: H,\n ?tags: I,\n ?text: J,\n ?timestamp: K,\n ?type: L,\n ?value: M,\n) => int","is_option":false,"source_location":{"file":"contrib/bonitoo-io/alerta/alerta.flux","start":{"line":76,"column":1},"end":{"line":115,"column":6},"source":"alert = (\n url,\n apiKey,\n resource,\n event,\n environment=\"\",\n severity,\n service=[],\n group=\"\",\n value=\"\",\n text=\"\",\n tags=[],\n attributes,\n origin=\"InfluxDB\",\n type=\"\",\n timestamp=now(),\n ) =>\n {\n alert = {\n resource: resource,\n event: event,\n environment: environment,\n severity: severity,\n service: service,\n group: group,\n value: value,\n text: text,\n tags: tags,\n attributes: attributes,\n origin: origin,\n type: type,\n createTime: strings.substring(v: string(v: timestamp), start: 0, end: 23) + \"Z\",\n // Alerta supports ISO 8601 date format YYYY-MM-DDThh:mm:ss.sssZ only\n\n }\n headers = {\"Authorization\": \"Key \" + apiKey, \"Content-Type\": \"application/json\"}\n body = json.encode(v: alert)\n\n return http.post(headers: headers, url: url, data: body)\n }"},"examples":[],"metadata":{"tags":"single notification"}},"endpoint":{"kind":"Function","name":"endpoint","headline":"endpoint sends alerts to Alerta using data from input rows.","description":null,"parameters":[{"name":"url","headline":"url: (Required) Alerta URL.","description":null,"required":true},{"name":"apiKey","headline":"apiKey: (Required) Alerta API key.","description":null,"required":true},{"name":"environment","headline":"environment: Alert environment. Default is `\"\"`.\n Valid values: \"Production\", \"Development\", or empty string (default).","description":null,"required":false},{"name":"origin","headline":"origin: Alert origin. Default is `\"InfluxDB\"`.","description":null,"required":false}],"flux_type":"(\n apiKey: string,\n url: string,\n ?environment: A,\n ?origin: B,\n) => (\n mapFn: (\n r: C,\n ) => {\n D with\n value: O,\n type: N,\n timestamp: M,\n text: L,\n tags: K,\n severity: J,\n service: I,\n resource: H,\n group: G,\n event: F,\n attributes: E,\n },\n) => (<-tables: stream[C]) => stream[{C with _sent: string}]","is_option":false,"source_location":{"file":"contrib/bonitoo-io/alerta/alerta.flux","start":{"line":191,"column":1},"end":{"line":222,"column":18},"source":"endpoint = (url, apiKey, environment=\"\", origin=\"\") =>\n (mapFn) =>\n (tables=<-) =>\n tables\n |> map(\n fn: (r) => {\n obj = mapFn(r: r)\n\n return {r with _sent:\n string(\n v:\n 2 == alert(\n url: url,\n apiKey: apiKey,\n resource: obj.resource,\n event: obj.event,\n environment: environment,\n severity: obj.severity,\n service: obj.service,\n group: obj.group,\n value: obj.value,\n text: obj.text,\n tags: obj.tags,\n attributes: obj.attributes,\n origin: origin,\n type: obj.type,\n timestamp: obj.timestamp,\n ) / 100,\n ),\n }\n },\n )"},"examples":[],"metadata":{"tags":"notification endpoints, transformations"}}},"examples":[],"metadata":{"introduced":"0.115.0"}},{"path":"contrib/bonitoo-io/hex","name":"hex","headline":"Package hex provides functions that perform hexadecimal conversion\nof `int`, `uint` or `bytes` values to and from `string` values.","description":null,"members":{"bytes":{"kind":"Function","name":"bytes","headline":"bytes converts a hexadecimal string to bytes.","description":null,"parameters":[{"name":"v","headline":"v: String to convert.","description":null,"required":true}],"flux_type":"(v: string) => bytes","is_option":false,"source_location":{"file":"contrib/bonitoo-io/hex/hex.flux","start":{"line":171,"column":1},"end":{"line":171,"column":37},"source":"builtin bytes : (v: string) => bytes"},"examples":[],"metadata":{"tag":"type-conversion"}},"int":{"kind":"Function","name":"int","headline":"int converts a hexadecimal string to an integer.","description":null,"parameters":[{"name":"v","headline":"v: String to convert.","description":null,"required":true}],"flux_type":"(v: string) => int","is_option":false,"source_location":{"file":"contrib/bonitoo-io/hex/hex.flux","start":{"line":29,"column":1},"end":{"line":29,"column":33},"source":"builtin int : (v: string) => int"},"examples":[],"metadata":{"tag":"type-conversion"}},"string":{"kind":"Function","name":"string","headline":"string converts a Flux basic type to a hexadecimal string.","description":null,"parameters":[{"name":"v","headline":"v: Value to convert.","description":null,"required":true}],"flux_type":"(v: A) => string","is_option":false,"source_location":{"file":"contrib/bonitoo-io/hex/hex.flux","start":{"line":131,"column":1},"end":{"line":131,"column":34},"source":"builtin string : (v: A) => string"},"examples":[],"metadata":{"tag":"type-conversion"}},"uint":{"kind":"Function","name":"uint","headline":"uint converts a hexadecimal string to an unsigned integer.","description":null,"parameters":[{"name":"v","headline":"v: String to convert.","description":null,"required":true}],"flux_type":"(v: string) => uint","is_option":false,"source_location":{"file":"contrib/bonitoo-io/hex/hex.flux","start":{"line":151,"column":1},"end":{"line":151,"column":35},"source":"builtin uint : (v: string) => uint"},"examples":[],"metadata":{"tag":"type-conversion"}}},"examples":[],"metadata":{"introduced":"0.131.0"}},{"path":"contrib/bonitoo-io/servicenow","name":"servicenow","headline":"Package servicenow provides functions for sending events to [ServiceNow](https://www.servicenow.com/).","description":null,"members":{"endpoint":{"kind":"Function","name":"endpoint","headline":"endpoint sends events to [ServiceNow](https://servicenow.com/) using data from input rows.","description":null,"parameters":[{"name":"url","headline":"url: ServiceNow web service URL.","description":null,"required":true},{"name":"username","headline":"username: ServiceNow username to use for HTTP BASIC authentication.","description":null,"required":true},{"name":"password","headline":"password: ServiceNow password to use for HTTP BASIC authentication.","description":null,"required":true},{"name":"source","headline":"source: Source name. Default is `\"Flux\"`.","description":null,"required":false}],"flux_type":"(\n password: string,\n url: string,\n username: string,\n ?source: A,\n) => (\n mapFn: (\n r: B,\n ) => {\n C with\n severity: J,\n resource: I,\n node: H,\n metricType: G,\n metricName: F,\n messageKey: E,\n description: D,\n },\n) => (<-tables: stream[B]) => stream[{B with _sent: string}] where J: Equatable","is_option":false,"source_location":{"file":"contrib/bonitoo-io/servicenow/servicenow.flux","start":{"line":203,"column":1},"end":{"line":236,"column":18},"source":"endpoint = (url, username, password, source=\"Flux\") =>\n (mapFn) =>\n (tables=<-) =>\n tables\n |> map(\n fn: (r) => {\n obj = mapFn(r: r)\n\n return {r with _sent:\n string(\n v:\n 2 == event(\n url: url,\n username: username,\n password: password,\n source: source,\n node: obj.node,\n metricType: obj.metricType,\n resource: obj.resource,\n metricName: obj.metricName,\n messageKey: obj.messageKey,\n description: obj.description,\n severity: obj.severity,\n additionalInfo:\n record.get(\n r: obj,\n key: \"additionalInfo\",\n default: record.any,\n ),\n ) / 100,\n ),\n }\n },\n )"},"examples":[],"metadata":{"tags":"notification endpoints"}},"event":{"kind":"Function","name":"event","headline":"event sends an event to [ServiceNow](https://servicenow.com/).","description":null,"parameters":[{"name":"url","headline":"url: ServiceNow web service URL.","description":null,"required":true},{"name":"username","headline":"username: ServiceNow username to use for HTTP BASIC authentication.","description":null,"required":true},{"name":"password","headline":"password: ServiceNow password to use for HTTP BASIC authentication.","description":null,"required":true},{"name":"description","headline":"description: Event description.","description":null,"required":true},{"name":"severity","headline":"severity: Severity of the event.","description":null,"required":true},{"name":"source","headline":"source: Source name. Default is `\"Flux\"`.","description":null,"required":false},{"name":"node","headline":"node: Node name or IP address related to the event.\n Default is an empty string (`\"\"`).","description":null,"required":false},{"name":"metricType","headline":"metricType: Metric type related to the event (for example, `CPU`).\n Default is an empty string (`\"\"`).","description":null,"required":false},{"name":"resource","headline":"resource: Resource related to the event (for example, `CPU-1`).\n Default is an empty string (`\"\"`).","description":null,"required":false},{"name":"metricName","headline":"metricName: Metric name related to the event (for example, `usage_idle`).\n Default is an empty string (`\"\"`).","description":null,"required":false},{"name":"messageKey","headline":"messageKey: Unique identifier of the event (for example, the InfluxDB alert ID).\n Default is an empty string (`\"\"`).\n If an empty string, ServiceNow generates a value.","description":null,"required":false},{"name":"additionalInfo","headline":"additionalInfo: Additional information to include with the event.","description":null,"required":false}],"flux_type":"(\n description: A,\n password: string,\n severity: B,\n url: string,\n username: string,\n ?additionalInfo: C,\n ?messageKey: D,\n ?metricName: E,\n ?metricType: F,\n ?node: G,\n ?resource: H,\n ?source: I,\n) => int where B: Equatable, C: Equatable","is_option":false,"source_location":{"file":"contrib/bonitoo-io/servicenow/servicenow.flux","start":{"line":83,"column":1},"end":{"line":136,"column":6},"source":"event = (\n url,\n username,\n password,\n source=\"Flux\",\n node=\"\",\n metricType=\"\",\n resource=\"\",\n metricName=\"\",\n messageKey=\"\",\n description,\n severity,\n additionalInfo=record.any,\n ) =>\n {\n event = {\n source: source,\n node: node,\n type: metricType,\n resource: resource,\n metric_name: metricName,\n message_key: messageKey,\n description: description,\n severity:\n if severity == \"critical\" then\n \"1\"\n else if severity == \"major\" then\n \"2\"\n else if severity == \"minor\" then\n \"3\"\n else if severity == \"warning\" then\n \"4\"\n else if severity == \"info\" then\n \"5\"\n else if severity == \"clear\" then\n \"0\"\n else\n \"\",\n // shouldn't happen\n additional_info:\n if additionalInfo == record.any then\n \"\"\n else\n string(v: json.encode(v: additionalInfo)),\n }\n payload = {records: [event]}\n headers = {\n \"Authorization\": http.basicAuth(u: username, p: password),\n \"Content-Type\": \"application/json\",\n }\n body = json.encode(v: payload)\n\n return http.post(headers: headers, url: url, data: body)\n }"},"examples":[],"metadata":{"tags":"single notification"}}},"examples":[],"metadata":{"introduced":"0.136.0"}},{"path":"contrib/bonitoo-io/tickscript","name":"tickscript","headline":"Package tickscript provides functions to help migrate\nKapacitor [TICKscripts](https://docs.influxdata.com/kapacitor/latest/tick/) to Flux tasks.","description":null,"members":{"alert":{"kind":"Function","name":"alert","headline":"alert identifies events of varying severity levels\nand writes them to the `statuses` measurement in the InfluxDB `_monitoring`\nsystem bucket.","description":null,"parameters":[{"name":"check","headline":"check: InfluxDB check data.\n See `tickscript.defineCheck()`.","description":null,"required":true},{"name":"id","headline":"id: Function that returns the InfluxDB check ID provided by the check record.\n Default is `(r) => \"${r._check_id}\"`.","description":null,"required":false},{"name":"details","headline":"details: Function to return the InfluxDB check details using data from input rows.\n Default is `(r) => \"\"`.","description":null,"required":false},{"name":"message","headline":"message: Function to return the InfluxDB check message using data from input rows.\n Default is `(r) => \"Threshold Check: ${r._check_name} is: ${r._level}\"`.","description":null,"required":false},{"name":"crit","headline":"crit: Predicate function to determine `crit` status. Default is `(r) => false`.","description":null,"required":false},{"name":"warn","headline":"warn: Predicate function to determine `warn` status. Default is `(r) => false`.","description":null,"required":false},{"name":"info","headline":"info: Predicate function to determine `info` status. Default is `(r) => false`.","description":null,"required":false},{"name":"ok","headline":"ok: Predicate function to determine `ok` status. Default is `(r) => true`.","description":null,"required":false},{"name":"topic","headline":"topic: Check topic. Default is `\"\"`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[M],\n check: {A with tags: E, _type: D, _check_name: C, _check_id: B},\n ?crit: (r: {F with _time: H, _measurement: G}) => bool,\n ?details: (r: {I with id: J, _check_name: C, _check_id: B}) => K,\n ?id: (r: {I with _check_name: C, _check_id: B}) => J,\n ?info: (r: {F with _time: H, _measurement: G}) => bool,\n ?message: (\n r: {\n F with\n _type: D,\n _time: H,\n _time: time,\n _source_timestamp: int,\n _source_measurement: G,\n _measurement: G,\n _measurement: string,\n _level: string,\n _check_name: C,\n _check_id: B,\n },\n ) => L,\n ?ok: (r: {F with _time: H, _measurement: G}) => bool,\n ?topic: string,\n ?warn: (r: {F with _time: H, _measurement: G}) => bool,\n) => stream[{\n F with\n _type: D,\n _time: H,\n _time: time,\n _source_timestamp: int,\n _source_measurement: G,\n _message: L,\n _measurement: G,\n _measurement: string,\n _level: string,\n _check_name: C,\n _check_id: B,\n}] where E: Record, I: Record, M: Record","is_option":false,"source_location":{"file":"contrib/bonitoo-io/tickscript/tickscript.flux","start":{"line":105,"column":1},"end":{"line":145,"column":6},"source":"alert = (\n check,\n id=(r) => \"${r._check_id}\",\n details=(r) => \"\",\n message=(r) => \"Threshold Check: ${r._check_name} is: ${r._level}\",\n crit=(r) => false,\n warn=(r) => false,\n info=(r) => false,\n ok=(r) => true,\n topic=\"\",\n tables=<-,\n ) =>\n {\n _addTopic =\n if topic != \"\" then\n (tables=<-) =>\n tables\n |> set(key: \"_topic\", value: topic)\n |> experimental.group(mode: \"extend\", columns: [\"_topic\"])\n else\n (tables=<-) => tables\n\n return\n tables\n |> drop(fn: (column) => column =~ /_start.*/ or column =~ /_stop.*/)\n |> map(\n fn: (r) =>\n ({r with _check_id: check._check_id, _check_name: check._check_name}),\n )\n |> map(fn: (r) => ({r with id: id(r: r)}))\n |> map(fn: (r) => ({r with details: details(r: r)}))\n |> _addTopic()\n |> monitor.check(\n crit: crit,\n warn: warn,\n info: info,\n ok: ok,\n messageFn: message,\n data: check,\n )\n }"},"examples":[],"metadata":{"tags":"transformations,outputs"}},"compute":{"kind":"Function","name":"compute","headline":"compute is an alias for `tickscript.select()` that changes a column’s name and\noptionally applies an aggregate or selector function.","description":null,"parameters":[{"name":"as","headline":"as: New column name.","description":null,"required":true},{"name":"column","headline":"column: Column to operate on. Default is `_value`.","description":null,"required":false},{"name":"fn","headline":"fn: Aggregate or selector function to apply.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: B, as: string, ?column: A, ?fn: (<-: B, column: A) => stream[C]) => stream[D] where A: Equatable, C: Record, D: Record","is_option":false,"source_location":{"file":"contrib/bonitoo-io/tickscript/tickscript.flux","start":{"line":393,"column":1},"end":{"line":393,"column":17},"source":"compute = select"},"examples":[],"metadata":{"tags":"transformations"}},"deadman":{"kind":"Function","name":"deadman","headline":"deadman detects low data throughput and writes a point with a critical status to\nthe InfluxDB `_monitoring` system bucket.","description":null,"parameters":[{"name":"check","headline":"check: InfluxDB check data. See `tickscript.defineCheck()`.","description":null,"required":true},{"name":"measurement","headline":"measurement: Measurement name. Should match the queried measurement.","description":null,"required":true},{"name":"threshold","headline":"threshold: Count threshold. Default is `0`.","description":null,"required":false},{"name":"id","headline":"id: Function that returns the InfluxDB check ID provided by the check record.\n Default is `(r) => \"${r._check_id}\"`.","description":null,"required":false},{"name":"message","headline":"message: Function that returns the InfluxDB check message using data from input rows.\n Default is `(r) => \"Deadman Check: ${r._check_name} is: \" + (if r.dead then \"dead\" else \"alive\")`.","description":null,"required":false},{"name":"topic","headline":"topic: Check topic. Default is `\"\"`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[M],\n check: {A with tags: E, _type: D, _check_name: C, _check_id: B},\n measurement: string,\n ?id: (r: {F with _check_name: C, _check_id: B}) => G,\n ?message: (\n r: {\n H with\n dead: bool,\n _type: D,\n _time: J,\n _time: time,\n _source_timestamp: int,\n _source_measurement: I,\n _measurement: I,\n _measurement: string,\n _level: string,\n _check_name: C,\n _check_id: B,\n },\n ) => K,\n ?threshold: L,\n ?topic: string,\n) => stream[{\n H with\n dead: bool,\n _type: D,\n _time: J,\n _time: time,\n _source_timestamp: int,\n _source_measurement: I,\n _message: K,\n _measurement: I,\n _measurement: string,\n _level: string,\n _check_name: C,\n _check_id: B,\n}] where E: Record, F: Record, L: Comparable + Equatable, M: Record","is_option":false,"source_location":{"file":"contrib/bonitoo-io/tickscript/tickscript.flux","start":{"line":191,"column":1},"end":{"line":248,"column":10},"source":"deadman =\n (\n check,\n measurement,\n threshold=0,\n id=(r) => \"${r._check_id}\",\n message=(r) =>\n \"Deadman Check: ${r._check_name} is: \" + (if r.dead then \"dead\" else \"alive\"),\n topic=\"\",\n tables=<-,\n ) =>\n {\n // In order to detect empty stream (without tables), we concatenate input with dummy stream and count the result,\n // because count() returns nothing for empty stream. If the input stream is empty, then dummy stream with empty\n // table is used as input for actual threshold check in order to get 0.\n _dummy =\n array.from(rows: [{_time: 2000-01-01T00:00:00Z, _field: \"unknown\", _value: 0}])\n |> set(key: \"_measurement\", value: measurement)\n // required by monitor.check\n |> experimental.group(columns: [\"_measurement\"], mode: \"extend\")\n // input tables are expected to be pivoted already\n |> schema.fieldsAsCols()\n _counts =\n union(tables: [_dummy, tables])\n |> keep(columns: [\"_measurement\", \"_time\"])\n // _measurement column is always present\n |> duplicate(column: \"_measurement\", as: \"__value__\")\n |> count(column: \"__value__\")\n |> findColumn(fn: (key) => key._measurement == measurement, column: \"__value__\")\n _tables =\n // only dummy table is in the concatenated stream\n if _counts[0] == 1 then\n _dummy\n |> drop(columns: [\"unknown\"])\n // need empty table\n |> limit(n: 0)\n else\n tables\n\n return\n _tables\n // _measurement column is always present\n |> duplicate(column: \"_measurement\", as: \"__value__\")\n |> count(column: \"__value__\")\n // recreate _time column after aggregation\n |> map(fn: (r) => ({r with _time: now()}))\n // same tag that monitor.deadman() adds\n |> map(fn: (r) => ({r with dead: r.__value__ <= threshold}))\n // drop dummy field\n |> drop(columns: [\"__value__\"])\n |> alert(\n check: check,\n id: id,\n message: message,\n crit: (r) => r.dead,\n topic: topic,\n )\n }"},"examples":[],"metadata":{"tags":"transformations"}},"defineCheck":{"kind":"Function","name":"defineCheck","headline":"defineCheck creates custom check data required by `alert()` and `deadman()`.","description":null,"parameters":[{"name":"id","headline":"id: InfluxDB check ID.","description":null,"required":true},{"name":"name","headline":"name: InfluxDB check name.","description":null,"required":true},{"name":"type","headline":"type: InfluxDB check type. Default is `custom`.","description":null,"required":false}],"flux_type":"(id: A, name: B, ?type: C) => {tags: {}, _type: C, _check_name: B, _check_id: A}","is_option":false,"source_location":{"file":"contrib/bonitoo-io/tickscript/tickscript.flux","start":{"line":49,"column":1},"end":{"line":51,"column":2},"source":"defineCheck = (id, name, type=\"custom\") => {\n return {_check_id: id, _check_name: name, _type: type, tags: {}}\n}"},"examples":[],"metadata":null},"groupBy":{"kind":"Function","name":"groupBy","headline":"groupBy groups results by the `_measurement` column and other specified columns.","description":null,"parameters":[{"name":"columns","headline":"columns: List of columns to group by.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], columns: [string]) => stream[A] where A: Record","is_option":false,"source_location":{"file":"contrib/bonitoo-io/tickscript/tickscript.flux","start":{"line":431,"column":1},"end":{"line":435,"column":73},"source":"groupBy = (columns, tables=<-) =>\n tables\n |> group(columns: columns)\n // required by monitor.check\n |> experimental.group(columns: [\"_measurement\"], mode: \"extend\")"},"examples":[],"metadata":{"tags":"transformations"}},"join":{"kind":"Function","name":"join","headline":"join merges two input streams into a single output stream\nbased on specified columns with equal values and appends a new measurement name.","description":null,"parameters":[{"name":"tables","headline":"tables: Map of two streams to join.","description":null,"required":true},{"name":"on","headline":"on: List of columns to join on. Default is `[\"_time\"]`.","description":null,"required":false},{"name":"measurement","headline":"measurement: Measurement name to use in results.","description":null,"required":true}],"flux_type":"(measurement: A, tables: B, ?on: [string]) => stream[{C with _measurement: A}] where B: Record, C: Record","is_option":false,"source_location":{"file":"contrib/bonitoo-io/tickscript/tickscript.flux","start":{"line":488,"column":1},"end":{"line":492,"column":73},"source":"join = (tables, on=[\"_time\"], measurement) =>\n universe.join(tables: tables, on: on)\n |> map(fn: (r) => ({r with _measurement: measurement}))\n // required by monitor.check\n |> experimental.group(columns: [\"_measurement\"], mode: \"extend\")"},"examples":[],"metadata":{"tags":"transformations"}},"select":{"kind":"Function","name":"select","headline":"select changes a column’s name and optionally applies an aggregate or selector\nfunction to values in the column.","description":null,"parameters":[{"name":"column","headline":"column: Column to operate on. Default is `_value`.","description":null,"required":false},{"name":"fn","headline":"fn: Aggregate or selector function to apply.","description":null,"required":false},{"name":"as","headline":"as: New column name.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: B, as: string, ?column: A, ?fn: (<-: B, column: A) => stream[C]) => stream[D] where A: Equatable, C: Record, D: Record","is_option":false,"source_location":{"file":"contrib/bonitoo-io/tickscript/tickscript.flux","start":{"line":310,"column":1},"end":{"line":318,"column":2},"source":"select = (column=\"_value\", fn=(column, tables=<-) => tables, as, tables=<-) => {\n _column = column\n _as = as\n\n return\n tables\n |> fn(column: _column)\n |> rename(fn: (column) => if column == _column then _as else column)\n}"},"examples":[],"metadata":{"tags":"transformations"}},"selectWindow":{"kind":"Function","name":"selectWindow","headline":"selectWindow changes a column’s name, windows rows by time, and then applies an\naggregate or selector function the specified column for each window of time.","description":null,"parameters":[{"name":"column","headline":"column: Column to operate on. Default is _value.","description":null,"required":false},{"name":"fn","headline":"fn: Aggregate or selector function to apply.","description":null,"required":true},{"name":"as","headline":"as: New column name.","description":null,"required":true},{"name":"every","headline":"every: Duration of windows.","description":null,"required":true},{"name":"defaultValue","headline":"defaultValue: Default fill value for null values in column.\n Must be the same data type as column.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[D],\n as: string,\n defaultValue: A,\n every: duration,\n fn: (<-: stream[B], column: string) => stream[C],\n ?column: string,\n) => stream[E] where B: Record, C: Record, D: Record, E: Record","is_option":false,"source_location":{"file":"contrib/bonitoo-io/tickscript/tickscript.flux","start":{"line":362,"column":1},"end":{"line":379,"column":6},"source":"selectWindow = (\n column=\"_value\",\n fn,\n as,\n every,\n defaultValue,\n tables=<-,\n ) =>\n {\n _column = column\n _as = as\n\n return\n tables\n |> aggregateWindow(every: every, fn: fn, column: _column, createEmpty: true)\n |> fill(column: _column, value: defaultValue)\n |> rename(fn: (column) => if column == _column then _as else column)\n }"},"examples":[],"metadata":{"tags":"transformations"}}},"examples":[],"metadata":{"introduced":"0.111.0"}},{"path":"contrib/bonitoo-io/victorops","name":"victorops","headline":"Package victorops provides functions that send events to [VictorOps](https://victorops.com/).","description":null,"members":{"alert":{"kind":"Function","name":"alert","headline":"alert sends an alert to VictorOps.","description":null,"parameters":[{"name":"url","headline":"url: VictorOps REST endpoint integration URL.","description":null,"required":true},{"name":"monitoringTool","headline":"monitoringTool: Monitoring agent name. Default is `\"\"`.","description":null,"required":false},{"name":"messageType","headline":"messageType: VictorOps message type (alert behavior).","description":null,"required":true},{"name":"entityID","headline":"entityID: Incident ID. Default is `\"\"`.","description":null,"required":false},{"name":"entityDisplayName","headline":"entityDisplayName: Incident display name or summary. Default is `\"\"`.","description":null,"required":false},{"name":"stateMessage","headline":"stateMessage: Verbose incident message. Default is `\"\"`.","description":null,"required":false},{"name":"timestamp","headline":"timestamp: Incident start time. Default is `now()`.","description":null,"required":false}],"flux_type":"(\n messageType: A,\n url: string,\n ?entityDisplayName: B,\n ?entityID: C,\n ?monitoringTool: D,\n ?stateMessage: E,\n ?timestamp: F,\n) => int","is_option":false,"source_location":{"file":"contrib/bonitoo-io/victorops/victorops.flux","start":{"line":77,"column":1},"end":{"line":100,"column":6},"source":"alert = (\n url,\n messageType,\n entityID=\"\",\n entityDisplayName=\"\",\n stateMessage=\"\",\n timestamp=now(),\n monitoringTool=\"InfluxDB\",\n ) =>\n {\n alert = {\n message_type: messageType,\n entity_id: entityID,\n entity_display_name: entityDisplayName,\n state_message: stateMessage,\n // required in seconds\n state_start_time: uint(v: timestamp) / uint(v: 1000000000),\n monitoring_tool: monitoringTool,\n }\n headers = {\"Content-Type\": \"application/json\"}\n body = json.encode(v: alert)\n\n return http.post(headers: headers, url: url, data: body)\n }"},"examples":[],"metadata":{"tags":"single notification"}},"endpoint":{"kind":"Function","name":"endpoint","headline":"endpoint sends events to VictorOps using data from input rows.","description":null,"parameters":[{"name":"url","headline":"url: VictorOps REST endpoint integration URL.","description":null,"required":true},{"name":"monitoringTool","headline":"monitoringTool: Tool to use for monitoring.\n Default is `InfluxDB`.","description":null,"required":false}],"flux_type":"(\n url: string,\n ?monitoringTool: A,\n) => (\n mapFn: (\n r: B,\n ) => {\n C with\n timestamp: H,\n stateMessage: G,\n messageType: F,\n entityID: E,\n entityDisplayName: D,\n },\n) => (<-tables: stream[B]) => stream[{B with _sent: string}]","is_option":false,"source_location":{"file":"contrib/bonitoo-io/victorops/victorops.flux","start":{"line":163,"column":1},"end":{"line":186,"column":18},"source":"endpoint = (url, monitoringTool=\"InfluxDB\") =>\n (mapFn) =>\n (tables=<-) =>\n tables\n |> map(\n fn: (r) => {\n obj = mapFn(r: r)\n\n return {r with _sent:\n string(\n v:\n 2 == alert(\n url: url,\n messageType: obj.messageType,\n entityID: obj.entityID,\n entityDisplayName: obj.entityDisplayName,\n stateMessage: obj.stateMessage,\n timestamp: obj.timestamp,\n monitoringTool: monitoringTool,\n ) / 100,\n ),\n }\n },\n )"},"examples":[],"metadata":{"tags":"notification endpoints, transformations"}}},"examples":[],"metadata":{"introduced":"0.108.0"}},{"path":"contrib/bonitoo-io/zenoss","name":"zenoss","headline":"Package zenoss provides functions that send events to [Zenoss](https://www.zenoss.com/).","description":null,"members":{"endpoint":{"kind":"Function","name":"endpoint","headline":"endpoint sends events to Zenoss using data from input rows.","description":null,"parameters":[{"name":"url","headline":"url: Zenoss [router endpoint URL](https://help.zenoss.com/zsd/RM/configuring-resource-manager/enabling-access-to-browser-interfaces/creating-and-changing-public-endpoints).","description":null,"required":true},{"name":"username","headline":"username: Zenoss username to use for HTTP BASIC authentication.\n Default is `\"\"` (no authentication).","description":null,"required":false},{"name":"password","headline":"password: Zenoss password to use for HTTP BASIC authentication.\n Default is `\"\"` (no authentication).","description":null,"required":false},{"name":"apiKey","headline":"apiKey: Zenoss cloud API key.\n Default is `\"\"` (no API key).","description":null,"required":false},{"name":"action","headline":"action: Zenoss router name.\n Default is `\"EventsRouter\"`.","description":null,"required":false},{"name":"method","headline":"method: EventsRouter method.\n Default is `\"add_event\"`.","description":null,"required":false},{"name":"type","headline":"type: Event type. Default is `\"rpc\"`.","description":null,"required":false},{"name":"tid","headline":"tid: Temporary request transaction ID.\n Default is `1`.","description":null,"required":false}],"flux_type":"(\n url: string,\n ?action: A,\n ?apiKey: B,\n ?method: C,\n ?password: string,\n ?tid: D,\n ?type: E,\n ?username: string,\n) => (\n mapFn: (\n r: F,\n ) => {\n G with\n summary: O,\n severity: N,\n message: M,\n eventClassKey: L,\n eventClass: K,\n device: J,\n component: I,\n collector: H,\n },\n) => (<-tables: stream[F]) => stream[{F with _sent: string}] where B: Equatable","is_option":false,"source_location":{"file":"contrib/bonitoo-io/zenoss/zenoss.flux","start":{"line":219,"column":1},"end":{"line":260,"column":18},"source":"endpoint = (\n url,\n username=\"\",\n password=\"\",\n apiKey=\"\",\n action=\"EventsRouter\",\n method=\"add_event\",\n type=\"rpc\",\n tid=1,\n) =>\n (mapFn) =>\n (tables=<-) =>\n tables\n |> map(\n fn: (r) => {\n obj = mapFn(r: r)\n\n return {r with _sent:\n string(\n v:\n 2 == event(\n url: url,\n username: username,\n password: password,\n apiKey: apiKey,\n action: action,\n method: method,\n type: type,\n tid: tid,\n summary: obj.summary,\n device: obj.device,\n component: obj.component,\n severity: obj.severity,\n eventClass: obj.eventClass,\n eventClassKey: obj.eventClassKey,\n collector: obj.collector,\n message: obj.message,\n ) / 100,\n ),\n }\n },\n )"},"examples":[],"metadata":{"tags":"notification endpoints, transformations"}},"event":{"kind":"Function","name":"event","headline":"event sends an event to [Zenoss](https://www.zenoss.com/).","description":null,"parameters":[{"name":"url","headline":"url: Zenoss [router endpoint URL](https://help.zenoss.com/zsd/RM/configuring-resource-manager/enabling-access-to-browser-interfaces/creating-and-changing-public-endpoints).","description":null,"required":true},{"name":"username","headline":"username: Zenoss username to use for HTTP BASIC authentication.\n Default is `\"\"` (no authentication).","description":null,"required":false},{"name":"password","headline":"password: Zenoss password to use for HTTP BASIC authentication.\n Default is `\"\"` (no authentication).","description":null,"required":false},{"name":"apiKey","headline":"apiKey: Zenoss cloud API key.\n Default is `\"\"` (no API key).","description":null,"required":false},{"name":"action","headline":"action: Zenoss router name.\n Default is \"EventsRouter\".","description":null,"required":false},{"name":"method","headline":"method: [EventsRouter method](https://help.zenoss.com/dev/collection-zone-and-resource-manager-apis/codebase/routers/router-reference/eventsrouter).\n Default is \"add_event\".","description":null,"required":false},{"name":"type","headline":"type: Event type.\n Default is \"rpc\".","description":null,"required":false},{"name":"tid","headline":"tid: Temporary request transaction ID.\n Default is `1`.","description":null,"required":false},{"name":"summary","headline":"summary: Event summary.\n Default is `\"\"`.","description":null,"required":false},{"name":"device","headline":"device: Related device.\n Default is `\"\"`.","description":null,"required":false},{"name":"component","headline":"component: Related component.\n Default is `\"\"`.","description":null,"required":false},{"name":"severity","headline":"severity: [Event severity level](https://help.zenoss.com/zsd/RM/administering-resource-manager/event-management/event-severity-levels).","description":null,"required":true},{"name":"eventClass","headline":"eventClass: [Event class](https://help.zenoss.com/zsd/RM/administering-resource-manager/event-management/understanding-event-classes).\n Default is `\"\"`.","description":null,"required":false},{"name":"eventClassKey","headline":"eventClassKey: Event [class key](https://help.zenoss.com/zsd/RM/administering-resource-manager/event-management/event-fields).\n Default is `\"\"`.","description":null,"required":false},{"name":"collector","headline":"collector: Zenoss [collector](https://help.zenoss.com/zsd/RM/administering-resource-manager/event-management/event-fields).\n Default is `\"\"`.","description":null,"required":false},{"name":"message","headline":"message: Related message.\n Default is `\"\"`.","description":null,"required":false}],"flux_type":"(\n severity: A,\n url: string,\n ?action: B,\n ?apiKey: C,\n ?collector: D,\n ?component: E,\n ?device: F,\n ?eventClass: G,\n ?eventClassKey: H,\n ?message: I,\n ?method: J,\n ?password: string,\n ?summary: K,\n ?tid: L,\n ?type: M,\n ?username: string,\n) => int where C: Equatable","is_option":false,"source_location":{"file":"contrib/bonitoo-io/zenoss/zenoss.flux","start":{"line":90,"column":1},"end":{"line":140,"column":6},"source":"event = (\n url,\n username=\"\",\n password=\"\",\n apiKey=\"\",\n action=\"EventsRouter\",\n method=\"add_event\",\n type=\"rpc\",\n tid=1,\n summary=\"\",\n device=\"\",\n component=\"\",\n severity,\n eventClass=\"\",\n eventClassKey=\"\",\n collector=\"\",\n message=\"\",\n ) =>\n {\n event = {\n summary: summary,\n device: device,\n component: component,\n severity: severity,\n evclass: eventClass,\n evclasskey: eventClassKey,\n collector: collector,\n message: message,\n }\n payload = {\n action: action,\n method: method,\n data: [event],\n type: type,\n tid: tid,\n }\n headers = {\"Content-Type\": \"application/json\"}\n body = json.encode(v: payload)\n\n return\n if apiKey != \"\" then\n http.post(headers: {headers with \"z-api-key\": apiKey}, url: url, data: body)\n else\n http.post(\n headers: {headers with \"Authorization\":\n http.basicAuth(u: username, p: password),\n },\n url: url,\n data: body,\n )\n }"},"examples":[],"metadata":{"tags":"single notification"}}},"examples":[],"metadata":{"introduced":"0.108.0"}},{"path":"contrib/chobbs/discord","name":"discord","headline":"Package discord provides functions for sending messages to [Discord](https://discord.com/).","description":null,"members":{"discordURL":{"kind":"Value","name":"discordURL","headline":"discordURL is the Discord webhook URL.\nDefault is `https://discordapp.com/api/webhooks/`.","description":null,"flux_type":"string","is_option":true,"source_location":{"file":"contrib/chobbs/discord/discord.flux","start":{"line":15,"column":1},"end":{"line":15,"column":59},"source":"option discordURL = \"https://discordapp.com/api/webhooks/\""},"examples":[],"metadata":null},"endpoint":{"kind":"Function","name":"endpoint","headline":"endpoint sends a single message to a Discord channel using a\n[Discord webhook](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks&?page=3)\nand data from table rows.","description":null,"parameters":[{"name":"webhookToken","headline":"webhookToken: Discord [webhook token](https://discord.com/developers/docs/resources/webhook).","description":null,"required":true},{"name":"webhookID","headline":"webhookID: Discord [webhook ID](https://discord.com/developers/docs/resources/webhook).","description":null,"required":true},{"name":"username","headline":"username: Override the Discord webhook’s default username.","description":null,"required":true},{"name":"avatar_url","headline":"avatar_url: Override the Discord webhook’s default avatar.","description":null,"required":false}],"flux_type":"(\n username: A,\n webhookID: string,\n webhookToken: string,\n ?avatar_url: B,\n) => (mapFn: (r: C) => {D with content: E}) => (<-tables: stream[C]) => stream[{C with _sent: string}]","is_option":false,"source_location":{"file":"contrib/chobbs/discord/discord.flux","start":{"line":125,"column":1},"end":{"line":146,"column":18},"source":"endpoint = (webhookToken, webhookID, username, avatar_url=\"\") =>\n (mapFn) =>\n (tables=<-) =>\n tables\n |> map(\n fn: (r) => {\n obj = mapFn(r: r)\n\n return {r with _sent:\n string(\n v:\n 2 == send(\n webhookToken: webhookToken,\n webhookID: webhookID,\n username: username,\n avatar_url: avatar_url,\n content: obj.content,\n ) / 100,\n ),\n }\n },\n )"},"examples":[],"metadata":{"tags":"notifcation endpoints, transformations"}},"send":{"kind":"Function","name":"send","headline":"send sends a single message to a Discord channel using a Discord webhook.","description":null,"parameters":[{"name":"webhookToken","headline":"webhookToken: Discord [webhook token](https://discord.com/developers/docs/resources/webhook).","description":null,"required":true},{"name":"webhookID","headline":"webhookID: Discord [webhook ID](https://discord.com/developers/docs/resources/webhook).","description":null,"required":true},{"name":"username","headline":"username: Override the Discord webhook’s default username.","description":null,"required":true},{"name":"content","headline":"content: Message to send to Discord (2000 character limit).","description":null,"required":true},{"name":"avatar_url","headline":"avatar_url: Override the Discord webhook’s default avatar.","description":null,"required":false}],"flux_type":"(\n content: A,\n username: B,\n webhookID: string,\n webhookToken: string,\n ?avatar_url: C,\n) => int","is_option":false,"source_location":{"file":"contrib/chobbs/discord/discord.flux","start":{"line":53,"column":1},"end":{"line":71,"column":6},"source":"send = (\n webhookToken,\n webhookID,\n username,\n content,\n avatar_url=\"\",\n ) =>\n {\n data = {username: username, content: content, avatar_url: avatar_url}\n headers = {\"Content-Type\": \"application/json\"}\n encode = json.encode(v: data)\n\n return\n http.post(\n headers: headers,\n url: discordURL + webhookID + \"/\" + webhookToken,\n data: encode,\n )\n }"},"examples":[],"metadata":{"tags":"single notification"}}},"examples":[],"metadata":{"introduced":"0.69.0"}},{"path":"contrib/jsternberg/influxdb","name":"influxdb","headline":"Package influxdb provides additional functions for querying data from InfluxDB.","description":null,"members":{"from":{"kind":"Function","name":"from","headline":"from retrieves data from an InfluxDB bucket between the `start` and `stop` times.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Name of the bucket to query.","description":null,"required":true},{"name":"start","headline":"start: Earliest time to include in results.","description":null,"required":true},{"name":"stop","headline":"stop: Latest time to include in results. Default is `now()`.","description":null,"required":false},{"name":"host","headline":"host: URL of the InfluxDB instance to query.","description":null,"required":false},{"name":"org","headline":"org: Organization name.","description":null,"required":false},{"name":"token","headline":"token: InfluxDB [API token](https://docs.influxdata.com/influxdb/latest/security/tokens/).","description":null,"required":false}],"flux_type":"(\n bucket: string,\n start: A,\n ?host: string,\n ?org: string,\n ?stop: B,\n ?token: string,\n) => stream[{\n C with\n _value: D,\n _time: time,\n _stop: time,\n _start: time,\n _measurement: string,\n _field: string,\n}]","is_option":false,"source_location":{"file":"contrib/jsternberg/influxdb/influxdb.flux","start":{"line":83,"column":1},"end":{"line":111,"column":6},"source":"from = (\n bucket,\n start,\n stop=now(),\n org=\"\",\n host=\"\",\n token=\"\",\n ) =>\n {\n source =\n if org != \"\" and host != \"\" and token != \"\" then\n influxdb.from(bucket, org, host, token)\n else if org != \"\" and token != \"\" then\n influxdb.from(bucket, org, token)\n else if org != \"\" and host != \"\" then\n influxdb.from(bucket, org, host)\n else if host != \"\" and token != \"\" then\n influxdb.from(bucket, host, token)\n else if org != \"\" then\n influxdb.from(bucket, org)\n else if host != \"\" then\n influxdb.from(bucket, host)\n else if token != \"\" then\n influxdb.from(bucket, token)\n else\n influxdb.from(bucket)\n\n return source |> range(start, stop)\n }"},"examples":[],"metadata":{"tags":"inputs"}},"select":{"kind":"Function","name":"select","headline":"select is an alternate implementation of `from()`,\n`range()`, `filter()` and `pivot()` that returns pivoted query results and masks\nthe `_measurement`, `_start`, and `_stop` columns. Results are similar to those\nreturned by InfluxQL `SELECT` statements.","description":null,"parameters":[{"name":"from","headline":"from: Name of the bucket to query.","description":null,"required":true},{"name":"start","headline":"start: Earliest time to include in results.","description":null,"required":true},{"name":"stop","headline":"stop: Latest time to include in results. Default is `now()`.","description":null,"required":false},{"name":"m","headline":"m: Name of the measurement to query.","description":null,"required":true},{"name":"fields","headline":"fields: List of fields to query. Default is`[]`.","description":null,"required":false},{"name":"where","headline":"where: Single argument predicate function that evaluates `true` or `false`\n and filters results based on tag values.\n Default is `(r) => true`.","description":null,"required":false},{"name":"host","headline":"host: URL of the InfluxDB instance to query.","description":null,"required":false},{"name":"org","headline":"org: Organization name.","description":null,"required":false},{"name":"token","headline":"token: InfluxDB [API token](https://docs.influxdata.com/influxdb/latest/security/tokens/).","description":null,"required":false}],"flux_type":"(\n from: string,\n m: A,\n start: B,\n ?fields: [string],\n ?host: string,\n ?org: string,\n ?stop: C,\n ?token: string,\n ?where: (\n r: {\n D with\n _value: E,\n _time: time,\n _stop: time,\n _start: time,\n _measurement: string,\n _field: string,\n },\n ) => bool,\n) => stream[F] where A: Equatable, F: Record","is_option":false,"source_location":{"file":"contrib/jsternberg/influxdb/influxdb.flux","start":{"line":215,"column":1},"end":{"line":267,"column":6},"source":"select = (\n from,\n start,\n stop=now(),\n m,\n fields=[],\n org=\"\",\n host=\"\",\n token=\"\",\n where=(r) => true,\n ) =>\n {\n bucket = from\n tables =\n _from(\n bucket,\n start,\n stop,\n org,\n host,\n token,\n )\n |> filter(fn: (r) => r._measurement == m)\n |> filter(fn: where)\n nfields = length(arr: fields)\n fn =\n if nfields == 0 then\n (r) => true\n else if nfields == 1 then\n (r) => r._field == fields[0]\n else if nfields == 2 then\n (r) => r._field == fields[0] or r._field == fields[1]\n else if nfields == 3 then\n (r) => r._field == fields[0] or r._field == fields[1] or r._field == fields[2]\n else if nfields == 4 then\n (r) =>\n r._field == fields[0] or r._field == fields[1] or r._field == fields[2]\n or\n r._field == fields[3]\n else if nfields == 5 then\n (r) =>\n r._field == fields[0] or r._field == fields[1] or r._field == fields[2]\n or\n r._field == fields[3] or r._field == fields[4]\n else\n (r) => contains(value: r._field, set: fields)\n\n return\n tables\n |> filter(fn)\n |> v1.fieldsAsCols()\n |> _mask(columns: [\"_measurement\", \"_start\", \"_stop\"])\n }"},"examples":[],"metadata":{"tags":"inputs"}}},"examples":[],"metadata":{"introduced":"0.77.0"}},{"path":"contrib/qxip/clickhouse","name":"clickhouse","headline":"Package clickhouse provides functions to query [ClickHouse](https://clickhouse.com/) using the ClickHouse HTTP API.","description":null,"members":{"defaultURL":{"kind":"Value","name":"defaultURL","headline":"defaultURL is the default ClickHouse HTTP API URL.","description":null,"flux_type":"string","is_option":true,"source_location":{"file":"contrib/qxip/clickhouse/clickhouse.flux","start":{"line":14,"column":1},"end":{"line":14,"column":44},"source":"option defaultURL = \"http://127.0.0.1:8123\""},"examples":[],"metadata":null},"query":{"kind":"Function","name":"query","headline":"query queries data from ClickHouse using specified parameters.","description":null,"parameters":[{"name":"url","headline":"url: ClickHouse HTTP API URL. Default is `http://127.0.0.1:8123`.","description":null,"required":false},{"name":"query","headline":"query: ClickHouse query to execute.","description":null,"required":true},{"name":"limit","headline":"limit: Query rows limit. Defaults is `100`.","description":null,"required":false},{"name":"cors","headline":"cors: Request remote CORS headers. Defaults is `1`.","description":null,"required":false},{"name":"max_bytes","headline":"max_bytes: Query bytes limit. Default is `10000000`.","description":null,"required":false},{"name":"format","headline":"format: Query format. Default is `CSVWithNames`.","description":null,"required":false}],"flux_type":"(\n query: string,\n ?cors: string,\n ?format: string,\n ?limit: A,\n ?max_bytes: B,\n ?url: string,\n) => stream[C] where A: Stringable, B: Stringable, C: Record","is_option":false,"source_location":{"file":"contrib/qxip/clickhouse/clickhouse.flux","start":{"line":42,"column":1},"end":{"line":66,"column":6},"source":"query = (\n url=defaultURL,\n query,\n limit=100,\n cors=\"1\",\n max_bytes=10000000,\n format=\"CSVWithNames\",\n ) =>\n {\n response =\n requests.get(\n url: url,\n params:\n [\n \"query\": [query],\n \"default_format\": [format],\n \"max_result_rows\": [\"${limit}\"],\n \"max_result_bytes\": [\"${max_bytes}\"],\n \"add_http_cors_header\": [cors],\n ],\n headers: [\"X-ClickHouse-Format\": string(v: format)],\n )\n\n return csv.from(csv: string(v: response.body), mode: \"raw\")\n }"},"examples":[],"metadata":{"tags":"inputs"}}},"examples":[],"metadata":{"introduced":"0.192.0"}},{"path":"contrib/qxip/hash","name":"hash","headline":"Package hash provides functions that convert string values to hashes.","description":null,"members":{"b64":{"kind":"Function","name":"b64","headline":"b64 converts a string value to a Base64 string.","description":null,"parameters":[{"name":"v","headline":"v: String to hash.","description":null,"required":true}],"flux_type":"(v: A) => string","is_option":false,"source_location":{"file":"contrib/qxip/hash/hash.flux","start":{"line":110,"column":1},"end":{"line":110,"column":31},"source":"builtin b64 : (v: A) => string"},"examples":[],"metadata":{"introduced":"0.193.0","tag":"type-conversion"}},"cityhash64":{"kind":"Function","name":"cityhash64","headline":"cityhash64 converts a string value to a 64-bit hexadecimal hash using the CityHash64 algorithm.","description":null,"parameters":[{"name":"v","headline":"v: String to hash.","description":null,"required":true}],"flux_type":"(v: A) => string","is_option":false,"source_location":{"file":"contrib/qxip/hash/hash.flux","start":{"line":89,"column":1},"end":{"line":89,"column":38},"source":"builtin cityhash64 : (v: A) => string"},"examples":[],"metadata":{"tag":"type-conversion"}},"hmac":{"kind":"Function","name":"hmac","headline":"hmac converts a string value to an MD5-signed SHA-1 hash.","description":null,"parameters":[{"name":"v","headline":"v: String to hash.","description":null,"required":true},{"name":"k","headline":"k: Key to sign hash.","description":null,"required":true}],"flux_type":"(k: A, v: A) => string","is_option":false,"source_location":{"file":"contrib/qxip/hash/hash.flux","start":{"line":153,"column":1},"end":{"line":153,"column":38},"source":"builtin hmac : (v: A, k: A) => string"},"examples":[],"metadata":{"introduced":"0.193.0","tag":"type-conversion"}},"md5":{"kind":"Function","name":"md5","headline":"md5 converts a string value to an MD5 hash.","description":null,"parameters":[{"name":"v","headline":"v: String to hash.","description":null,"required":true}],"flux_type":"(v: A) => string","is_option":false,"source_location":{"file":"contrib/qxip/hash/hash.flux","start":{"line":131,"column":1},"end":{"line":131,"column":31},"source":"builtin md5 : (v: A) => string"},"examples":[],"metadata":{"introduced":"0.193.0","tag":"type-conversion"}},"sha1":{"kind":"Function","name":"sha1","headline":"sha1 converts a string value to a hexadecimal hash using the SHA-1 hash algorithm.","description":null,"parameters":[{"name":"v","headline":"v: String to hash.","description":null,"required":true}],"flux_type":"(v: A) => string","is_option":false,"source_location":{"file":"contrib/qxip/hash/hash.flux","start":{"line":49,"column":1},"end":{"line":49,"column":32},"source":"builtin sha1 : (v: A) => string"},"examples":[],"metadata":{"introduced":"0.193.0","tag":"type-conversion"}},"sha256":{"kind":"Function","name":"sha256","headline":"sha256 converts a string value to a hexadecimal hash using the SHA 256 hash algorithm.","description":null,"parameters":[{"name":"v","headline":"v: String to hash.","description":null,"required":true}],"flux_type":"(v: A) => string","is_option":false,"source_location":{"file":"contrib/qxip/hash/hash.flux","start":{"line":28,"column":1},"end":{"line":28,"column":34},"source":"builtin sha256 : (v: A) => string"},"examples":[],"metadata":{"tag":"type-conversion"}},"xxhash64":{"kind":"Function","name":"xxhash64","headline":"xxhash64 converts a string value to a 64-bit hexadecimal hash using the xxHash algorithm.","description":null,"parameters":[{"name":"v","headline":"v: String to hash.","description":null,"required":true}],"flux_type":"(v: A) => string","is_option":false,"source_location":{"file":"contrib/qxip/hash/hash.flux","start":{"line":69,"column":1},"end":{"line":69,"column":36},"source":"builtin xxhash64 : (v: A) => string"},"examples":[],"metadata":{"tag":"type-conversion"}}},"examples":[],"metadata":{"introduced":"0.192.0"}},{"path":"contrib/qxip/iox","name":"iox","headline":"Package iox provides additional functions for querying data from InfluxDB IOx.","description":null,"members":{"from":{"kind":"Function","name":"from","headline":"from retrieves data from an IOx bucket between the `start` and `stop` times.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Name of the IOx bucket to query.","description":null,"required":true},{"name":"start","headline":"start: Earliest time to include in results.","description":null,"required":false},{"name":"stop","headline":"stop: Latest time to include in results. Default is `now()`.","description":null,"required":false},{"name":"host","headline":"host: URL of the IOx instance to query.","description":null,"required":false},{"name":"org","headline":"org: Organization name.","description":null,"required":false},{"name":"token","headline":"token: [API token](https://docs.influxdata.com/influxdb/latest/security/tokens/).","description":null,"required":false},{"name":"table","headline":"table: Table used in the FlightSQL query.","description":null,"required":false},{"name":"limit","headline":"limit: Limit for the FlightSQL query. Default is `1000`.","description":null,"required":false},{"name":"columns","headline":"columns: Columns selected by the FlightSQL query. Default is `*`.","description":null,"required":false},{"name":"secure","headline":"secure: Secure connection to IOx instance. Default is `true`.","description":null,"required":false}],"flux_type":"(\n bucket: A,\n ?columns: B,\n ?host: C,\n ?limit: D,\n ?org: E,\n ?secure: F,\n ?start: G,\n ?stop: H,\n ?table: I,\n ?token: J,\n) => stream[K] where A: Stringable, B: Stringable, C: Equatable + Stringable, D: Stringable, E: Equatable + Stringable, F: Stringable, G: Timeable, H: Timeable, I: Stringable, J: Equatable + Stringable, K: Record","is_option":false,"source_location":{"file":"contrib/qxip/iox/iox.flux","start":{"line":76,"column":1},"end":{"line":120,"column":10},"source":"from =\n (\n bucket,\n start=-1h,\n stop=now(),\n org=\"\",\n host=\"\",\n token=\"\",\n table=\"\",\n columns=\"*\",\n limit=\"1000\",\n secure=\"true\",\n ) =>\n {\n\n dataSourceName =\n if org != \"\" and host != \"\" and token != \"\" then\n \"iox://${host}/${bucket}?secure=${secure}&token=${token}\"\n else if org != \"\" and token != \"\" then\n \"iox://${host}/${org}_${bucket}?secure=${secure}&token=${token}\"\n else if org != \"\" and host != \"\" then\n \"iox://${host}/${org}_${bucket}?secure=${secure}\"\n else if host != \"\" and token != \"\" then\n \"iox://${host}/${bucket}?secure=${secure}&token=${token}\"\n else if org != \"\" then\n \"iox://${host}/${org}_${bucket}?secure=${secure}\"\n else if host != \"\" then\n \"iox://${host}/${bucket}?secure=${secure}&token=${token}\"\n else\n \"iox://${host}/${bucket}?secure=${secure}\"\n\n qStart = date.time(t: start)\n qStop = date.time(t: stop)\n query =\n \"SELECT ${columns} FROM ${table} WHERE ( time >= '${qStart}' AND time <= '${qStop}') LIMIT ${limit}\"\n\n source =\n sql.from(\n driverName: \"influxdb-iox\",\n dataSourceName: \"${dataSourceName}\",\n query: \"${query}\",\n )\n\n return source |> rename(columns: {time: \"_time\"})\n }"},"examples":[],"metadata":{"tags":"inputs"}}},"examples":[],"metadata":{"introduced":"0.195.0"}},{"path":"contrib/qxip/logql","name":"logql","headline":"Package logql provides functions for using [LogQL](https://grafana.com/docs/loki/latest/logql/) to query a [Loki](https://grafana.com/oss/loki/) data source.","description":null,"members":{"defaultAPI":{"kind":"Value","name":"defaultAPI","headline":"defaultAPI is the default LogQL Query Range API Path.","description":null,"flux_type":"string","is_option":true,"source_location":{"file":"contrib/qxip/logql/logql.flux","start":{"line":20,"column":1},"end":{"line":20,"column":47},"source":"option defaultAPI = \"/loki/api/v1/query_range\""},"examples":[],"metadata":null},"defaultURL":{"kind":"Value","name":"defaultURL","headline":"defaultURL is the default LogQL HTTP API URL.","description":null,"flux_type":"string","is_option":true,"source_location":{"file":"contrib/qxip/logql/logql.flux","start":{"line":17,"column":1},"end":{"line":17,"column":44},"source":"option defaultURL = \"http://127.0.0.1:3100\""},"examples":[],"metadata":null},"query_range":{"kind":"Function","name":"query_range","headline":"query_range queries data from a specified LogQL query within given time bounds,\nfilters data by query, timerange, and optional limit expressions.\nAll values are returned as string values (using `raw` mode in `csv.from`)","description":null,"parameters":[{"name":"url","headline":"url: LogQL/qryn URL and port. Default is `http://qryn:3100`.","description":null,"required":false},{"name":"path","headline":"path: LogQL query_range API path.","description":null,"required":false},{"name":"limit","headline":"limit: Query limit. Default is 100.","description":null,"required":false},{"name":"query","headline":"query: LogQL query to execute.","description":null,"required":true},{"name":"start","headline":"start: Earliest time to include in results. Default is `-1h`.","description":null,"required":false},{"name":"end","headline":"end: Latest time to include in results. Default is `now()`.","description":null,"required":false},{"name":"step","headline":"step: Query resolution step width in seconds. Default is 10.","description":null,"required":false},{"name":"orgid","headline":"orgid: Optional Loki organization ID for partitioning. Default is `\"\"`.","description":null,"required":false}],"flux_type":"(\n query: string,\n ?end: A,\n ?limit: B,\n ?orgid: string,\n ?path: string,\n ?start: C,\n ?step: D,\n ?url: string,\n) => stream[E] where A: Timeable, B: Stringable, C: Timeable, D: Stringable, E: Record","is_option":false,"source_location":{"file":"contrib/qxip/logql/logql.flux","start":{"line":66,"column":1},"end":{"line":96,"column":6},"source":"query_range = (\n url=defaultURL,\n path=defaultAPI,\n query,\n limit=100,\n step=10,\n start=-1h,\n end=now(),\n orgid=\"\",\n ) =>\n {\n dstart = date.time(t: start)\n dend = date.time(t: end)\n response =\n requests.get(\n url: url + path,\n params:\n [\n \"query\": [query],\n \"limit\": [\"${limit}\"],\n \"start\": [string(v: uint(v: dstart))],\n \"end\": [string(v: uint(v: dend))],\n \"step\": [\"${step}\"],\n \"csv\": [\"1\"],\n ],\n headers: if orgid != \"\" then [\"X-Scope-OrgID\": orgid] else [:],\n body: bytes(v: query),\n )\n\n return csv.from(csv: string(v: response.body), mode: \"raw\")\n }"},"examples":[],"metadata":{"tags":"inputs"}}},"examples":[],"metadata":{"introduced":"0.192.0"}},{"path":"contrib/rhajek/bigpanda","name":"bigpanda","headline":"Package bigpanda provides functions for sending alerts to [BigPanda](https://www.bigpanda.io/).","description":null,"members":{"defaultTokenPrefix":{"kind":"Value","name":"defaultTokenPrefix","headline":"defaultTokenPrefix is the default HTTP authentication scheme to use when authenticating with BigPanda.\nDefault is `Bearer`.","description":null,"flux_type":"string","is_option":true,"source_location":{"file":"contrib/rhajek/bigpanda/bigpanda.flux","start":{"line":21,"column":1},"end":{"line":21,"column":37},"source":"option defaultTokenPrefix = \"Bearer\""},"examples":[],"metadata":null},"defaultUrl":{"kind":"Value","name":"defaultUrl","headline":"defaultUrl is the default [BigPanda alerts API URL](https://docs.bigpanda.io/reference#alerts-how-it-works)\nfor functions in the `bigpanda` package.\nDefault is `https://api.bigpanda.io/data/v2/alerts`.","description":null,"flux_type":"string","is_option":true,"source_location":{"file":"contrib/rhajek/bigpanda/bigpanda.flux","start":{"line":17,"column":1},"end":{"line":17,"column":61},"source":"option defaultUrl = \"https://api.bigpanda.io/data/v2/alerts\""},"examples":[],"metadata":null},"endpoint":{"kind":"Function","name":"endpoint","headline":"endpoint sends alerts to BigPanda using data from input rows.","description":null,"parameters":[{"name":"url","headline":"url: BigPanda [alerts API URL](https://docs.bigpanda.io/reference#alerts-how-it-works).\n Default is the value of the `bigpanda.defaultURL` option.","description":null,"required":false},{"name":"token","headline":"token: BigPanda [API Authorization token (API key)](https://docs.bigpanda.io/docs/api-key-management).","description":null,"required":true},{"name":"appKey","headline":"appKey: BigPanda [App Key](https://docs.bigpanda.io/reference#integrating-monitoring-systems).","description":null,"required":true}],"flux_type":"(\n appKey: A,\n token: string,\n ?url: string,\n) => (mapFn: (r: B) => {C with status: D}) => (<-tables: stream[B]) => stream[{B with _sent: string}]","is_option":false,"source_location":{"file":"contrib/rhajek/bigpanda/bigpanda.flux","start":{"line":214,"column":1},"end":{"line":235,"column":18},"source":"endpoint = (url=defaultUrl, token, appKey) =>\n (mapFn) =>\n (tables=<-) =>\n tables\n |> map(\n fn: (r) => {\n obj = mapFn(r: r)\n\n return {r with _sent:\n string(\n v:\n 2 == sendAlert(\n url: url,\n appKey: appKey,\n token: token,\n status: obj.status,\n rec: obj,\n ) / 100,\n ),\n }\n },\n )"},"examples":[],"metadata":{"tags":"notification endpoints, transformations"}},"sendAlert":{"kind":"Function","name":"sendAlert","headline":"sendAlert sends an alert to [BigPanda](https://www.bigpanda.io/).","description":null,"parameters":[{"name":"url","headline":"url: BigPanda [alerts API URL](https://docs.bigpanda.io/reference#alerts-how-it-works).\n Default is the value of the `bigpanda.defaultURL` option.","description":null,"required":true},{"name":"token","headline":"token: BigPanda [API Authorization token (API key)](https://docs.bigpanda.io/docs/api-key-management).","description":null,"required":true},{"name":"appKey","headline":"appKey: BigPanda [App Key](https://docs.bigpanda.io/reference#integrating-monitoring-systems).","description":null,"required":true},{"name":"status","headline":"status: BigPanda [alert status](https://docs.bigpanda.io/reference#alerts).","description":null,"required":true},{"name":"rec","headline":"rec: Additional [alert parameters](https://docs.bigpanda.io/reference#alert-object) to send to the BigPanda alert API.","description":null,"required":true}],"flux_type":"(\n appKey: A,\n rec: B,\n status: C,\n token: string,\n url: string,\n) => int","is_option":false,"source_location":{"file":"contrib/rhajek/bigpanda/bigpanda.flux","start":{"line":142,"column":1},"end":{"line":157,"column":6},"source":"sendAlert = (\n url,\n token,\n appKey,\n status,\n rec,\n ) =>\n {\n headers = {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": defaultTokenPrefix + \" \" + token,\n }\n data = {rec with app_key: appKey, status: status}\n\n return http.post(headers: headers, url: url, data: json.encode(v: data))\n }"},"examples":[],"metadata":{"tags":"single notification"}},"statusFromLevel":{"kind":"Function","name":"statusFromLevel","headline":"statusFromLevel converts an alert level to a BigPanda status.","description":null,"parameters":[{"name":"level","headline":"level: Alert level.","description":null,"required":true}],"flux_type":"(level: string) => string","is_option":false,"source_location":{"file":"contrib/rhajek/bigpanda/bigpanda.flux","start":{"line":75,"column":1},"end":{"line":90,"column":2},"source":"statusFromLevel = (level) => {\n lvl = strings.toLower(v: level)\n sev =\n if lvl == \"warn\" then\n \"warning\"\n else if lvl == \"crit\" then\n \"critical\"\n else if lvl == \"info\" then\n \"ok\"\n else if lvl == \"ok\" then\n \"ok\"\n else\n \"critical\"\n\n return sev\n}"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.108.0"}},{"path":"contrib/sranka/opsgenie","name":"opsgenie","headline":"Package opsgenie provides functions that send alerts to\n[Atlassian Opsgenie](https://www.atlassian.com/software/opsgenie)\nusing the [Opsgenie v2 API](https://docs.opsgenie.com/docs/alert-api#create-alert).","description":null,"members":{"endpoint":{"kind":"Function","name":"endpoint","headline":"endpoint sends an alert message to Opsgenie using data from table rows.","description":null,"parameters":[{"name":"url","headline":"url: Opsgenie API URL. Defaults to `https://api.opsgenie.com/v2/alerts`.","description":null,"required":false},{"name":"apiKey","headline":"apiKey: (Required) Opsgenie API authorization key.","description":null,"required":true},{"name":"entity","headline":"entity: Alert entity used to specify the alert domain.","description":null,"required":false}],"flux_type":"(\n apiKey: string,\n ?entity: string,\n ?url: string,\n) => (\n mapFn: (\n r: A,\n ) => {\n B with\n visibleTo: [string],\n tags: E,\n responders: [string],\n priority: string,\n message: string,\n details: D,\n description: string,\n alias: string,\n actions: C,\n },\n) => (<-tables: stream[A]) => stream[{A with _sent: string}] where D: Stringable","is_option":false,"source_location":{"file":"contrib/sranka/opsgenie/opsgenie.flux","start":{"line":181,"column":1},"end":{"line":209,"column":18},"source":"endpoint = (url=\"https://api.opsgenie.com/v2/alerts\", apiKey, entity=\"\") =>\n (mapFn) =>\n (tables=<-) =>\n tables\n |> map(\n fn: (r) => {\n obj = mapFn(r: r)\n\n return {r with _sent:\n string(\n v:\n 2 == sendAlert(\n url: url,\n apiKey: apiKey,\n entity: entity,\n message: obj.message,\n alias: obj.alias,\n description: obj.description,\n priority: obj.priority,\n responders: obj.responders,\n tags: obj.tags,\n actions: obj.actions,\n visibleTo: obj.visibleTo,\n details: obj.details,\n ) / 100,\n ),\n }\n },\n )"},"examples":[],"metadata":{"tags":"notification endpoints, transformations"}},"respondersToJSON":{"kind":"Function","name":"respondersToJSON","headline":"respondersToJSON converts an array of Opsgenie responder strings\nto a string-encoded JSON array that can be embedded in an alert message.","description":null,"parameters":[{"name":"v","headline":"v: (Required) Array of Opsgenie responder strings.\n Responder strings must begin with\n `user: `, `team: `, `escalation: `, or `schedule: `.","description":null,"required":true}],"flux_type":"(v: [string]) => string","is_option":false,"source_location":{"file":"contrib/sranka/opsgenie/opsgenie.flux","start":{"line":23,"column":1},"end":{"line":23,"column":51},"source":"builtin respondersToJSON : (v: [string]) => string"},"examples":[],"metadata":null},"sendAlert":{"kind":"Function","name":"sendAlert","headline":"sendAlert sends an alert message to Opsgenie.","description":null,"parameters":[{"name":"url","headline":"url: Opsgenie API URL. Defaults to `https://api.opsgenie.com/v2/alerts`.","description":null,"required":false},{"name":"apiKey","headline":"apiKey: (Required) Opsgenie API authorization key.","description":null,"required":true},{"name":"message","headline":"message: (Required) Alert message text.\n 130 characters or less.","description":null,"required":true},{"name":"alias","headline":"alias: Opsgenie alias usee to de-deduplicate alerts.\n 250 characters or less.\n Defaults to [message](https://docs.influxdata.com/flux/v0.x/stdlib/contrib/sranka/opsgenie/sendalert/#message).","description":null,"required":false},{"name":"description","headline":"description: Alert description. 15000 characters or less.","description":null,"required":false},{"name":"priority","headline":"priority: Opsgenie alert priority.","description":null,"required":false},{"name":"responders","headline":"responders: List of responder teams or users.\n Use the `user: ` prefix for users and `teams: ` prefix for teams.","description":null,"required":false},{"name":"tags","headline":"tags: Alert tags.","description":null,"required":false},{"name":"entity","headline":"entity: Alert entity used to specify the alert domain.","description":null,"required":false},{"name":"actions","headline":"actions: List of actions available for the alert.","description":null,"required":false},{"name":"details","headline":"details: Additional alert details. Must be a JSON-encoded map of key-value string pairs.","description":null,"required":false},{"name":"visibleTo","headline":"visibleTo: List of teams and users the alert will be visible to without sending notifications.\n Use the `user: ` prefix for users and `teams: ` prefix for teams.","description":null,"required":false}],"flux_type":"(\n apiKey: string,\n message: string,\n ?actions: A,\n ?alias: string,\n ?description: string,\n ?details: B,\n ?entity: string,\n ?priority: string,\n ?responders: [string],\n ?tags: C,\n ?url: string,\n ?visibleTo: [string],\n) => int where B: Stringable","is_option":false,"source_location":{"file":"contrib/sranka/opsgenie/opsgenie.flux","start":{"line":78,"column":1},"end":{"line":120,"column":6},"source":"sendAlert = (\n url=\"https://api.opsgenie.com/v2/alerts\",\n apiKey,\n message,\n alias=\"\",\n description=\"\",\n priority=\"P3\",\n responders=[],\n tags=[],\n entity=\"\",\n actions=[],\n visibleTo=[],\n details=\"{}\",\n ) =>\n {\n headers = {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": \"GenieKey \" + apiKey,\n }\n cutEncode = (v, max, defV=\"\") => {\n v2 = if strings.strlen(v: v) != 0 then v else defV\n\n return\n if strings.strlen(v: v2) > max then\n string(v: json.encode(v: \"${strings.substring(v: v2, start: 0, end: max)}\"))\n else\n string(v: json.encode(v: v2))\n }\n body = \"{\n\\\"message\\\": ${cutEncode(v: message, max: 130)},\n\\\"alias\\\": ${cutEncode(v: alias, max: 512, defV: message)},\n\\\"description\\\": ${cutEncode(v: description, max: 15000)},\n\\\"responders\\\": ${respondersToJSON(v: responders)},\n\\\"visibleTo\\\": ${respondersToJSON(v: visibleTo)},\n\\\"actions\\\": ${string(v: json.encode(v: actions))},\n\\\"tags\\\": ${string(v: json.encode(v: tags))},\n\\\"details\\\": ${details},\n\\\"entity\\\": ${cutEncode(v: entity, max: 512)},\n\\\"priority\\\": ${cutEncode(v: priority, max: 2)}\n}\"\n\n return http.post(headers: headers, url: url, data: bytes(v: body))\n }"},"examples":[],"metadata":{"tags":"single notification"}}},"examples":[],"metadata":{"introduced":"0.84.0"}},{"path":"contrib/sranka/sensu","name":"sensu","headline":"Package sensu provides functions for sending events to [Sensu Go](https://docs.sensu.io/sensu-go/latest/).","description":null,"members":{"endpoint":{"kind":"Function","name":"endpoint","headline":"endpoint sends an event\nto the [Sensu Events API](https://docs.sensu.io/sensu-go/latest/api/events/#create-a-new-event)\nusing data from table rows.","description":null,"parameters":[{"name":"url","headline":"url: Base URL of [Sensu API](https://docs.sensu.io/sensu-go/latest/migrate/#architecture)\n *without a trailing slash*.\n Example: `http://localhost:8080`.","description":null,"required":true},{"name":"apiKey","headline":"apiKey: Sensu [API Key](https://docs.sensu.io/sensu-go/latest/operations/control-access/).","description":null,"required":true},{"name":"handlers","headline":"handlers: [Sensu handlers](https://docs.sensu.io/sensu-go/latest/reference/handlers/) to execute.\n Default is `[]`.","description":null,"required":false},{"name":"namespace","headline":"namespace: [Sensu namespace](https://docs.sensu.io/sensu-go/latest/reference/rbac/).\n Default is `default`.","description":null,"required":false},{"name":"entityName","headline":"entityName: Event source.\n Default is `influxdb`.","description":null,"required":false}],"flux_type":"(\n apiKey: string,\n url: string,\n ?entityName: string,\n ?handlers: A,\n ?namespace: string,\n) => (\n mapFn: (r: B) => {C with text: E, status: D, checkName: string},\n) => (<-tables: stream[B]) => stream[{B with _sent: string}] where D: Equatable","is_option":false,"source_location":{"file":"contrib/sranka/sensu/sensu.flux","start":{"line":209,"column":1},"end":{"line":239,"column":18},"source":"endpoint = (\n url,\n apiKey,\n handlers=[],\n namespace=\"default\",\n entityName=\"influxdb\",\n) =>\n (mapFn) =>\n (tables=<-) =>\n tables\n |> map(\n fn: (r) => {\n obj = mapFn(r: r)\n\n return {r with _sent:\n string(\n v:\n 2 == event(\n url: url,\n apiKey: apiKey,\n checkName: obj.checkName,\n text: obj.text,\n handlers: handlers,\n status: obj.status,\n namespace: namespace,\n entityName: entityName,\n ) / 100,\n ),\n }\n },\n )"},"examples":[],"metadata":{"tags":"notification endpoints, transformations"}},"event":{"kind":"Function","name":"event","headline":"event sends a single event to the [Sensu Events API](https://docs.sensu.io/sensu-go/latest/api/events/#create-a-new-event).","description":null,"parameters":[{"name":"url","headline":"url: Base URL of [Sensu API](https://docs.sensu.io/sensu-go/latest/migrate/#architecture)\n without a trailing slash.","description":null,"required":true},{"name":"apiKey","headline":"apiKey: Sensu [API Key](https://docs.sensu.io/sensu-go/latest/operations/control-access/).","description":null,"required":true},{"name":"checkName","headline":"checkName: Check name.","description":null,"required":true},{"name":"text","headline":"text: Event text.","description":null,"required":true},{"name":"handlers","headline":"handlers: Sensu handlers to execute. Default is `[]`.","description":null,"required":false},{"name":"status","headline":"status: Event status code that indicates [state](https://docs.influxdata.com/flux/v0.x/stdlib/contrib/sranka/sensu/event/#state).\n Default is `0`.","description":null,"required":false},{"name":"state","headline":"state: Event state.\n Default is `\"passing\"` for `0` [status](https://docs.influxdata.com/flux/v0.x/stdlib/contrib/sranka/sensu/event/#status) and `\"failing\"` for other statuses.","description":null,"required":false},{"name":"namespace","headline":"namespace: [Sensu namespace](https://docs.sensu.io/sensu-go/latest/reference/rbac/).\n Default is `\"default\"`.","description":null,"required":false},{"name":"entityName","headline":"entityName: Event source.\n Default is `influxdb`.","description":null,"required":false}],"flux_type":"(\n apiKey: string,\n checkName: string,\n text: A,\n url: string,\n ?entityName: string,\n ?handlers: B,\n ?namespace: string,\n ?state: string,\n ?status: C,\n) => int where C: Equatable","is_option":false,"source_location":{"file":"contrib/sranka/sensu/sensu.flux","start":{"line":109,"column":1},"end":{"line":145,"column":6},"source":"event = (\n url,\n apiKey,\n checkName,\n text,\n handlers=[],\n status=0,\n state=\"\",\n namespace=\"default\",\n entityName=\"influxdb\",\n ) =>\n {\n data = {\n entity: {entity_class: \"proxy\", metadata: {name: toSensuName(v: entityName)}},\n check: {\n output: text,\n state: if state != \"\" then state else if status == 0 then \"passing\" else \"failing\",\n status: status,\n handlers: handlers,\n // required\n interval: 60,\n metadata: {name: toSensuName(v: checkName)},\n },\n }\n headers = {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": \"Key \" + apiKey,\n }\n enc = json.encode(v: data)\n\n return\n http.post(\n headers: headers,\n url: url + \"/api/core/v2/namespaces/\" + namespace + \"/events\",\n data: enc,\n )\n }"},"examples":[],"metadata":{"tags":"single notification"}},"toSensuName":{"kind":"Function","name":"toSensuName","headline":"toSensuName translates a string value to a Sensu name\nby replacing non-alphanumeric characters (`[a-zA-Z0-9_.-]`) with underscores (`_`).","description":null,"parameters":[{"name":"v","headline":"v: String to operate on.","description":null,"required":true}],"flux_type":"(v: string) => string","is_option":false,"source_location":{"file":"contrib/sranka/sensu/sensu.flux","start":{"line":36,"column":1},"end":{"line":36,"column":44},"source":"builtin toSensuName : (v: string) => string"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.90.0"}},{"path":"contrib/sranka/teams","name":"teams","headline":"Package teams (Microsoft Teams) provides functions\nfor sending messages to a [Microsoft Teams](https://www.microsoft.com/microsoft-365/microsoft-teams/group-chat-software)\nchannel using an [incoming webhook](https://docs.microsoft.com/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook).","description":null,"members":{"endpoint":{"kind":"Function","name":"endpoint","headline":"endpoint sends a message to a Microsoft Teams channel using data from table rows.","description":null,"parameters":[{"name":"url","headline":"url: Incoming webhook URL.","description":null,"required":true}],"flux_type":"(\n url: string,\n) => (\n mapFn: (r: A) => {B with title: C, text: string, summary: string},\n) => (<-tables: stream[A]) => stream[{A with _sent: string}]","is_option":false,"source_location":{"file":"contrib/sranka/teams/teams.flux","start":{"line":128,"column":1},"end":{"line":149,"column":18},"source":"endpoint = (url) =>\n (mapFn) =>\n (tables=<-) =>\n tables\n |> map(\n fn: (r) => {\n obj = mapFn(r: r)\n\n return {r with _sent:\n string(\n v:\n 2 == message(\n url: url,\n title: obj.title,\n text: obj.text,\n summary:\n if exists obj.summary then obj.summary else \"\",\n ) / 100,\n ),\n }\n },\n )"},"examples":[],"metadata":{"tags":"notification endpoints, transformations"}},"message":{"kind":"Function","name":"message","headline":"message sends a single message to a Microsoft Teams channel using an\n[incoming webhook](https://docs.microsoft.com/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook).","description":null,"parameters":[{"name":"url","headline":"url: Incoming webhook URL.","description":null,"required":true},{"name":"title","headline":"title: Message card title.","description":null,"required":true},{"name":"text","headline":"text: Message card text.","description":null,"required":true},{"name":"summary","headline":"summary: Message card summary.\n Default is `\"\"`.","description":null,"required":false}],"flux_type":"(text: string, title: A, url: string, ?summary: string) => int","is_option":false,"source_location":{"file":"contrib/sranka/teams/teams.flux","start":{"line":55,"column":1},"end":{"line":81,"column":10},"source":"message =\n (url, title, text, summary=\"\") =>\n {\n headers = {\"Content-Type\": \"application/json; charset=utf-8\"}\n\n // see https://docs.microsoft.com/en-us/outlook/actionable-messages/message-card-reference#card-fields\n // using string body, object cannot be used because '@' is an illegal character in the object property key\n summary2 =\n if summary == \"\" then\n text\n else\n summary\n shortSummary =\n if strings.strlen(v: summary2) > summaryCutoff then\n \"${strings.substring(v: summary2, start: 0, end: summaryCutoff)}...\"\n else\n summary2\n body = \"{\n\\\"@type\\\": \\\"MessageCard\\\",\n\\\"@context\\\": \\\"http://schema.org/extensions\\\",\n\\\"title\\\": ${string(v: json.encode(v: title))},\n\\\"text\\\": ${string(v: json.encode(v: text))},\n\\\"summary\\\": ${string(v: json.encode(v: shortSummary))}\n}\"\n\n return http.post(headers: headers, url: url, data: bytes(v: body))\n }"},"examples":[],"metadata":{"tags":"single notification"}},"summaryCutoff":{"kind":"Value","name":"summaryCutoff","headline":"summaryCutoff is the limit for message summaries.\nDefault is `70`.","description":null,"flux_type":"int","is_option":true,"source_location":{"file":"contrib/sranka/teams/teams.flux","start":{"line":18,"column":1},"end":{"line":18,"column":26},"source":"option summaryCutoff = 70"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.70.0"}},{"path":"contrib/sranka/telegram","name":"telegram","headline":"Package telegram provides functions for sending messages to [Telegram](https://telegram.org/)\nusing the [Telegram Bot API](https://core.telegram.org/bots/api).","description":null,"members":{"defaultDisableWebPagePreview":{"kind":"Value","name":"defaultDisableWebPagePreview","headline":"defaultDisableWebPagePreview - Use Telegram web page preview by default. Default is `false`.","description":null,"flux_type":"bool","is_option":true,"source_location":{"file":"contrib/sranka/telegram/telegram.flux","start":{"line":41,"column":1},"end":{"line":41,"column":44},"source":"option defaultDisableWebPagePreview = false"},"examples":[],"metadata":null},"defaultParseMode":{"kind":"Value","name":"defaultParseMode","headline":"defaultParseMode is the default [Telegram parse mode](https://core.telegram.org/bots/api#formatting-options). Default is `MarkdownV2`.","description":null,"flux_type":"string","is_option":true,"source_location":{"file":"contrib/sranka/telegram/telegram.flux","start":{"line":38,"column":1},"end":{"line":38,"column":39},"source":"option defaultParseMode = \"MarkdownV2\""},"examples":[],"metadata":null},"defaultSilent":{"kind":"Value","name":"defaultSilent","headline":"defaultSilent - Send silent Telegram notifications by default. Default is `true`.","description":null,"flux_type":"bool","is_option":true,"source_location":{"file":"contrib/sranka/telegram/telegram.flux","start":{"line":44,"column":1},"end":{"line":44,"column":28},"source":"option defaultSilent = true"},"examples":[],"metadata":null},"defaultURL":{"kind":"Value","name":"defaultURL","headline":"defaultURL is the default Telegram bot URL. Default is `https://api.telegram.org/bot`.","description":null,"flux_type":"string","is_option":true,"source_location":{"file":"contrib/sranka/telegram/telegram.flux","start":{"line":35,"column":1},"end":{"line":35,"column":51},"source":"option defaultURL = \"https://api.telegram.org/bot\""},"examples":[],"metadata":null},"endpoint":{"kind":"Function","name":"endpoint","headline":"endpoint sends a message to a Telegram channel using data from table rows.","description":null,"parameters":[{"name":"url","headline":"url: URL of the Telegram bot endpoint. Default is `https://api.telegram.org/bot`.","description":null,"required":false},{"name":"token","headline":"token: Telegram bot token.","description":null,"required":true},{"name":"parseMode","headline":"parseMode: [Parse mode](https://core.telegram.org/bots/api#formatting-options)\n of the message text.\n Default is `MarkdownV2`.","description":null,"required":false},{"name":"disableWebPagePreview","headline":"disableWebPagePreview: Disable preview of web links in the sent message.\n Default is false.","description":null,"required":false}],"flux_type":"(\n token: string,\n ?disableWebPagePreview: A,\n ?parseMode: B,\n ?url: string,\n) => (\n mapFn: (r: C) => {D with text: G, silent: F, channel: E},\n) => (<-tables: stream[C]) => stream[{C with _sent: string}]","is_option":false,"source_location":{"file":"contrib/sranka/telegram/telegram.flux","start":{"line":168,"column":1},"end":{"line":196,"column":18},"source":"endpoint = (\n url=defaultURL,\n token,\n parseMode=defaultParseMode,\n disableWebPagePreview=defaultDisableWebPagePreview,\n) =>\n (mapFn) =>\n (tables=<-) =>\n tables\n |> map(\n fn: (r) => {\n obj = mapFn(r: r)\n\n return {r with _sent:\n string(\n v:\n 2 == message(\n url: url,\n token: token,\n channel: obj.channel,\n text: obj.text,\n parseMode: parseMode,\n disableWebPagePreview: disableWebPagePreview,\n silent: obj.silent,\n ) / 100,\n ),\n }\n },\n )"},"examples":[],"metadata":{"tags":"notification endpoints, transformations"}},"message":{"kind":"Function","name":"message","headline":"message sends a single message to a Telegram channel\nusing the [`sendMessage`](https://core.telegram.org/bots/api#sendmessage) method of the Telegram Bot API.","description":null,"parameters":[{"name":"url","headline":"url: URL of the Telegram bot endpoint. Default is `https://api.telegram.org/bot`.","description":null,"required":false},{"name":"token","headline":"token: Telegram bot token.","description":null,"required":true},{"name":"channel","headline":"channel: Telegram channel ID.","description":null,"required":true},{"name":"text","headline":"text: Message text.","description":null,"required":true},{"name":"parseMode","headline":"parseMode: [Parse mode](https://core.telegram.org/bots/api#formatting-options)\n of the message text.\n Default is `MarkdownV2`.","description":null,"required":false},{"name":"disableWebPagePreview","headline":"disableWebPagePreview: Disable preview of web links in the sent message.\n Default is `false`.","description":null,"required":false},{"name":"silent","headline":"silent: Send message [silently](https://telegram.org/blog/channels-2-0#silent-messages).\n Default is `true`.","description":null,"required":false}],"flux_type":"(\n channel: A,\n text: B,\n token: string,\n ?disableWebPagePreview: C,\n ?parseMode: D,\n ?silent: E,\n ?url: string,\n) => int","is_option":false,"source_location":{"file":"contrib/sranka/telegram/telegram.flux","start":{"line":90,"column":1},"end":{"line":111,"column":6},"source":"message = (\n url=defaultURL,\n token,\n channel,\n text,\n parseMode=defaultParseMode,\n disableWebPagePreview=defaultDisableWebPagePreview,\n silent=defaultSilent,\n ) =>\n {\n data = {\n chat_id: channel,\n text: text,\n parse_mode: parseMode,\n disable_web_page_preview: disableWebPagePreview,\n disable_notification: silent,\n }\n headers = {\"Content-Type\": \"application/json; charset=utf-8\"}\n enc = json.encode(v: data)\n\n return http.post(headers: headers, url: url + token + \"/sendMessage\", data: enc)\n }"},"examples":[],"metadata":{"tags":"single notification"}}},"examples":[],"metadata":{"introduced":"0.70.0"}},{"path":"contrib/sranka/webexteams","name":"webexteams","headline":"Package webexteams provides functions that send messages\nto [Webex Teams](https://www.webex.com/team-collaboration.html).","description":null,"members":{"endpoint":{"kind":"Function","name":"endpoint","headline":"endpoint returns a function that sends a message that includes data from input rows to a Webex room.","description":null,"parameters":[{"name":"url","headline":"url: Base URL of Webex API endpoint (without a trailing slash).\n Default is `https://webexapis.com`.","description":null,"required":false},{"name":"token","headline":"token: [Webex API access token](https://developer.webex.com/docs/api/getting-started).","description":null,"required":true}],"flux_type":"(\n token: string,\n ?url: string,\n) => (\n mapFn: (r: A) => {B with text: E, roomId: D, markdown: C},\n) => (<-tables: stream[A]) => stream[{A with _sent: string}]","is_option":false,"source_location":{"file":"contrib/sranka/webexteams/webexteams.flux","start":{"line":117,"column":1},"end":{"line":138,"column":18},"source":"endpoint = (url=\"https://webexapis.com\", token) =>\n (mapFn) =>\n (tables=<-) =>\n tables\n |> map(\n fn: (r) => {\n obj = mapFn(r: r)\n\n return {r with _sent:\n string(\n v:\n 2 == message(\n url: url,\n token: token,\n roomId: obj.roomId,\n text: obj.text,\n markdown: obj.markdown,\n ) / 100,\n ),\n }\n },\n )"},"examples":[],"metadata":{"tags":"notification endpoints, transformations"}},"message":{"kind":"Function","name":"message","headline":"message sends a single message to Webex\nusing the [Webex messages API](https://developer.webex.com/docs/api/v1/messages/create-a-message).","description":null,"parameters":[{"name":"url","headline":"url: Base URL of Webex API endpoint (without a trailing slash).\n Default is `https://webexapis.com`.","description":null,"required":false},{"name":"token","headline":"token: [Webex API access token](https://developer.webex.com/docs/api/getting-started).","description":null,"required":true},{"name":"roomId","headline":"roomId: Room ID to send the message to.","description":null,"required":true},{"name":"text","headline":"text: Plain text message.","description":null,"required":true},{"name":"markdown","headline":"markdown: [Markdown formatted message](https://developer.webex.com/docs/api/basics#formatting-messages).","description":null,"required":true}],"flux_type":"(\n markdown: A,\n roomId: B,\n text: C,\n token: string,\n ?url: string,\n) => int","is_option":false,"source_location":{"file":"contrib/sranka/webexteams/webexteams.flux","start":{"line":51,"column":1},"end":{"line":68,"column":6},"source":"message = (\n url=\"https://webexapis.com\",\n token,\n roomId,\n text,\n markdown,\n ) =>\n {\n data = {text: text, markdown: markdown, roomId: roomId}\n headers = {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": \"Bearer \" + token,\n }\n\n content = json.encode(v: data)\n\n return http.post(headers: headers, url: url + \"/v1/messages\", data: content)\n }"},"examples":[],"metadata":{"tags":"single notification"}}},"examples":[],"metadata":{"introduced":"0.125.0"}},{"path":"contrib/tomhollingworth/events","name":"events","headline":"Package events provides tools for analyzing event-based data.","description":null,"members":{"duration":{"kind":"Function","name":"duration","headline":"duration calculates the duration of events.","description":null,"parameters":[{"name":"unit","headline":"unit: Duration unit of the calculated state duration.\n Default is `1ns`.","description":null,"required":false},{"name":"columnName","headline":"columnName: Name of the result column.\n Default is `\"duration\"`.","description":null,"required":false},{"name":"timeColumn","headline":"timeColumn: Name of the time column.\n Default is `\"_time\"`.","description":null,"required":false},{"name":"stopColumn","headline":"stopColumn: Name of the stop column.\n Default is `\"_stop\"`.","description":null,"required":false},{"name":"stop","headline":"stop: The latest time to use when calculating results.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n ?columnName: string,\n ?stop: time,\n ?stopColumn: string,\n ?timeColumn: string,\n ?unit: duration,\n) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"contrib/tomhollingworth/events/duration.flux","start":{"line":101,"column":1},"end":{"line":111,"column":14},"source":"builtin duration : (\n <-tables: stream[A],\n ?unit: duration,\n ?timeColumn: string,\n ?columnName: string,\n ?stopColumn: string,\n ?stop: time,\n ) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"tags":"transformations,events"}}},"examples":[],"metadata":{"introduced":"0.91.0"}},{"path":"csv","name":"csv","headline":"Package csv provides tools for working with data in annotated CSV format.","description":null,"members":{"from":{"kind":"Function","name":"from","headline":"from retrieves data from a comma separated value (CSV) data source and\nreturns a stream of tables.","description":null,"parameters":[{"name":"csv","headline":"csv: CSV data.","description":null,"required":false},{"name":"file","headline":"file: File path of the CSV file to query.","description":null,"required":false},{"name":"mode","headline":"mode: is the CSV parsing mode. Default is `annotations`.","description":null,"required":false}],"flux_type":"(?csv: string, ?file: string, ?mode: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"csv/csv.flux","start":{"line":94,"column":1},"end":{"line":94,"column":89},"source":"builtin from : (?csv: string, ?file: string, ?mode: string) => stream[A] where A: Record"},"examples":[],"metadata":{"tags":"csv,inputs"}}},"examples":[],"metadata":{"introduced":"0.14.0","tags":"csv"}},{"path":"date","name":"date","headline":"Package date provides date and time constants and functions.","description":null,"members":{"April":{"kind":"Value","name":"April","headline":"April is a constant that represents the month of April.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":964,"column":1},"end":{"line":964,"column":10},"source":"April = 4"},"examples":[],"metadata":null},"August":{"kind":"Value","name":"August","headline":"August is a constant that represents the month of August.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":976,"column":1},"end":{"line":976,"column":11},"source":"August = 8"},"examples":[],"metadata":null},"December":{"kind":"Value","name":"December","headline":"December is a constant that represents the month of December.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":988,"column":1},"end":{"line":988,"column":14},"source":"December = 12"},"examples":[],"metadata":null},"February":{"kind":"Value","name":"February","headline":"February is a constant that represents the month of February.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":958,"column":1},"end":{"line":958,"column":13},"source":"February = 2"},"examples":[],"metadata":null},"Friday":{"kind":"Value","name":"Friday","headline":"Friday is a constant that represents Friday as a day of the week.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":949,"column":1},"end":{"line":949,"column":11},"source":"Friday = 5"},"examples":[],"metadata":null},"January":{"kind":"Value","name":"January","headline":"January is a constant that represents the month of January.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":955,"column":1},"end":{"line":955,"column":12},"source":"January = 1"},"examples":[],"metadata":null},"July":{"kind":"Value","name":"July","headline":"July is a constant that represents the month of July.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":973,"column":1},"end":{"line":973,"column":9},"source":"July = 7"},"examples":[],"metadata":null},"June":{"kind":"Value","name":"June","headline":"June is a constant that represents the month of June.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":970,"column":1},"end":{"line":970,"column":9},"source":"June = 6"},"examples":[],"metadata":null},"March":{"kind":"Value","name":"March","headline":"March is a constant that represents the month of March.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":961,"column":1},"end":{"line":961,"column":10},"source":"March = 3"},"examples":[],"metadata":null},"May":{"kind":"Value","name":"May","headline":"May is a constant that represents the month of May.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":967,"column":1},"end":{"line":967,"column":8},"source":"May = 5"},"examples":[],"metadata":null},"Monday":{"kind":"Value","name":"Monday","headline":"Monday is a constant that represents Monday as a day of the week.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":937,"column":1},"end":{"line":937,"column":11},"source":"Monday = 1"},"examples":[],"metadata":null},"November":{"kind":"Value","name":"November","headline":"November is a constant that represents the month of November.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":985,"column":1},"end":{"line":985,"column":14},"source":"November = 11"},"examples":[],"metadata":null},"October":{"kind":"Value","name":"October","headline":"October is a constant that represents the month of October.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":982,"column":1},"end":{"line":982,"column":13},"source":"October = 10"},"examples":[],"metadata":null},"Saturday":{"kind":"Value","name":"Saturday","headline":"Saturday is a constant that represents Saturday as a day of the week.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":952,"column":1},"end":{"line":952,"column":13},"source":"Saturday = 6"},"examples":[],"metadata":null},"September":{"kind":"Value","name":"September","headline":"September is a constant that represents the month of September.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":979,"column":1},"end":{"line":979,"column":14},"source":"September = 9"},"examples":[],"metadata":null},"Sunday":{"kind":"Value","name":"Sunday","headline":"Sunday is a constant that represents Sunday as a day of the week.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":934,"column":1},"end":{"line":934,"column":11},"source":"Sunday = 0"},"examples":[],"metadata":null},"Thursday":{"kind":"Value","name":"Thursday","headline":"Thursday is a constant that represents Thursday as a day of the week.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":946,"column":1},"end":{"line":946,"column":13},"source":"Thursday = 4"},"examples":[],"metadata":null},"Tuesday":{"kind":"Value","name":"Tuesday","headline":"Tuesday is a constant that represents Tuesday as a day of the week.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":940,"column":1},"end":{"line":940,"column":12},"source":"Tuesday = 2"},"examples":[],"metadata":null},"Wednesday":{"kind":"Value","name":"Wednesday","headline":"Wednesday is a constant that represents Wednesday as a day of the week.","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":943,"column":1},"end":{"line":943,"column":14},"source":"Wednesday = 3"},"examples":[],"metadata":null},"add":{"kind":"Function","name":"add","headline":"add adds a duration to a time value and returns the resulting time value.","description":null,"parameters":[{"name":"d","headline":"d: Duration to add.","description":null,"required":true},{"name":"to","headline":"to: Time to add the duration to.","description":null,"required":true},{"name":"location","headline":"location: Location to use for the time value.","description":null,"required":false}],"flux_type":"(d: duration, to: A, ?location: {zone: string, offset: duration}) => time where A: Timeable","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":744,"column":1},"end":{"line":744,"column":58},"source":"add = (d, to, location=location) => _add(d, to, location)"},"examples":[],"metadata":{"introduced":"0.162.0","tags":"date/time"}},"hour":{"kind":"Function","name":"hour","headline":"hour returns the hour of a specified time. Results range from `[0 - 23]`.","description":null,"parameters":[{"name":"t","headline":"t: Time to operate on.","description":null,"required":true},{"name":"location","headline":"location: Location used to determine timezone.\n Default is the `location` option.","description":null,"required":false}],"flux_type":"(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":188,"column":1},"end":{"line":188,"column":52},"source":"hour = (t, location=location) => _hour(t, location)"},"examples":[],"metadata":null},"microsecond":{"kind":"Function","name":"microsecond","headline":"microsecond returns the microseconds for a specified time.\nResults range `from [0-999999]`.","description":null,"parameters":[{"name":"t","headline":"t: Time to operate on.","description":null,"required":true}],"flux_type":"(t: A) => int where A: Timeable","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":639,"column":1},"end":{"line":639,"column":54},"source":"builtin microsecond : (t: T) => int where T: Timeable"},"examples":[],"metadata":null},"millisecond":{"kind":"Function","name":"millisecond","headline":"millisecond returns the milliseconds for a specified time.\nResults range from `[0-999]`.","description":null,"parameters":[{"name":"t","headline":"t: Time to operate on.","description":null,"required":true}],"flux_type":"(t: A) => int where A: Timeable","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":596,"column":1},"end":{"line":596,"column":54},"source":"builtin millisecond : (t: T) => int where T: Timeable"},"examples":[],"metadata":null},"minute":{"kind":"Function","name":"minute","headline":"minute returns the minute of a specified time. Results range from `[0 - 59]`.","description":null,"parameters":[{"name":"t","headline":"t: Time to operate on.","description":null,"required":true},{"name":"location","headline":"location: Location used to determine timezone.\n Default is the `location` option.","description":null,"required":false}],"flux_type":"(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":140,"column":1},"end":{"line":140,"column":56},"source":"minute = (t, location=location) => _minute(t, location)"},"examples":[],"metadata":null},"month":{"kind":"Function","name":"month","headline":"month returns the month of a specified time. Results range from `[1 - 12]`.","description":null,"parameters":[{"name":"t","headline":"t: Time to operate on.","description":null,"required":true},{"name":"location","headline":"location: Location used to determine timezone.\n Default is the `location` option.","description":null,"required":false}],"flux_type":"(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":408,"column":1},"end":{"line":408,"column":54},"source":"month = (t, location=location) => _month(t, location)"},"examples":[],"metadata":null},"monthDay":{"kind":"Function","name":"monthDay","headline":"monthDay returns the day of the month for a specified time.\nResults range from `[1 - 31]`.","description":null,"parameters":[{"name":"t","headline":"t: Time to operate on.","description":null,"required":true},{"name":"location","headline":"location: Location used to determine timezone.\n Default is the `location` option.","description":null,"required":false}],"flux_type":"(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":296,"column":1},"end":{"line":296,"column":60},"source":"monthDay = (t, location=location) => _monthDay(t, location)"},"examples":[],"metadata":null},"nanosecond":{"kind":"Function","name":"nanosecond","headline":"nanosecond returns the nanoseconds for a specified time.\nResults range from `[0-999999999]`.","description":null,"parameters":[{"name":"t","headline":"t: Time to operate on.","description":null,"required":true}],"flux_type":"(t: A) => int where A: Timeable","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":682,"column":1},"end":{"line":682,"column":53},"source":"builtin nanosecond : (t: T) => int where T: Timeable"},"examples":[],"metadata":null},"quarter":{"kind":"Function","name":"quarter","headline":"quarter returns the quarter for a specified time. Results range from `[1-4]`.","description":null,"parameters":[{"name":"t","headline":"t: Time to operate on.","description":null,"required":true},{"name":"location","headline":"location: Location used to determine timezone.\n Default is the `location` option.","description":null,"required":false}],"flux_type":"(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":553,"column":1},"end":{"line":553,"column":58},"source":"quarter = (t, location=location) => _quarter(t, location)"},"examples":[],"metadata":null},"scale":{"kind":"Function","name":"scale","headline":"scale will multiply the duration by the given value.","description":null,"parameters":[{"name":"d","headline":"d: Duration to scale.","description":null,"required":true},{"name":"n","headline":"n: Amount to scale the duration by.","description":null,"required":true}],"flux_type":"(d: duration, n: int) => duration","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":931,"column":1},"end":{"line":931,"column":50},"source":"builtin scale : (d: duration, n: int) => duration"},"examples":[],"metadata":{"tags":"date/time"}},"second":{"kind":"Function","name":"second","headline":"second returns the second of a specified time. Results range from `[0 - 59]`.","description":null,"parameters":[{"name":"t","headline":"t: Time to operate on.","description":null,"required":true}],"flux_type":"(t: A) => int where A: Timeable","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":49,"column":1},"end":{"line":49,"column":49},"source":"builtin second : (t: T) => int where T: Timeable"},"examples":[],"metadata":null},"sub":{"kind":"Function","name":"sub","headline":"sub subtracts a duration from a time value and returns the resulting time value.","description":null,"parameters":[{"name":"from","headline":"from: Time to subtract the duration from.","description":null,"required":true},{"name":"d","headline":"d: Duration to subtract.","description":null,"required":true},{"name":"location","headline":"location: Location to use for the time value.","description":null,"required":false}],"flux_type":"(d: duration, from: A, ?location: {zone: string, offset: duration}) => time where A: Timeable","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":807,"column":1},"end":{"line":807,"column":62},"source":"sub = (d, from, location=location) => _sub(d, from, location)"},"examples":[],"metadata":{"introduced":"0.162.0","tags":"date/time"}},"time":{"kind":"Function","name":"time","headline":"time returns the time value of a specified relative duration or time.","description":null,"parameters":[{"name":"t","headline":"t: Duration or time value.","description":null,"required":true},{"name":"location","headline":"location: Location used to determine timezone.\n Default is the `location` option.","description":null,"required":false}],"flux_type":"(t: A, ?location: {zone: string, offset: duration}) => time where A: Timeable","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":93,"column":1},"end":{"line":93,"column":52},"source":"time = (t, location=location) => _time(t, location)"},"examples":[],"metadata":{"introduced":"0.172.0"}},"truncate":{"kind":"Function","name":"truncate","headline":"truncate returns a time truncated to the specified duration unit.","description":null,"parameters":[{"name":"t","headline":"t: Time to operate on.","description":null,"required":true},{"name":"unit","headline":"unit: Unit of time to truncate to.","description":null,"required":true},{"name":"location","headline":"location: Location used to determine timezone.\n Default is the `location` option.","description":null,"required":false}],"flux_type":"(t: A, unit: duration, ?location: {zone: string, offset: duration}) => time where A: Timeable","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":894,"column":1},"end":{"line":894,"column":72},"source":"truncate = (t, unit, location=location) => _truncate(t, unit, location)"},"examples":[],"metadata":null},"week":{"kind":"Function","name":"week","headline":"week returns the ISO week of the year for a specified time.\nResults range from `[1 - 53]`.","description":null,"parameters":[{"name":"t","headline":"t: Time to operate on.","description":null,"required":true},{"name":"location","headline":"location: Location used to determine timezone.\n Default is the `location` option.","description":null,"required":false}],"flux_type":"(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":505,"column":1},"end":{"line":505,"column":52},"source":"week = (t, location=location) => _week(t, location)"},"examples":[],"metadata":null},"weekDay":{"kind":"Function","name":"weekDay","headline":"weekDay returns the day of the week for a specified time.\nResults range from `[0 - 6]`.","description":null,"parameters":[{"name":"t","headline":"t: Time to operate on.","description":null,"required":true},{"name":"location","headline":"location: Location used to determine timezone.\n Default is the `location` option.","description":null,"required":false}],"flux_type":"(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":247,"column":1},"end":{"line":247,"column":58},"source":"weekDay = (t, location=location) => _weekDay(t, location)"},"examples":[],"metadata":null},"year":{"kind":"Function","name":"year","headline":"year returns the year of a specified time.","description":null,"parameters":[{"name":"t","headline":"t: Time to operate on.","description":null,"required":true},{"name":"location","headline":"location: Location used to determine timezone.\n Default is the `location` option.","description":null,"required":false}],"flux_type":"(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":456,"column":1},"end":{"line":456,"column":52},"source":"year = (t, location=location) => _year(t, location)"},"examples":[],"metadata":null},"yearDay":{"kind":"Function","name":"yearDay","headline":"yearDay returns the day of the year for a specified time.\nResults can include leap days and range from `[1 - 366]`.","description":null,"parameters":[{"name":"t","headline":"t: Time to operate on.","description":null,"required":true},{"name":"location","headline":"location: Location used to determine timezone.\n Default is the `location` option.","description":null,"required":false}],"flux_type":"(t: A, ?location: {zone: string, offset: duration}) => int where A: Timeable","is_option":false,"source_location":{"file":"date/date.flux","start":{"line":345,"column":1},"end":{"line":345,"column":58},"source":"yearDay = (t, location=location) => _yearDay(t, location)"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.37.0","tags":"date/time"}},{"path":"date/boundaries","name":"boundaries","headline":"Package boundaries provides operators for finding the boundaries around certain days, months, and weeks.","description":null,"members":{"friday":{"kind":"Function","name":"friday","headline":"friday returns a record with `start` and `stop` boundary timestamps for last Friday.","description":null,"parameters":[],"flux_type":"() => {stop: time, start: time}","is_option":false,"source_location":{"file":"date/boundaries/boundaries.flux","start":{"line":273,"column":1},"end":{"line":277,"column":2},"source":"friday = () => {\n die(msg: \"the 'date/boundaries' package has been moved to 'experimental/date/boundaries'\")\n\n return _day_finder(td: date.Friday, func: _day_formatter)\n}"},"examples":[],"metadata":{"deprecated":"0.177.1","tags":"date/time"}},"monday":{"kind":"Function","name":"monday","headline":"monday returns a record with `start` and `stop` boundary timestamps of last Monday.\nLast Monday is relative to `now()`. If today is Monday, the function returns boundaries for the previous Monday.","description":null,"parameters":[],"flux_type":"() => {stop: time, start: time}","is_option":false,"source_location":{"file":"date/boundaries/boundaries.flux","start":{"line":118,"column":1},"end":{"line":122,"column":2},"source":"monday = () => {\n die(msg: \"the 'date/boundaries' package has been moved to 'experimental/date/boundaries'\")\n\n return _day_finder(td: date.Monday, func: _day_formatter)\n}"},"examples":[],"metadata":{"deprecated":"0.177.1","tags":"date/time"}},"month":{"kind":"Function","name":"month","headline":"month returns a record with `start` and `stop` boundary timestamps for the current month.","description":null,"parameters":[{"name":"month_offset","headline":"month_offset: Number of months to offset from the current month. Default is `0`.","description":null,"required":false}],"flux_type":"(?month_offset: int) => {stop: time, start: time}","is_option":false,"source_location":{"file":"date/boundaries/boundaries.flux","start":{"line":406,"column":1},"end":{"line":414,"column":2},"source":"month = (month_offset=0) => {\n die(msg: \"the 'date/boundaries' package has been moved to 'experimental/date/boundaries'\")\n\n a = date.truncate(t: today(), unit: 1mo)\n\n start = date.add(d: date.scale(d: 1mo, n: month_offset), to: a)\n\n return {start: start, stop: date.add(d: 1mo, to: start)}\n}"},"examples":[],"metadata":{"deprecated":"0.177.1","tags":"date/time"}},"saturday":{"kind":"Function","name":"saturday","headline":"saturday returns a record with `start` and `stop` boundary timestamps for last Saturday.","description":null,"parameters":[],"flux_type":"() => {stop: time, start: time}","is_option":false,"source_location":{"file":"date/boundaries/boundaries.flux","start":{"line":312,"column":1},"end":{"line":316,"column":2},"source":"saturday = () => {\n die(msg: \"the 'date/boundaries' package has been moved to 'experimental/date/boundaries'\")\n\n return _day_finder(td: date.Saturday, func: _day_formatter)\n}"},"examples":[],"metadata":{"deprecated":"0.177.1","tags":"date/time"}},"sunday":{"kind":"Function","name":"sunday","headline":"sunday returns a record with `start` and `stop` boundary timestamps for last Sunday.","description":null,"parameters":[],"flux_type":"() => {stop: time, start: time}","is_option":false,"source_location":{"file":"date/boundaries/boundaries.flux","start":{"line":351,"column":1},"end":{"line":355,"column":2},"source":"sunday = () => {\n die(msg: \"the 'date/boundaries' package has been moved to 'experimental/date/boundaries'\")\n\n return _day_finder(td: date.Sunday, func: _day_formatter)\n}"},"examples":[],"metadata":{"deprecated":"0.177.1","tags":"date/time"}},"thursday":{"kind":"Function","name":"thursday","headline":"thursday returns a record with `start` and `stop` boundary timestamps for last Thursday.","description":null,"parameters":[],"flux_type":"() => {stop: time, start: time}","is_option":false,"source_location":{"file":"date/boundaries/boundaries.flux","start":{"line":234,"column":1},"end":{"line":238,"column":2},"source":"thursday = () => {\n die(msg: \"the 'date/boundaries' package has been moved to 'experimental/date/boundaries'\")\n\n return _day_finder(td: date.Thursday, func: _day_formatter)\n}"},"examples":[],"metadata":{"deprecated":"0.177.1","tags":"date/time"}},"tuesday":{"kind":"Function","name":"tuesday","headline":"tuesday returns a record with `start` and `stop` boundary timestamps of last Tuesday.","description":null,"parameters":[],"flux_type":"() => {stop: time, start: time}","is_option":false,"source_location":{"file":"date/boundaries/boundaries.flux","start":{"line":157,"column":1},"end":{"line":161,"column":2},"source":"tuesday = () => {\n die(msg: \"the 'date/boundaries' package has been moved to 'experimental/date/boundaries'\")\n\n return _day_finder(td: date.Tuesday, func: _day_formatter)\n}"},"examples":[],"metadata":{"deprecated":"0.177.1","tags":"date/time"}},"wednesday":{"kind":"Function","name":"wednesday","headline":"wednesday returns a record with `start` and `stop` boundary timestamps for last Wednesday.","description":null,"parameters":[],"flux_type":"() => {stop: time, start: time}","is_option":false,"source_location":{"file":"date/boundaries/boundaries.flux","start":{"line":196,"column":1},"end":{"line":200,"column":2},"source":"wednesday = () => {\n die(msg: \"the 'date/boundaries' package has been moved to 'experimental/date/boundaries'\")\n\n return _day_finder(td: date.Wednesday, func: _day_formatter)\n}"},"examples":[],"metadata":{"deprecated":"0.177.1","tags":"date/time"}},"week":{"kind":"Function","name":"week","headline":"week returns a record with `start` and `stop` boundary timestamps of the current week.\nBy default, weeks start on Monday.","description":null,"parameters":[{"name":"start_sunday","headline":"start_sunday: Indicate if the week starts on Sunday. Default is `false`.","description":null,"required":false},{"name":"week_offset","headline":"week_offset: Number of weeks to offset from the current week. Default is `0`.","description":null,"required":false}],"flux_type":"(?start_sunday: bool, ?week_offset: int) => {stop: time, start: time}","is_option":false,"source_location":{"file":"date/boundaries/boundaries.flux","start":{"line":479,"column":1},"end":{"line":495,"column":2},"source":"week = (week_offset=0, start_sunday=false) => {\n die(msg: \"the 'date/boundaries' package has been moved to 'experimental/date/boundaries'\")\n\n return\n if start_sunday then\n _day_finder(\n td: date.Sunday,\n func: _week_formatter,\n offset: date.scale(d: 1w, n: week_offset),\n )\n else\n _day_finder(\n td: date.Monday,\n func: _week_formatter,\n offset: date.scale(d: 1w, n: week_offset),\n )\n}"},"examples":[],"metadata":{"deprecated":"0.177.1","tags":"date/time"}},"yesterday":{"kind":"Function","name":"yesterday","headline":"yesterday returns a record with `start` and `stop` boundary timestamps for yesterday.","description":null,"parameters":[],"flux_type":"() => {stop: time, start: time}","is_option":false,"source_location":{"file":"date/boundaries/boundaries.flux","start":{"line":48,"column":1},"end":{"line":52,"column":2},"source":"yesterday = () => {\n die(msg: \"the 'date/boundaries' package has been moved to 'experimental/date/boundaries'\")\n\n return {start: date.sub(d: 1d, from: today()), stop: today()}\n}"},"examples":[],"metadata":{"deprecated":"0.177.1","introduced":"0.172.0","tags":"date/time"}}},"examples":[],"metadata":{"deprecated":"0.177.1","introduced":"0.172.0"}},{"path":"dict","name":"dict","headline":"Package dict provides functions for interacting with dictionary types.","description":null,"members":{"fromList":{"kind":"Function","name":"fromList","headline":"fromList creates a dictionary from a list of records with `key` and `value`\nproperties.","description":null,"parameters":[{"name":"pairs","headline":"pairs: List of records with `key` and `value` properties.","description":null,"required":true}],"flux_type":"(pairs: [{value: B, key: A}]) => [A:B] where A: Comparable","is_option":false,"source_location":{"file":"dict/dict.flux","start":{"line":31,"column":1},"end":{"line":31,"column":78},"source":"builtin fromList : (pairs: [{key: K, value: V}]) => [K:V] where K: Comparable"},"examples":[],"metadata":null},"get":{"kind":"Function","name":"get","headline":"get returns the value of a specified key in a dictionary or a default value\nif the key does not exist.","description":null,"parameters":[{"name":"dict","headline":"dict: Dictionary to return a value from.","description":null,"required":true},{"name":"key","headline":"key: Key to return from the dictionary.","description":null,"required":true},{"name":"default","headline":"default: Default value to return if the key does not exist in the\n dictionary. Must be the same type as values in the dictionary.","description":null,"required":true}],"flux_type":"(default: A, dict: [B:A], key: B) => A where B: Comparable","is_option":false,"source_location":{"file":"dict/dict.flux","start":{"line":58,"column":1},"end":{"line":58,"column":73},"source":"builtin get : (dict: [K:V], key: K, default: V) => V where K: Comparable"},"examples":[],"metadata":null},"insert":{"kind":"Function","name":"insert","headline":"insert inserts a key-value pair into a dictionary and returns a new,\nupdated dictionary.","description":null,"parameters":[{"name":"dict","headline":"dict: Dictionary to update.","description":null,"required":true},{"name":"key","headline":"key: Key to insert into the dictionary.\n Must be the same type as the existing keys in the dictionary.","description":null,"required":true},{"name":"value","headline":"value: Value to insert into the dictionary.\n Must be the same type as the existing values in the dictionary.","description":null,"required":true}],"flux_type":"(dict: [A:B], key: A, value: B) => [A:B] where A: Comparable","is_option":false,"source_location":{"file":"dict/dict.flux","start":{"line":106,"column":1},"end":{"line":106,"column":78},"source":"builtin insert : (dict: [K:V], key: K, value: V) => [K:V] where K: Comparable"},"examples":[],"metadata":null},"remove":{"kind":"Function","name":"remove","headline":"remove removes a key value pair from a dictionary and returns an updated\ndictionary.","description":null,"parameters":[{"name":"dict","headline":"dict: Dictionary to remove the key-value pair from.","description":null,"required":true},{"name":"key","headline":"key: Key to remove from the dictionary.\n Must be the same type as existing keys in the dictionary.","description":null,"required":true}],"flux_type":"(dict: [A:B], key: A) => [A:B] where A: Comparable","is_option":false,"source_location":{"file":"dict/dict.flux","start":{"line":132,"column":1},"end":{"line":132,"column":68},"source":"builtin remove : (dict: [K:V], key: K) => [K:V] where K: Comparable"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.97.0"}},{"path":"experimental","name":"experimental","headline":"Package experimental includes experimental functions and packages.","description":null,"members":{"addDuration":{"kind":"Function","name":"addDuration","headline":"addDuration adds a duration to a time value and returns the resulting time value.","description":null,"parameters":[{"name":"d","headline":"d: Duration to add.","description":null,"required":true},{"name":"to","headline":"to: Time to add the duration to.","description":null,"required":true},{"name":"location","headline":"location: Location to use for the time value.","description":null,"required":false}],"flux_type":"(d: duration, to: A, ?location: {zone: string, offset: duration}) => time where A: Timeable","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":77,"column":1},"end":{"line":77,"column":70},"source":"addDuration = (d, to, location=location) => date.add(d, to, location)"},"examples":[],"metadata":{"deprecated":"0.162.0","introduced":"0.39.0","tags":"date/time"}},"alignTime":{"kind":"Function","name":"alignTime","headline":"alignTime shifts time values in input tables to all start at a common start time.","description":null,"parameters":[{"name":"alignTo","headline":"alignTo: Time to align tables to. Default is `1970-01-01T00:00:00Z`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[B], ?alignTo: A) => stream[C] where B: Record, C: Record","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":495,"column":1},"end":{"line":499,"column":39},"source":"alignTime = (tables=<-, alignTo=time(v: 0)) =>\n tables\n |> stateDuration(fn: (r) => true, column: \"timeDiff\", unit: 1ns)\n |> map(fn: (r) => ({r with _time: time(v: int(v: alignTo) + r.timeDiff)}))\n |> drop(columns: [\"timeDiff\"])"},"examples":[],"metadata":{"introduced":"0.66.0","tags":"transformations, date/time"}},"catch":{"kind":"Function","name":"catch","headline":"catch calls a function and returns any error as a string value.\nIf the function does not error the returned value is made into a string and returned.","description":null,"parameters":[{"name":"fn","headline":"fn: Function to call.","description":null,"required":true}],"flux_type":"(fn: () => A) => {value: A, msg: string, code: uint}","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":1375,"column":1},"end":{"line":1375,"column":69},"source":"builtin catch : (fn: () => A) => {value: A, code: uint, msg: string}"},"examples":[],"metadata":{"introduced":"0.174.0"}},"chain":{"kind":"Function","name":"chain","headline":"chain runs two queries in a single Flux script sequentially and outputs the\nresults of the second query.","description":null,"parameters":[{"name":"first","headline":"first: First query to execute.","description":null,"required":true},{"name":"second","headline":"second: Second query to execute.","description":null,"required":true}],"flux_type":"(first: stream[A], second: stream[B]) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":450,"column":1},"end":{"line":450,"column":94},"source":"builtin chain : (first: stream[A], second: stream[B]) => stream[B] where A: Record, B: Record"},"examples":[],"metadata":{"introduced":"0.68.0"}},"count":{"kind":"Function","name":"count","headline":"count returns the number of records in each input table.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}]) => stream[{A with _value: int}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":686,"column":1},"end":{"line":686,"column":87},"source":"builtin count : (<-tables: stream[{T with _value: A}]) => stream[{T with _value: int}]"},"examples":[],"metadata":{"introduced":"0.107.0","tags":"transformations,aggregates"}},"diff":{"kind":"Function","name":"diff","headline":"diff takes two table streams as input and produces a diff.","description":null,"parameters":[{"name":"want","headline":"want: Input stream for the `-` side of the diff.","description":null,"required":true},{"name":"got","headline":"got: Input stream for the `+` side of the diff.","description":null,"required":false}],"flux_type":"(<-got: stream[A], want: stream[A]) => stream[{A with _diff: string}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":1420,"column":1},"end":{"line":1420,"column":85},"source":"builtin diff : (<-got: stream[A], want: stream[A]) => stream[{A with _diff: string}]"},"examples":[],"metadata":{"introduced":"0.175.0"}},"distinct":{"kind":"Function","name":"distinct","headline":"distinct returns unique values from the `_value` column.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":1057,"column":1},"end":{"line":1057,"column":88},"source":"builtin distinct : (<-tables: stream[{T with _value: A}]) => stream[{T with _value: A}]"},"examples":[],"metadata":{"introduced":"0.112.0","tags":"transformations,selectors"}},"fill":{"kind":"Function","name":"fill","headline":"fill replaces all null values in the `_value` column with a non-null value.","description":null,"parameters":[{"name":"value","headline":"value: Value to replace null values with.\n Data type must match the type of the `_value` column.","description":null,"required":false},{"name":"usePrevious","headline":"usePrevious: Replace null values with the value of the previous non-null row.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{B with _value: A}], ?usePrevious: bool, ?value: A) => stream[{B with _value: A}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":1091,"column":1},"end":{"line":1095,"column":36},"source":"builtin fill : (\n <-tables: stream[{T with _value: A}],\n ?value: A,\n ?usePrevious: bool,\n ) => stream[{T with _value: A}]"},"examples":[],"metadata":{"introduced":"0.112.0","tags":"transformations"}},"first":{"kind":"Function","name":"first","headline":"first returns the first record with a non-null value in the `_value` column\nfor each input table.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":1119,"column":1},"end":{"line":1119,"column":85},"source":"builtin first : (<-tables: stream[{T with _value: A}]) => stream[{T with _value: A}]"},"examples":[],"metadata":{"introduced":"0.112.0","tags":"transformations,selectors"}},"group":{"kind":"Function","name":"group","headline":"group introduces an `extend` mode to the existing `group()` function.","description":null,"parameters":[{"name":"columns","headline":"columns: List of columns to use in the grouping operation. Default is `[]`.","description":null,"required":true},{"name":"mode","headline":"mode: Grouping mode. `extend` is the only mode available to `experimental.group()`.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], columns: [string], mode: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":179,"column":1},"end":{"line":179,"column":100},"source":"builtin group : (<-tables: stream[A], mode: string, columns: [string]) => stream[A] where A: Record"},"examples":[],"metadata":{"tags":"transformations"}},"histogram":{"kind":"Function","name":"histogram","headline":"histogram approximates the cumulative distribution of a dataset by counting\ndata frequencies for a list of bins.","description":null,"parameters":[{"name":"bins","headline":"bins: List of upper bounds to use when computing histogram frequencies,\n including the maximum value of the data set.","description":null,"required":true},{"name":"normalize","headline":"normalize: Convert count values into frequency values between 0 and 1.\n Default is `false`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: float}], bins: [float], ?normalize: bool) => stream[{A with le: float, _value: float}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":1276,"column":1},"end":{"line":1280,"column":51},"source":"builtin histogram : (\n <-tables: stream[{T with _value: float}],\n bins: [float],\n ?normalize: bool,\n ) => stream[{T with _value: float, le: float}]"},"examples":[],"metadata":{"introduced":"0.112.0","tags":"transformations"}},"histogramQuantile":{"kind":"Function","name":"histogramQuantile","headline":"histogramQuantile approximates a quantile given a histogram with the\ncumulative distribution of the dataset.","description":null,"parameters":[{"name":"quantile","headline":"quantile: Quantile to compute (`[0.0 - 1.0]`).","description":null,"required":false},{"name":"minValue","headline":"minValue: Assumed minimum value of the dataset. Default is `0.0`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[{A with le: float, _value: float}],\n ?minValue: float,\n ?quantile: float,\n) => stream[{A with _value: float}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":750,"column":1},"end":{"line":754,"column":40},"source":"builtin histogramQuantile : (\n <-tables: stream[{T with _value: float, le: float}],\n ?quantile: float,\n ?minValue: float,\n ) => stream[{T with _value: float}]"},"examples":[],"metadata":{"introduced":"0.107.0","tags":"transformations,aggregates"}},"integral":{"kind":"Function","name":"integral","headline":"integral computes the area under the curve per unit of time of subsequent non-null records.","description":null,"parameters":[{"name":"unit","headline":"unit: Time duration used to compute the integral.","description":null,"required":false},{"name":"interpolate","headline":"interpolate: Type of interpolation to use. Default is `\"\"` (no interpolation).","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B, _time: time}], ?interpolate: string, ?unit: duration) => stream[{A with _value: B}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":648,"column":1},"end":{"line":652,"column":36},"source":"builtin integral : (\n <-tables: stream[{T with _time: time, _value: B}],\n ?unit: duration,\n ?interpolate: string,\n ) => stream[{T with _value: B}]"},"examples":[],"metadata":{"introduced":"0.106.0","tags":"transformations, aggregates"}},"join":{"kind":"Function","name":"join","headline":"join joins two streams of tables on the **group key and `_time` column**.","description":null,"parameters":[{"name":"left","headline":"left: First of two streams of tables to join.","description":null,"required":true},{"name":"right","headline":"right: Second of two streams of tables to join.","description":null,"required":true},{"name":"fn","headline":"fn: Function with left and right arguments that maps a new output record\n using values from the `left` and `right` input records.\n The return value must be a record.","description":null,"required":true}],"flux_type":"(fn: (left: A, right: B) => C, left: stream[A], right: stream[B]) => stream[C] where A: Record, B: Record, C: Record","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":399,"column":1},"end":{"line":403,"column":14},"source":"builtin join : (left: stream[A], right: stream[B], fn: (left: A, right: B) => C) => stream[C]\n where\n A: Record,\n B: Record,\n C: Record"},"examples":[],"metadata":{"deprecated":"0.172.0","introduced":"0.65.0","tags":"transformations"}},"kaufmansAMA":{"kind":"Function","name":"kaufmansAMA","headline":"kaufmansAMA calculates the Kaufman's Adaptive Moving Average (KAMA) of input\ntables using the `_value` column in each table.","description":null,"parameters":[{"name":"n","headline":"n: Period or number of points to use in the calculation.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}], n: int) => stream[{A with _value: float}] where B: Numeric","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":1025,"column":1},"end":{"line":1030,"column":15},"source":"builtin kaufmansAMA : (\n <-tables: stream[{T with _value: A}],\n n: int,\n ) => stream[{T with _value: float}]\n where\n A: Numeric"},"examples":[],"metadata":{"introduced":"0.107.0","tags":"transformations"}},"last":{"kind":"Function","name":"last","headline":"last returns the last record with a non-null value in the `_value` column\nfor each input table.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":1143,"column":1},"end":{"line":1143,"column":84},"source":"builtin last : (<-tables: stream[{T with _value: A}]) => stream[{T with _value: A}]"},"examples":[],"metadata":{"introduced":"0.112.0","tags":"transformations,selectors"}},"max":{"kind":"Function","name":"max","headline":"max returns the record with the highest value in the `_value` column for each\ninput table.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":1167,"column":1},"end":{"line":1167,"column":83},"source":"builtin max : (<-tables: stream[{T with _value: A}]) => stream[{T with _value: A}]"},"examples":[],"metadata":{"introduced":"0.112.0","tags":"transformations,selectors"}},"mean":{"kind":"Function","name":"mean","headline":"mean computes the mean or average of non-null values in the `_value` column\nof each input table.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: float}]) => stream[{A with _value: float}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":778,"column":1},"end":{"line":778,"column":92},"source":"builtin mean : (<-tables: stream[{T with _value: float}]) => stream[{T with _value: float}]"},"examples":[],"metadata":{"introduced":"0.107.0","tags":"transformations,aggregates"}},"min":{"kind":"Function","name":"min","headline":"min returns the record with the lowest value in the `_value` column for each\ninput table.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":1191,"column":1},"end":{"line":1191,"column":83},"source":"builtin min : (<-tables: stream[{T with _value: A}]) => stream[{T with _value: A}]"},"examples":[],"metadata":{"introduced":"0.112.0","tags":"transformations,selectors"}},"mode":{"kind":"Function","name":"mode","headline":"mode computes the mode or value that occurs most often in the `_value` column\nin each input table.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":812,"column":1},"end":{"line":812,"column":84},"source":"builtin mode : (<-tables: stream[{T with _value: A}]) => stream[{T with _value: A}]"},"examples":[],"metadata":{"introduced":"0.107.0","tags":"transformations,aggregates"}},"objectKeys":{"kind":"Function","name":"objectKeys","headline":"objectKeys returns an array of property keys in a specified record.","description":null,"parameters":[{"name":"o","headline":"o: Record to return property keys from.","description":null,"required":true}],"flux_type":"(o: A) => [string] where A: Record","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":204,"column":1},"end":{"line":204,"column":56},"source":"builtin objectKeys : (o: A) => [string] where A: Record"},"examples":[],"metadata":{"introduced":"0.40.0"}},"preview":{"kind":"Function","name":"preview","headline":"preview limits the number of rows and tables in the stream.","description":null,"parameters":[{"name":"nrows","headline":"nrows: Maximum number of rows per table to return. Default is `5`.","description":null,"required":false},{"name":"ntables","headline":"ntables: Maximum number of tables to return.\n Default is `5`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?nrows: int, ?ntables: int) => stream[A] where A: Record","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":1310,"column":1},"end":{"line":1310,"column":97},"source":"builtin preview : (<-tables: stream[A], ?nrows: int, ?ntables: int) => stream[A] where A: Record"},"examples":[],"metadata":{"introduced":"0.167.0","tags":"transformations"}},"quantile":{"kind":"Function","name":"quantile","headline":"quantile returns non-null records with values in the `_value` column that\nfall within the specified quantile or represent the specified quantile.","description":null,"parameters":[{"name":"q","headline":"q: Quantile to compute (`[0 - 1]`).","description":null,"required":true},{"name":"method","headline":"method: Computation method. Default is `estimate_tdigest`.","description":null,"required":false},{"name":"compression","headline":"compression: Number of centroids to use when compressing the dataset.\n Default is `1000.0`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[{A with _value: float}],\n q: float,\n ?compression: float,\n ?method: string,\n) => stream[{A with _value: float}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":884,"column":1},"end":{"line":889,"column":40},"source":"builtin quantile : (\n <-tables: stream[{T with _value: float}],\n q: float,\n ?compression: float,\n ?method: string,\n ) => stream[{T with _value: float}]"},"examples":[],"metadata":{"introduced":"0.107.0","tags":"transformations,aggregates,selectors"}},"set":{"kind":"Function","name":"set","headline":"set sets multiple static column values on all records.","description":null,"parameters":[{"name":"o","headline":"o: Record that defines the columns and values to set.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[B], o: A) => stream[C] where A: Record, B: Record, C: Record","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":248,"column":1},"end":{"line":248,"column":93},"source":"builtin set : (<-tables: stream[A], o: B) => stream[C] where A: Record, B: Record, C: Record"},"examples":[],"metadata":{"introduced":"0.40.0","tags":"transformations"}},"skew":{"kind":"Function","name":"skew","headline":"skew returns the skew of non-null values in the `_value` column for each\ninput table as a float.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: float}]) => stream[{A with _value: float}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":911,"column":1},"end":{"line":911,"column":92},"source":"builtin skew : (<-tables: stream[{T with _value: float}]) => stream[{T with _value: float}]"},"examples":[],"metadata":{"introduced":"0.107.0","tags":"transformations,aggregates"}},"spread":{"kind":"Function","name":"spread","headline":"spread returns the difference between the minimum and maximum values in the\n`_value` column for each input table.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}] where B: Numeric","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":933,"column":1},"end":{"line":935,"column":15},"source":"builtin spread : (<-tables: stream[{T with _value: A}]) => stream[{T with _value: A}]\n where\n A: Numeric"},"examples":[],"metadata":{"introduced":"0.107.0","tags":"transformations,aggregates"}},"stddev":{"kind":"Function","name":"stddev","headline":"stddev returns the standard deviation of non-null values in the `_value`\ncolumn for each input table.","description":null,"parameters":[{"name":"mode","headline":"mode: Standard deviation mode or type of standard deviation to calculate.\n Default is `sample`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: float}], ?mode: string) => stream[{A with _value: float}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":975,"column":1},"end":{"line":978,"column":40},"source":"builtin stddev : (\n <-tables: stream[{T with _value: float}],\n ?mode: string,\n ) => stream[{T with _value: float}]"},"examples":[],"metadata":{"introduced":"0.107.0","tags":"transformations,aggregates"}},"subDuration":{"kind":"Function","name":"subDuration","headline":"subDuration subtracts a duration from a time value and returns the resulting time value.","description":null,"parameters":[{"name":"from","headline":"from: Time to subtract the duration from.","description":null,"required":true},{"name":"d","headline":"d: Duration to subtract.","description":null,"required":true},{"name":"location","headline":"location: Location to use for the time value.","description":null,"required":false}],"flux_type":"(d: duration, from: A, ?location: {zone: string, offset: duration}) => time where A: Timeable","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":138,"column":1},"end":{"line":138,"column":74},"source":"subDuration = (d, from, location=location) => date.sub(d, from, location)"},"examples":[],"metadata":{"deprecated":"0.162.0","introduced":"0.39.0","tags":"date/time"}},"sum":{"kind":"Function","name":"sum","headline":"sum returns the sum of non-null values in the `_value` column for each input table.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}] where B: Numeric","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":999,"column":1},"end":{"line":999,"column":100},"source":"builtin sum : (<-tables: stream[{T with _value: A}]) => stream[{T with _value: A}] where A: Numeric"},"examples":[],"metadata":{"introduced":"0.107.0","tags":"transformations,aggregates"}},"to":{"kind":"Function","name":"to","headline":"to writes _pivoted_ data to an InfluxDB 2.x or InfluxDB Cloud bucket.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Name of the bucket to write to.\n _`bucket` and `bucketID` are mutually exclusive_.","description":null,"required":false},{"name":"bucketID","headline":"bucketID: String-encoded bucket ID to to write to.\n _`bucket` and `bucketID` are mutually exclusive_.","description":null,"required":false},{"name":"host","headline":"host: URL of the InfluxDB instance to write to.","description":null,"required":false},{"name":"org","headline":"org: Organization name.\n _`org` and `orgID` are mutually exclusive_.","description":null,"required":false},{"name":"orgID","headline":"orgID: String-encoded organization ID to query.\n _`org` and `orgID` are mutually exclusive_.","description":null,"required":false},{"name":"token","headline":"token: InfluxDB API token.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n ?bucket: string,\n ?bucketID: string,\n ?host: string,\n ?org: string,\n ?orgID: string,\n ?token: string,\n) => stream[A] where A: Record","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":315,"column":1},"end":{"line":315,"column":21},"source":"to = influxdb.wideTo"},"examples":[],"metadata":{"deprecated":"0.174.0","introduced":"0.40.0","tags":"outputs"}},"unique":{"kind":"Function","name":"unique","headline":"unique returns all records containing unique values in the `_value` column.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":1220,"column":1},"end":{"line":1220,"column":86},"source":"builtin unique : (<-tables: stream[{T with _value: A}]) => stream[{T with _value: A}]"},"examples":[],"metadata":{"introduced":"0.112.0","tags":"transformations,selectors"}},"unpivot":{"kind":"Function","name":"unpivot","headline":"unpivot creates `_field` and `_value` columns pairs using all columns (other than `_time`)\n_not_ in the group key.\nThe `_field` column contains the original column label and the `_value` column\ncontains the original column value.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false},{"name":"otherColumns","headline":"otherColumns: List of column names that are not in the group key but are also not field columns. Default is `[\"_time\"]`.","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _time: time}], ?otherColumns: [string]) => stream[{B with _value: C, _field: string}] where A: Record, B: Record","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":1350,"column":1},"end":{"line":1356,"column":14},"source":"builtin unpivot : (\n <-tables: stream[{A with _time: time}],\n ?otherColumns: [string],\n ) => stream[{B with _field: string, _value: C}]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.172.0","tags":"transformations"}},"window":{"kind":"Function","name":"window","headline":"window groups records based on time.","description":null,"parameters":[{"name":"every","headline":"every: Duration of time between windows. Default is the `0s`.","description":null,"required":false},{"name":"period","headline":"period: Duration of the window. Default is `0s`.","description":null,"required":false},{"name":"offset","headline":"offset: Duration to shift the window boundaries by. Default is 0s.","description":null,"required":false},{"name":"location","headline":"location: Location used to determine timezone. Default is the `location` option.","description":null,"required":false},{"name":"createEmpty","headline":"createEmpty: Create empty tables for empty windows. Default is `false`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[{A with _time: time, _stop: time, _start: time}],\n ?createEmpty: bool,\n ?every: duration,\n ?location: {zone: string, offset: duration},\n ?offset: duration,\n ?period: duration,\n) => stream[{A with _time: time, _stop: time, _start: time}]","is_option":false,"source_location":{"file":"experimental/experimental.flux","start":{"line":580,"column":1},"end":{"line":595,"column":10},"source":"window = (\n tables=<-,\n every=0s,\n period=0s,\n offset=0s,\n location=location,\n createEmpty=false,\n) =>\n tables\n |> _window(\n every,\n period,\n offset,\n location,\n createEmpty,\n )"},"examples":[],"metadata":{"introduced":"0.106.0","tags":"transformations,date/time"}}},"examples":[],"metadata":{"introduced":"0.39.0"}},{"path":"experimental/aggregate","name":"aggregate","headline":"Package aggregate provides functions to simplify common aggregate operations.","description":null,"members":{"rate":{"kind":"Function","name":"rate","headline":"rate calculates the average rate of increase per window of time for each\ninput table.","description":null,"parameters":[{"name":"every","headline":"every: Duration of time windows.","description":null,"required":true},{"name":"groupColumns","headline":"groupColumns: List of columns to group by. Default is `[]`.","description":null,"required":false},{"name":"unit","headline":"unit: Time duration to use when calculating the rate. Default is `1s`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], every: duration, ?groupColumns: [string], ?unit: duration) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"experimental/aggregate/aggregate.flux","start":{"line":46,"column":1},"end":{"line":57,"column":10},"source":"rate = (tables=<-, every, groupColumns=[], unit=1s) =>\n tables\n |> derivative(nonNegative: true, unit: unit)\n |> aggregateWindow(\n every: every,\n fn: (tables=<-, column) =>\n tables\n |> mean(column: column)\n |> group(columns: groupColumns)\n |> experimental.group(columns: [\"_start\", \"_stop\"], mode: \"extend\")\n |> sum(),\n )"},"examples":[],"metadata":{"tags":"transformations,aggregates"}}},"examples":[],"metadata":{"introduced":"0.61.0"}},{"path":"experimental/array","name":"array","headline":"Package array provides functions for manipulating arrays and for building tables from Flux arrays.","description":null,"members":{"concat":{"kind":"Function","name":"concat","headline":"concat appends two arrays and returns a new array.","description":null,"parameters":[{"name":"arr","headline":"arr: First array. Default is the piped-forward array (`<-`).","description":null,"required":false},{"name":"v","headline":"v: Array to append to the first array.","description":null,"required":true}],"flux_type":"(<-arr: [A], v: [A]) => [A]","is_option":false,"source_location":{"file":"experimental/array/array.flux","start":{"line":89,"column":1},"end":{"line":89,"column":22},"source":"concat = array.concat"},"examples":[],"metadata":{"deprecated":"0.173.0","introduced":"0.155.0"}},"filter":{"kind":"Function","name":"filter","headline":"filter iterates over an array, evaluates each element with a predicate function, and then returns\na new array with only elements that match the predicate.","description":null,"parameters":[{"name":"arr","headline":"arr: Array to filter. Default is the piped-forward array (`<-`).","description":null,"required":false},{"name":"fn","headline":"fn: Predicate function to evaluate on each element.\n The element is represented by `x` in the predicate function.","description":null,"required":true}],"flux_type":"(<-arr: [A], fn: (x: A) => bool) => [A]","is_option":false,"source_location":{"file":"experimental/array/array.flux","start":{"line":149,"column":1},"end":{"line":149,"column":22},"source":"filter = array.filter"},"examples":[],"metadata":{"deprecated":"0.173.0","introduced":"0.155.0"}},"from":{"kind":"Function","name":"from","headline":"from constructs a table from an array of records.","description":null,"parameters":[{"name":"rows","headline":"rows: Array of records to construct a table with.","description":null,"required":false}],"flux_type":"(<-rows: [A]) => stream[A] where A: Record","is_option":false,"source_location":{"file":"experimental/array/array.flux","start":{"line":57,"column":1},"end":{"line":57,"column":18},"source":"from = array.from"},"examples":[],"metadata":{"deprecated":"0.103.0"}},"map":{"kind":"Function","name":"map","headline":"map iterates over an array, applies a function to each element to produce a new element,\nand then returns a new array.","description":null,"parameters":[{"name":"arr","headline":"arr: Array to operate on. Defaults is the piped-forward array (`<-`).","description":null,"required":false},{"name":"fn","headline":"fn: Function to apply to elements. The element is represented by `x` in the function.","description":null,"required":true}],"flux_type":"(<-arr: [A], fn: (x: A) => B) => [B]","is_option":false,"source_location":{"file":"experimental/array/array.flux","start":{"line":118,"column":1},"end":{"line":118,"column":16},"source":"map = array.map"},"examples":[],"metadata":{"deprecated":"0.173.0","introduced":"0.155.0"}},"toBool":{"kind":"Function","name":"toBool","headline":"toBool converts all values in an array to booleans.","description":null,"parameters":[{"name":"arr","headline":"arr: Array of values to convert. Default is the piped-forward array (`<-`).","description":null,"required":false}],"flux_type":"(<-arr: [A]) => [bool]","is_option":false,"source_location":{"file":"experimental/array/array.flux","start":{"line":179,"column":1},"end":{"line":179,"column":64},"source":"toBool = (arr=<-) => array.map(arr: arr, fn: (x) => bool(v: x))"},"examples":[],"metadata":{"introduced":"0.184.0","tags":"type-conversions"}},"toDuration":{"kind":"Function","name":"toDuration","headline":"toDuration converts all values in an array to durations.","description":null,"parameters":[{"name":"arr","headline":"arr: Array of values to convert. Default is the piped-forward array (`<-`).","description":null,"required":false}],"flux_type":"(<-arr: [A]) => [duration]","is_option":false,"source_location":{"file":"experimental/array/array.flux","start":{"line":208,"column":1},"end":{"line":208,"column":72},"source":"toDuration = (arr=<-) => array.map(arr: arr, fn: (x) => duration(v: x))"},"examples":[],"metadata":{"introduced":"0.184.0","tags":"type-conversions"}},"toFloat":{"kind":"Function","name":"toFloat","headline":"toFloat converts all values in an array to floats.","description":null,"parameters":[{"name":"arr","headline":"arr: Array of values to convert. Default is the piped-forward array (`<-`).","description":null,"required":false}],"flux_type":"(<-arr: [A]) => [float]","is_option":false,"source_location":{"file":"experimental/array/array.flux","start":{"line":248,"column":1},"end":{"line":248,"column":66},"source":"toFloat = (arr=<-) => array.map(arr: arr, fn: (x) => float(v: x))"},"examples":[],"metadata":{"introduced":"0.184.0","tags":"type-conversions"}},"toInt":{"kind":"Function","name":"toInt","headline":"toInt converts all values in an array to integers.","description":null,"parameters":[{"name":"arr","headline":"arr: Array of values to convert. Default is the piped-forward array (`<-`).","description":null,"required":false}],"flux_type":"(<-arr: [A]) => [int]","is_option":false,"source_location":{"file":"experimental/array/array.flux","start":{"line":282,"column":1},"end":{"line":282,"column":62},"source":"toInt = (arr=<-) => array.map(arr: arr, fn: (x) => int(v: x))"},"examples":[],"metadata":{"introduced":"0.184.0","tags":"type-conversions"}},"toString":{"kind":"Function","name":"toString","headline":"toString converts all values in an array to strings.","description":null,"parameters":[{"name":"arr","headline":"arr: Array of values to convert. Default is the piped-forward array (`<-`).","description":null,"required":false}],"flux_type":"(<-arr: [A]) => [string]","is_option":false,"source_location":{"file":"experimental/array/array.flux","start":{"line":314,"column":1},"end":{"line":314,"column":68},"source":"toString = (arr=<-) => array.map(arr: arr, fn: (x) => string(v: x))"},"examples":[],"metadata":{"introduced":"0.184.0","tags":"type-conversions"}},"toTime":{"kind":"Function","name":"toTime","headline":"toTime converts all values in an array to times.","description":null,"parameters":[{"name":"arr","headline":"arr: Array of values to convert. Default is the piped-forward array (`<-`).","description":null,"required":false}],"flux_type":"(<-arr: [A]) => [time]","is_option":false,"source_location":{"file":"experimental/array/array.flux","start":{"line":344,"column":1},"end":{"line":344,"column":64},"source":"toTime = (arr=<-) => array.map(arr: arr, fn: (x) => time(v: x))"},"examples":[],"metadata":{"introduced":"0.184.0","tags":"type-conversions"}},"toUInt":{"kind":"Function","name":"toUInt","headline":"toUInt converts all values in an array to unsigned integers.","description":null,"parameters":[{"name":"arr","headline":"arr: Array of values to convert. Default is the piped-forward array (`<-`).","description":null,"required":false}],"flux_type":"(<-arr: [A]) => [uint]","is_option":false,"source_location":{"file":"experimental/array/array.flux","start":{"line":378,"column":1},"end":{"line":378,"column":64},"source":"toUInt = (arr=<-) => array.map(arr: arr, fn: (x) => uint(v: x))"},"examples":[],"metadata":{"introduced":"0.184.0","tags":"type-conversions"}}},"examples":[],"metadata":{"introduced":"0.79.0","tags":"array,tables"}},{"path":"experimental/bigtable","name":"bigtable","headline":"Package bigtable provides tools for working with data in\n[Google Cloud Bigtable](https://cloud.google.com/bigtable/) databases.","description":null,"members":{"from":{"kind":"Function","name":"from","headline":"from retrieves data from a [Google Cloud Bigtable](https://cloud.google.com/bigtable/) data source.","description":null,"parameters":[{"name":"token","headline":"token: Google Cloud IAM token to use to access the Cloud Bigtable database.","description":null,"required":true},{"name":"project","headline":"project: Cloud Bigtable project ID.","description":null,"required":true},{"name":"instance","headline":"instance: Cloud Bigtable instance ID.","description":null,"required":true},{"name":"table","headline":"table: Cloud Bigtable table name.","description":null,"required":true}],"flux_type":"(instance: string, project: string, table: string, token: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"experimental/bigtable/bigtable.flux","start":{"line":42,"column":1},"end":{"line":44,"column":14},"source":"builtin from : (token: string, project: string, instance: string, table: string) => stream[T]\n where\n T: Record"},"examples":[],"metadata":{"tags":"inputs"}}},"examples":[],"metadata":{"introduced":"0.45.0"}},{"path":"experimental/bitwise","name":"bitwise","headline":"Package bitwise provides functions for performing bitwise operations on integers.","description":null,"members":{"sand":{"kind":"Function","name":"sand","headline":"sand performs the bitwise operation, `a AND b`, with integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Right hand operand.","description":null,"required":true}],"flux_type":"(a: int, b: int) => int","is_option":false,"source_location":{"file":"experimental/bitwise/bitwise.flux","start":{"line":259,"column":1},"end":{"line":259,"column":20},"source":"sand = bitwise.sand"},"examples":[],"metadata":null},"sclear":{"kind":"Function","name":"sclear","headline":"sclear performs the bitwise operation `a AND NOT b`.\nBoth `a` and `b` are integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Bits to clear.","description":null,"required":true}],"flux_type":"(a: int, b: int) => int","is_option":false,"source_location":{"file":"experimental/bitwise/bitwise.flux","start":{"line":379,"column":1},"end":{"line":379,"column":24},"source":"sclear = bitwise.sclear"},"examples":[],"metadata":null},"slshift":{"kind":"Function","name":"slshift","headline":"slshift shifts the bits in `a` left by `b` bits.\nBoth `a` and `b` are integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Number of bits to shift.","description":null,"required":true}],"flux_type":"(a: int, b: int) => int","is_option":false,"source_location":{"file":"experimental/bitwise/bitwise.flux","start":{"line":410,"column":1},"end":{"line":410,"column":26},"source":"slshift = bitwise.slshift"},"examples":[],"metadata":null},"snot":{"kind":"Function","name":"snot","headline":"snot inverts every bit in `a`, an integer.","description":null,"parameters":[{"name":"a","headline":"a: Integer to invert.","description":null,"required":true}],"flux_type":"(a: int) => int","is_option":false,"source_location":{"file":"experimental/bitwise/bitwise.flux","start":{"line":318,"column":1},"end":{"line":318,"column":20},"source":"snot = bitwise.snot"},"examples":[],"metadata":null},"sor":{"kind":"Function","name":"sor","headline":"sor performs the bitwise operation, `a OR b`, with integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Right hand operand.","description":null,"required":true}],"flux_type":"(a: int, b: int) => int","is_option":false,"source_location":{"file":"experimental/bitwise/bitwise.flux","start":{"line":289,"column":1},"end":{"line":289,"column":18},"source":"sor = bitwise.sor"},"examples":[],"metadata":null},"srshift":{"kind":"Function","name":"srshift","headline":"srshift shifts the bits in `a` right by `b` bits.\nBoth `a` and `b` are integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Number of bits to shift.","description":null,"required":true}],"flux_type":"(a: int, b: int) => int","is_option":false,"source_location":{"file":"experimental/bitwise/bitwise.flux","start":{"line":441,"column":1},"end":{"line":441,"column":26},"source":"srshift = bitwise.srshift"},"examples":[],"metadata":null},"sxor":{"kind":"Function","name":"sxor","headline":"sxor performs the bitwise operation, `a XOR b`, with integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Right hand operand.","description":null,"required":true}],"flux_type":"(a: int, b: int) => int","is_option":false,"source_location":{"file":"experimental/bitwise/bitwise.flux","start":{"line":348,"column":1},"end":{"line":348,"column":20},"source":"sxor = bitwise.sxor"},"examples":[],"metadata":null},"uand":{"kind":"Function","name":"uand","headline":"uand performs the bitwise operation, `a AND b`, with unsigned integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Right hand operand.","description":null,"required":true}],"flux_type":"(a: uint, b: uint) => uint","is_option":false,"source_location":{"file":"experimental/bitwise/bitwise.flux","start":{"line":48,"column":1},"end":{"line":48,"column":20},"source":"uand = bitwise.uand"},"examples":[],"metadata":null},"uclear":{"kind":"Function","name":"uclear","headline":"uclear performs the bitwise operation `a AND NOT b`, with unsigned integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Bits to clear.","description":null,"required":true}],"flux_type":"(a: uint, b: uint) => uint","is_option":false,"source_location":{"file":"experimental/bitwise/bitwise.flux","start":{"line":167,"column":1},"end":{"line":167,"column":24},"source":"uclear = bitwise.uclear"},"examples":[],"metadata":null},"ulshift":{"kind":"Function","name":"ulshift","headline":"ulshift shifts the bits in `a` left by `b` bits.\nBoth `a` and `b` are unsigned integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Number of bits to shift.","description":null,"required":true}],"flux_type":"(a: uint, b: uint) => uint","is_option":false,"source_location":{"file":"experimental/bitwise/bitwise.flux","start":{"line":198,"column":1},"end":{"line":198,"column":26},"source":"ulshift = bitwise.ulshift"},"examples":[],"metadata":null},"unot":{"kind":"Function","name":"unot","headline":"unot inverts every bit in `a`, an unsigned integer.","description":null,"parameters":[{"name":"a","headline":"a: Unsigned integer to invert.","description":null,"required":true}],"flux_type":"(a: uint) => uint","is_option":false,"source_location":{"file":"experimental/bitwise/bitwise.flux","start":{"line":107,"column":1},"end":{"line":107,"column":20},"source":"unot = bitwise.unot"},"examples":[],"metadata":null},"uor":{"kind":"Function","name":"uor","headline":"uor performs the bitwise operation, `a OR b`, with unsigned integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Right hand operand.","description":null,"required":true}],"flux_type":"(a: uint, b: uint) => uint","is_option":false,"source_location":{"file":"experimental/bitwise/bitwise.flux","start":{"line":78,"column":1},"end":{"line":78,"column":18},"source":"uor = bitwise.uor"},"examples":[],"metadata":null},"urshift":{"kind":"Function","name":"urshift","headline":"urshift shifts the bits in `a` right by `b` bits.\nBoth `a` and `b` are unsigned integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Number of bits to shift.","description":null,"required":true}],"flux_type":"(a: uint, b: uint) => uint","is_option":false,"source_location":{"file":"experimental/bitwise/bitwise.flux","start":{"line":229,"column":1},"end":{"line":229,"column":26},"source":"urshift = bitwise.urshift"},"examples":[],"metadata":null},"uxor":{"kind":"Function","name":"uxor","headline":"uxor performs the bitwise operation, `a XOR b`, with unsigned integers.","description":null,"parameters":[{"name":"a","headline":"a: Left hand operand.","description":null,"required":true},{"name":"b","headline":"b: Right hand operand.","description":null,"required":true}],"flux_type":"(a: uint, b: uint) => uint","is_option":false,"source_location":{"file":"experimental/bitwise/bitwise.flux","start":{"line":137,"column":1},"end":{"line":137,"column":20},"source":"uxor = bitwise.uxor"},"examples":[],"metadata":null}},"examples":[],"metadata":{"deprecated":"0.173.0","introduced":"0.138.0","tags":"bitwise"}},{"path":"experimental/csv","name":"csv","headline":"Package csv provides functions for retrieving annotated CSV.","description":null,"members":{"from":{"kind":"Function","name":"from","headline":"from retrieves [annotated CSV](https://docs.influxdata.com/influxdb/latest/reference/syntax/annotated-csv/) **from a URL**.","description":null,"parameters":[{"name":"url","headline":"url: URL to retrieve annotated CSV from.","description":null,"required":true}],"flux_type":"(url: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"experimental/csv/csv.flux","start":{"line":43,"column":1},"end":{"line":43,"column":64},"source":"from = (url) => c.from(csv: string(v: http.get(url: url).body))"},"examples":[],"metadata":null}},"examples":[],"metadata":{"deprecated":"0.173.0","introduced":"0.64.0","tags":"csv"}},{"path":"experimental/date/boundaries","name":"boundaries","headline":"Package boundaries provides operators for finding the boundaries around certain days, months, and weeks.","description":null,"members":{"friday":{"kind":"Function","name":"friday","headline":"friday returns a record with `start` and `stop` boundary timestamps for last Friday.","description":null,"parameters":[],"flux_type":"() => {stop: time, start: time}","is_option":false,"source_location":{"file":"experimental/date/boundaries/boundaries.flux","start":{"line":259,"column":1},"end":{"line":261,"column":2},"source":"friday = () => {\n return _day_finder(td: date.Friday, func: _day_formatter)\n}"},"examples":[],"metadata":{"introduced":"0.177.1","tags":"date/time"}},"monday":{"kind":"Function","name":"monday","headline":"monday returns a record with `start` and `stop` boundary timestamps of last Monday.\nLast Monday is relative to `now()`. If today is Monday, the function returns boundaries for the previous Monday.","description":null,"parameters":[],"flux_type":"() => {stop: time, start: time}","is_option":false,"source_location":{"file":"experimental/date/boundaries/boundaries.flux","start":{"line":112,"column":1},"end":{"line":114,"column":2},"source":"monday = () => {\n return _day_finder(td: date.Monday, func: _day_formatter)\n}"},"examples":[],"metadata":{"introduced":"0.177.1","tags":"date/time"}},"month":{"kind":"Function","name":"month","headline":"month returns a record with `start` and `stop` boundary timestamps for the current month.","description":null,"parameters":[{"name":"month_offset","headline":"month_offset: Number of months to offset from the current month. Default is `0`.","description":null,"required":false}],"flux_type":"(?month_offset: int) => {stop: time, start: time}","is_option":false,"source_location":{"file":"experimental/date/boundaries/boundaries.flux","start":{"line":386,"column":1},"end":{"line":392,"column":2},"source":"month = (month_offset=0) => {\n a = date.truncate(t: today(), unit: 1mo)\n\n start = date.add(d: date.scale(d: 1mo, n: month_offset), to: a)\n\n return {start: start, stop: date.add(d: 1mo, to: start)}\n}"},"examples":[],"metadata":{"introduced":"0.177.1","tags":"date/time"}},"saturday":{"kind":"Function","name":"saturday","headline":"saturday returns a record with `start` and `stop` boundary timestamps for last Saturday.","description":null,"parameters":[],"flux_type":"() => {stop: time, start: time}","is_option":false,"source_location":{"file":"experimental/date/boundaries/boundaries.flux","start":{"line":296,"column":1},"end":{"line":298,"column":2},"source":"saturday = () => {\n return _day_finder(td: date.Saturday, func: _day_formatter)\n}"},"examples":[],"metadata":{"introduced":"0.177.1","tags":"date/time"}},"sunday":{"kind":"Function","name":"sunday","headline":"sunday returns a record with `start` and `stop` boundary timestamps for last Sunday.","description":null,"parameters":[],"flux_type":"() => {stop: time, start: time}","is_option":false,"source_location":{"file":"experimental/date/boundaries/boundaries.flux","start":{"line":333,"column":1},"end":{"line":335,"column":2},"source":"sunday = () => {\n return _day_finder(td: date.Sunday, func: _day_formatter)\n}"},"examples":[],"metadata":{"introduced":"0.177.1","tags":"date/time"}},"thursday":{"kind":"Function","name":"thursday","headline":"thursday returns a record with `start` and `stop` boundary timestamps for last Thursday.","description":null,"parameters":[],"flux_type":"() => {stop: time, start: time}","is_option":false,"source_location":{"file":"experimental/date/boundaries/boundaries.flux","start":{"line":222,"column":1},"end":{"line":224,"column":2},"source":"thursday = () => {\n return _day_finder(td: date.Thursday, func: _day_formatter)\n}"},"examples":[],"metadata":{"introduced":"0.177.1","tags":"date/time"}},"tuesday":{"kind":"Function","name":"tuesday","headline":"tuesday returns a record with `start` and `stop` boundary timestamps of last Tuesday.","description":null,"parameters":[],"flux_type":"() => {stop: time, start: time}","is_option":false,"source_location":{"file":"experimental/date/boundaries/boundaries.flux","start":{"line":149,"column":1},"end":{"line":151,"column":2},"source":"tuesday = () => {\n return _day_finder(td: date.Tuesday, func: _day_formatter)\n}"},"examples":[],"metadata":{"introduced":"0.177.1","tags":"date/time"}},"wednesday":{"kind":"Function","name":"wednesday","headline":"wednesday returns a record with `start` and `stop` boundary timestamps for last Wednesday.","description":null,"parameters":[],"flux_type":"() => {stop: time, start: time}","is_option":false,"source_location":{"file":"experimental/date/boundaries/boundaries.flux","start":{"line":186,"column":1},"end":{"line":188,"column":2},"source":"wednesday = () => {\n return _day_finder(td: date.Wednesday, func: _day_formatter)\n}"},"examples":[],"metadata":{"introduced":"0.177.1","tags":"date/time"}},"week":{"kind":"Function","name":"week","headline":"week returns a record with `start` and `stop` boundary timestamps of the current week.\nBy default, weeks start on Monday.","description":null,"parameters":[{"name":"start_sunday","headline":"start_sunday: Indicate if the week starts on Sunday. Default is `false`.","description":null,"required":false},{"name":"week_offset","headline":"week_offset: Number of weeks to offset from the current week. Default is `0`.","description":null,"required":false}],"flux_type":"(?start_sunday: bool, ?week_offset: int) => {stop: time, start: time}","is_option":false,"source_location":{"file":"experimental/date/boundaries/boundaries.flux","start":{"line":457,"column":1},"end":{"line":479,"column":2},"source":"week = (week_offset=0, start_sunday=false) => {\n d =\n if start_sunday then\n _day_finder(\n td: date.Sunday,\n func: _week_formatter,\n offset: date.scale(d: 1w, n: week_offset),\n )\n else\n _day_finder(\n td: date.Monday,\n func: _week_formatter,\n offset: date.scale(d: 1w, n: week_offset),\n )\n\n start =\n if date.weekDay(t: today()) == date.weekDay(t: d.start) then\n date.add(d: 1w, to: d.start)\n else\n d.start\n\n return {start: start, stop: date.add(d: 1w, to: start)}\n}"},"examples":[],"metadata":{"introduced":"0.177.1","tags":"date/time"}},"yesterday":{"kind":"Function","name":"yesterday","headline":"yesterday returns a record with `start` and `stop` boundary timestamps for yesterday.","description":null,"parameters":[],"flux_type":"() => {stop: time, start: time}","is_option":false,"source_location":{"file":"experimental/date/boundaries/boundaries.flux","start":{"line":44,"column":1},"end":{"line":46,"column":2},"source":"yesterday = () => {\n return {start: date.sub(d: 1d, from: today()), stop: today()}\n}"},"examples":[],"metadata":{"introduced":"0.177.1","tags":"date/time"}}},"examples":[],"metadata":{"introduced":"0.177.1"}},{"path":"experimental/dynamic","name":"dynamic","headline":"Package dynamic provides tools for working with values of unknown types.","description":null,"members":{"asArray":{"kind":"Function","name":"asArray","headline":"asArray converts a dynamic value into an array of dynamic elements.","description":null,"parameters":[{"name":"v","headline":"v: Dynamic value to convert. Default is the piped-forward value (`<-`).","description":null,"required":false}],"flux_type":"(<-v: dynamic) => [dynamic]","is_option":false,"source_location":{"file":"experimental/dynamic/dynamic.flux","start":{"line":27,"column":1},"end":{"line":27,"column":46},"source":"builtin asArray : (<-v: dynamic) => [dynamic]"},"examples":[],"metadata":{"tags":"type-conversions"}},"dynamic":{"kind":"Function","name":"dynamic","headline":"dynamic wraps a value so it can be used as a `dynamic` value.","description":null,"parameters":[{"name":"v","headline":"v: Value to wrap as dynamic.","description":null,"required":true}],"flux_type":"(v: A) => dynamic","is_option":false,"source_location":{"file":"experimental/dynamic/dynamic.flux","start":{"line":16,"column":1},"end":{"line":16,"column":36},"source":"builtin dynamic : (v: A) => dynamic"},"examples":[],"metadata":{"tags":"type-conversions"}},"isType":{"kind":"Function","name":"isType","headline":"isType tests if a dynamic type holds a value of a specified type.","description":null,"parameters":[{"name":"v","headline":"v: Value to test.","description":null,"required":true},{"name":"type","headline":"type: String describing the type to check against.","description":null,"required":true}],"flux_type":"(type: string, v: dynamic) => bool","is_option":false,"source_location":{"file":"experimental/dynamic/dynamic.flux","start":{"line":81,"column":1},"end":{"line":81,"column":52},"source":"builtin isType : (v: dynamic, type: string) => bool"},"examples":[],"metadata":{"introduced":"0.186.0","tags":"types, tests"}},"jsonEncode":{"kind":"Function","name":"jsonEncode","headline":"jsonEncode converts a dynamic value into JSON bytes.","description":null,"parameters":[{"name":"v","headline":"v: Value to encode into JSON.","description":null,"required":true}],"flux_type":"(v: dynamic) => bytes","is_option":false,"source_location":{"file":"experimental/dynamic/dynamic.flux","start":{"line":54,"column":1},"end":{"line":54,"column":43},"source":"builtin jsonEncode : (v: dynamic) => bytes"},"examples":[],"metadata":{"introduced":"0.186.0","tags":"type-conversions"}},"jsonParse":{"kind":"Function","name":"jsonParse","headline":"jsonParse takes JSON data as bytes and returns dynamic values.","description":null,"parameters":[{"name":"data","headline":"data: JSON data (as bytes) to parse.","description":null,"required":true}],"flux_type":"(data: bytes) => dynamic","is_option":false,"source_location":{"file":"experimental/dynamic/dynamic.flux","start":{"line":44,"column":1},"end":{"line":44,"column":45},"source":"builtin jsonParse : (data: bytes) => dynamic"},"examples":[],"metadata":{"introduced":"0.186.0","tags":"type-conversions"}}},"examples":[],"metadata":{"introduced":"0.185.0"}},{"path":"experimental/geo","name":"geo","headline":"Package geo provides tools for working with geotemporal data, such as\nfiltering and grouping by geographic location.","description":null,"members":{"ST_Contains":{"kind":"Function","name":"ST_Contains","headline":"ST_Contains returns boolean indicating whether the defined region contains a\nspecified GIS geometry.","description":null,"parameters":[{"name":"region","headline":"region: Region to test. Specify record properties for the shape.","description":null,"required":true},{"name":"geometry","headline":"geometry: GIS geometry to test. Can be either point or linestring geometry.","description":null,"required":true},{"name":"units","headline":"units: Record that defines the unit of measurement for distance.\n Default is the `geo.units` option.","description":null,"required":false}],"flux_type":"(geometry: A, region: B, ?units: {distance: string}) => bool where A: Record, B: Record","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":254,"column":1},"end":{"line":255,"column":65},"source":"ST_Contains = (region, geometry, units=units) =>\n stContains(region: region, geometry: geometry, units: units)"},"examples":[],"metadata":{"introduced":"0.78.0","tags":"geotemporal"}},"ST_DWithin":{"kind":"Function","name":"ST_DWithin","headline":"ST_DWithin tests if the specified region is within a defined distance from\nthe specified GIS geometry and returns `true` or `false`.","description":null,"parameters":[{"name":"region","headline":"region: Region to test. Specify record properties for the shape.","description":null,"required":true},{"name":"geometry","headline":"geometry: GIS geometry to test. Can be either point or linestring geometry.","description":null,"required":true},{"name":"distance","headline":"distance: Maximum distance allowed between the region and geometry.\n Define distance units with the `geo.units` option.","description":null,"required":true},{"name":"units","headline":"units: Record that defines the unit of measurement for distance.\n Default is the `geo.units` option.","description":null,"required":false}],"flux_type":"(distance: A, geometry: B, region: C, ?units: {distance: string}) => bool where A: Comparable + Equatable, B: Record, C: Record","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":287,"column":1},"end":{"line":288,"column":77},"source":"ST_DWithin = (region, geometry, distance, units=units) =>\n stDistance(region: region, geometry: geometry, units: units) <= distance"},"examples":[],"metadata":{"introduced":"0.78.0","tags":"geotemporal"}},"ST_Distance":{"kind":"Function","name":"ST_Distance","headline":"ST_Distance returns the distance from a given region to a specified GIS geometry.","description":null,"parameters":[{"name":"region","headline":"region: Region to test. Specify record properties for the shape.","description":null,"required":true},{"name":"geometry","headline":"geometry: GIS geometry to test. Can be either point or linestring geometry.","description":null,"required":true},{"name":"units","headline":"units: Record that defines the unit of measurement for distance.\n Default is the `geo.units` option.","description":null,"required":false}],"flux_type":"(geometry: A, region: B, ?units: {distance: string}) => float where A: Record, B: Record","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":269,"column":1},"end":{"line":270,"column":65},"source":"ST_Distance = (region, geometry, units=units) =>\n stDistance(region: region, geometry: geometry, units: units)"},"examples":[],"metadata":{"introduced":"0.78.0","tags":"geotemporal"}},"ST_Intersects":{"kind":"Function","name":"ST_Intersects","headline":"ST_Intersects tests if the specified GIS geometry intersects with the\nspecified region and returns `true` or `false`.","description":null,"parameters":[{"name":"region","headline":"region: Region to test. Specify record properties for the shape.","description":null,"required":true},{"name":"geometry","headline":"geometry: GIS geometry to test. Can be either point or linestring geometry.","description":null,"required":true},{"name":"units","headline":"units: Record that defines the unit of measurement for distance.\n Default is the `geo.units` option.","description":null,"required":false}],"flux_type":"(geometry: A, region: B, ?units: {distance: string}) => bool where A: Record, B: Record","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":303,"column":1},"end":{"line":304,"column":72},"source":"ST_Intersects = (region, geometry, units=units) =>\n stDistance(region: region, geometry: geometry, units: units) <= 0.0"},"examples":[],"metadata":{"introduced":"0.78.0","tags":"geotemporal"}},"ST_Length":{"kind":"Function","name":"ST_Length","headline":"ST_Length returns the [spherical length or distance](https://mathworld.wolfram.com/SphericalDistance.html)\nof the specified GIS geometry.","description":null,"parameters":[{"name":"geometry","headline":"geometry: GIS geometry to test. Can be either point or linestring geometry.\n Point geometry will always return `0.0`.","description":null,"required":true},{"name":"units","headline":"units: Record that defines the unit of measurement for distance.","description":null,"required":false}],"flux_type":"(geometry: A, ?units: {distance: string}) => float where A: Record","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":318,"column":1},"end":{"line":318,"column":82},"source":"ST_Length = (geometry, units=units) => stLength(geometry: geometry, units: units)"},"examples":[],"metadata":{"introduced":"0.78.0","tags":"geotemporal"}},"ST_LineString":{"kind":"Function","name":"ST_LineString","headline":"ST_LineString converts a series of geographic points into linestring.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with lon: C, lat: B}]) => stream[D] where D: Record","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":356,"column":1},"end":{"line":370,"column":60},"source":"ST_LineString = (tables=<-) =>\n tables\n |> reduce(\n fn: (r, accumulator) =>\n ({\n __linestring:\n accumulator.__linestring + (if accumulator.__count > 0 then \", \" else \"\")\n +\n string(v: r.lon) + \" \" + string(v: r.lat),\n __count: accumulator.__count + 1,\n }),\n identity: {__linestring: \"\", __count: 0},\n )\n |> drop(columns: [\"__count\"])\n |> rename(columns: {__linestring: \"st_linestring\"})"},"examples":[],"metadata":{"introduced":"0.78.0","tags":"geotemporal,transformations,aggregates"}},"asTracks":{"kind":"Function","name":"asTracks","headline":"asTracks groups rows into tracks (sequential, related data points).","description":null,"parameters":[{"name":"groupBy","headline":"groupBy: Columns to group by. These columns should uniquely identify each track.\n Default is `[\"id\",\"tid\"]`.","description":null,"required":false},{"name":"orderBy","headline":"orderBy: Columns to order results by. Default is `[\"_time\"]`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?groupBy: [string], ?orderBy: [string]) => stream[A] where A: Record","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":1008,"column":1},"end":{"line":1011,"column":34},"source":"asTracks = (tables=<-, groupBy=[\"id\", \"tid\"], orderBy=[\"_time\"]) =>\n tables\n |> group(columns: groupBy)\n |> sort(columns: orderBy)"},"examples":[],"metadata":{"tags":"transformations,geotemporal"}},"filterRows":{"kind":"Function","name":"filterRows","headline":"filterRows filters data by a specified geographic region with the option of strict filtering.","description":null,"parameters":[{"name":"region","headline":"region: Region containing the desired data points.","description":null,"required":true},{"name":"minSize","headline":"minSize: Minimum number of cells that cover the specified region.\n Default is `24`.","description":null,"required":false},{"name":"maxSize","headline":"maxSize: Maximum number of cells that cover the specified region.\n Default is `-1` (unlimited).","description":null,"required":false},{"name":"level","headline":"level: [S2 cell level](https://s2geometry.io/resources/s2cell_statistics.html)\n of grid cells. Default is `-1`.","description":null,"required":false},{"name":"s2cellIDLevel","headline":"s2cellIDLevel: [S2 cell level](https://s2geometry.io/resources/s2cell_statistics.html)\n used in the `s2_cell_id` tag. Default is `-1` (detects S2 cell level from the `s2_cell_id` tag).","description":null,"required":false},{"name":"strict","headline":"strict: Enable strict geographic data filtering. Default is `true`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[{B with s2_cell_id: string, lon: D, lat: C}],\n region: A,\n ?level: int,\n ?maxSize: int,\n ?minSize: int,\n ?s2cellIDLevel: int,\n ?strict: bool,\n) => stream[{B with s2_cell_id: string, lon: D, lat: C}] where A: Record","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":839,"column":1},"end":{"line":881,"column":6},"source":"filterRows = (\n tables=<-,\n region,\n minSize=24,\n maxSize=-1,\n level=-1,\n s2cellIDLevel=-1,\n strict=true,\n ) =>\n {\n _columns =\n tables\n |> columns(column: \"columns\")\n |> findColumn(column: \"columns\", fn: (key) => true)\n _rows =\n if contains(value: \"lat\", set: _columns) then\n tables\n |> gridFilter(\n region: region,\n minSize: minSize,\n maxSize: maxSize,\n level: level,\n s2cellIDLevel: s2cellIDLevel,\n )\n else\n tables\n |> gridFilter(\n region: region,\n minSize: minSize,\n maxSize: maxSize,\n level: level,\n s2cellIDLevel: s2cellIDLevel,\n )\n |> toRows()\n _result =\n if strict then\n _rows\n |> strictFilter(region)\n else\n _rows\n\n return _result\n }"},"examples":[],"metadata":{"tags":"transformations,filters,geotemporal"}},"getGrid":{"kind":"Function","name":"getGrid","headline":"getGrid calculates a grid or set of cell ID tokens for a specified region.","description":null,"parameters":[{"name":"region","headline":"region: Region used to return S2 cell ID tokens.\n Specify record properties for the region shape.","description":null,"required":true},{"name":"minSize","headline":"minSize: Minimum number of cells that cover the specified region.","description":null,"required":false},{"name":"maxSize","headline":"maxSize: Minimum number of cells that cover the specified region.","description":null,"required":false},{"name":"level","headline":"level: S2 cell level of grid cells.","description":null,"required":false},{"name":"maxLevel","headline":"maxLevel: Maximumn S2 cell level of grid cells.","description":null,"required":false},{"name":"units","headline":"units: Record that defines the unit of measurement for distance.","description":null,"required":true}],"flux_type":"(\n region: A,\n units: {distance: string},\n ?level: int,\n ?maxLevel: int,\n ?maxSize: int,\n ?minSize: int,\n) => {set: [string], level: int} where A: Record","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":386,"column":1},"end":{"line":395,"column":14},"source":"builtin getGrid : (\n region: T,\n ?minSize: int,\n ?maxSize: int,\n ?level: int,\n ?maxLevel: int,\n units: {distance: string},\n ) => {level: int, set: [string]}\n where\n T: Record"},"examples":[],"metadata":null},"getLevel":{"kind":"Function","name":"getLevel","headline":"getLevel returns the S2 cell level of specified cell ID token.","description":null,"parameters":[{"name":"token","headline":"token: S2 cell ID token.","description":null,"required":true}],"flux_type":"(token: string) => int","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":415,"column":1},"end":{"line":415,"column":42},"source":"builtin getLevel : (token: string) => int"},"examples":[],"metadata":{"tags":"geotemporal"}},"gridFilter":{"kind":"Function","name":"gridFilter","headline":"gridFilter filters data by a specified geographic region.","description":null,"parameters":[{"name":"region","headline":"region: Region containing the desired data points.","description":null,"required":true},{"name":"minSize","headline":"minSize: Minimum number of cells that cover the specified region.\n Default is `24`.","description":null,"required":false},{"name":"maxSize","headline":"maxSize: Maximum number of cells that cover the specified region.\n Default is `-1` (unlimited).","description":null,"required":false},{"name":"level","headline":"level: [S2 cell level](https://s2geometry.io/resources/s2cell_statistics.html)\n of grid cells. Default is `-1`.","description":null,"required":false},{"name":"s2cellIDLevel","headline":"s2cellIDLevel: [S2 cell level](https://s2geometry.io/resources/s2cell_statistics.html)\n used in the `s2_cell_id` tag. Default is `-1` (detects S2 cell level from the S2 cell ID token).","description":null,"required":false},{"name":"units","headline":"units: Record that defines the unit of measurement for distance.\n Default is the `geo.units` option.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[{B with s2_cell_id: string}],\n region: A,\n ?level: int,\n ?maxSize: int,\n ?minSize: int,\n ?s2cellIDLevel: int,\n ?units: {distance: string},\n) => stream[{B with s2_cell_id: string}] where A: Record","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":677,"column":1},"end":{"line":715,"column":6},"source":"gridFilter = (\n tables=<-,\n region,\n minSize=24,\n maxSize=-1,\n level=-1,\n s2cellIDLevel=-1,\n units=units,\n ) =>\n {\n _s2cellIDLevel =\n if s2cellIDLevel == -1 then\n tables\n |> _detectLevel()\n else\n s2cellIDLevel\n _grid =\n getGrid(\n region: region,\n minSize: minSize,\n maxSize: maxSize,\n level: level,\n maxLevel: _s2cellIDLevel,\n units: units,\n )\n\n return\n tables\n |> filter(\n fn: (r) =>\n if _grid.level == _s2cellIDLevel then\n contains(value: r.s2_cell_id, set: _grid.set)\n else\n contains(\n value: s2CellIDToken(token: r.s2_cell_id, level: _grid.level),\n set: _grid.set,\n ),\n )\n }"},"examples":[],"metadata":{"tags":"transformations,filters,geotemporal"}},"groupByArea":{"kind":"Function","name":"groupByArea","headline":"groupByArea groups rows by geographic area.","description":null,"parameters":[{"name":"newColumn","headline":"newColumn: Name of the new column for the unique identifier for each geographic area.","description":null,"required":true},{"name":"level","headline":"level: [S2 Cell level](https://s2geometry.io/resources/s2cell_statistics.html)\n used to determine the size of each geographic area.","description":null,"required":true},{"name":"s2cellIDLevel","headline":"s2cellIDLevel: [S2 Cell level](https://s2geometry.io/resources/s2cell_statistics.html)\n used in the `s2_cell_id` tag. Default is `-1` (detects S2 cell level from the `s2_cell_id` tag).","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[{A with s2_cell_id: string, lon: float, lat: float}],\n level: int,\n newColumn: string,\n ?s2cellIDLevel: int,\n) => stream[B] where B: Record","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":924,"column":1},"end":{"line":948,"column":2},"source":"groupByArea = (tables=<-, newColumn, level, s2cellIDLevel=-1) => {\n _s2cellIDLevel =\n if s2cellIDLevel == -1 then\n tables\n |> _detectLevel()\n else\n s2cellIDLevel\n _prepared =\n if level == _s2cellIDLevel then\n tables\n |> duplicate(column: \"s2_cell_id\", as: newColumn)\n else\n tables\n |> map(\n fn: (r) =>\n ({r with _s2_cell_id_xxx:\n s2CellIDToken(point: {lat: r.lat, lon: r.lon}, level: level),\n }),\n )\n |> rename(columns: {_s2_cell_id_xxx: newColumn})\n\n return\n _prepared\n |> group(columns: [newColumn])\n}"},"examples":[],"metadata":{"tags":"transformations,geotemporal"}},"s2CellIDToken":{"kind":"Function","name":"s2CellIDToken","headline":"s2CellIDToken returns and S2 cell ID token for given cell or point at a\nspecified S2 cell level.","description":null,"parameters":[{"name":"token","headline":"token: S2 cell ID token to update.","description":null,"required":false},{"name":"point","headline":"point: Record with `lat` and `lon` properties that specify the latitude and\n longitude in decimal degrees (WGS 84) of a point.","description":null,"required":false},{"name":"level","headline":"level: S2 cell level to use when generating the S2 cell ID token.","description":null,"required":true}],"flux_type":"(level: int, ?point: {lon: float, lat: float}, ?token: string) => string","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":477,"column":1},"end":{"line":477,"column":97},"source":"builtin s2CellIDToken : (?token: string, ?point: {lat: float, lon: float}, level: int) => string"},"examples":[],"metadata":{"introduced":"0.64.0","tags":"geotemporal"}},"s2CellLatLon":{"kind":"Function","name":"s2CellLatLon","headline":"s2CellLatLon returns the latitude and longitude of the center of an S2 cell.","description":null,"parameters":[{"name":"token","headline":"token: S2 cell ID token.","description":null,"required":true}],"flux_type":"(token: string) => {lon: float, lat: float}","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":498,"column":1},"end":{"line":498,"column":67},"source":"builtin s2CellLatLon : (token: string) => {lat: float, lon: float}"},"examples":[],"metadata":{"introduced":"0.78.0","tags":"geotemporal"}},"shapeData":{"kind":"Function","name":"shapeData","headline":"shapeData renames existing latitude and longitude fields to **lat** and **lon**\nand adds an **s2\\_cell\\_id** tag.","description":null,"parameters":[{"name":"latField","headline":"latField: Name of the existing field that contains the latitude value in decimal degrees (WGS 84).","description":null,"required":true},{"name":"lonField","headline":"lonField: Name of the existing field that contains the longitude value in decimal degrees (WGS 84).","description":null,"required":true},{"name":"level","headline":"level: [S2 cell level](https://s2geometry.io/resources/s2cell_statistics.html)\n to use when generating the S2 cell ID token.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[{C with _field: string}],\n latField: A,\n level: int,\n lonField: B,\n) => stream[{D with s2_cell_id: string, lon: float, lat: float}] where A: Equatable, B: Equatable","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":599,"column":1},"end":{"line":617,"column":71},"source":"shapeData = (tables=<-, latField, lonField, level) =>\n tables\n |> map(\n fn: (r) =>\n ({r with _field:\n if r._field == latField then\n \"lat\"\n else if r._field == lonField then\n \"lon\"\n else\n r._field,\n }),\n )\n |> toRows()\n |> map(\n fn: (r) =>\n ({r with s2_cell_id: s2CellIDToken(point: {lat: r.lat, lon: r.lon}, level: level)}),\n )\n |> experimental.group(columns: [\"s2_cell_id\"], mode: \"extend\")"},"examples":[],"metadata":null},"stContains":{"kind":"Function","name":"stContains","headline":"stContains returns boolean indicating whether the defined region contains a specified GIS geometry.","description":null,"parameters":[{"name":"region","headline":"region: Region to test. Specify record properties for the shape.","description":null,"required":true},{"name":"geometry","headline":"geometry: GIS geometry to test. Can be either point or linestring geometry.","description":null,"required":true},{"name":"units","headline":"units: Record that defines the unit of measurement for distance.","description":null,"required":true}],"flux_type":"(geometry: A, region: B, units: {distance: string}) => bool where A: Record, B: Record","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":202,"column":1},"end":{"line":205,"column":14},"source":"builtin stContains : (region: A, geometry: B, units: {distance: string}) => bool\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.78.0","tags":"geotemporal"}},"stDistance":{"kind":"Function","name":"stDistance","headline":"stDistance returns the distance from a given region to a specified GIS geometry.","description":null,"parameters":[{"name":"region","headline":"region: Region to test. Specify record properties for the shape.","description":null,"required":true},{"name":"geometry","headline":"geometry: GIS geometry to test. Can be either point or linestring geometry.","description":null,"required":true},{"name":"units","headline":"units: Record that defines the unit of measurement for distance.","description":null,"required":true}],"flux_type":"(geometry: A, region: B, units: {distance: string}) => float where A: Record, B: Record","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":220,"column":1},"end":{"line":223,"column":14},"source":"builtin stDistance : (region: A, geometry: B, units: {distance: string}) => float\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.78.0","tags":"geotemporal"}},"stLength":{"kind":"Function","name":"stLength","headline":"stLength returns the [spherical length or distance](https://mathworld.wolfram.com/SphericalDistance.html)\nof the specified GIS geometry.","description":null,"parameters":[{"name":"geometry","headline":"geometry: GIS geometry to test. Can be either point or linestring geometry.\n Point geometry will always return `0.0`.","description":null,"required":true},{"name":"units","headline":"units: Record that defines the unit of measurement for distance.","description":null,"required":true}],"flux_type":"(geometry: A, units: {distance: string}) => float where A: Record","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":239,"column":1},"end":{"line":239,"column":85},"source":"builtin stLength : (geometry: A, units: {distance: string}) => float where A: Record"},"examples":[],"metadata":{"introduced":"0.78.0","tags":"geotemporal"}},"strictFilter":{"kind":"Function","name":"strictFilter","headline":"strictFilter filters data by latitude and longitude in a specified region.","description":null,"parameters":[{"name":"region","headline":"region: Region containing the desired data points.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{B with lon: D, lat: C}], region: A) => stream[{B with lon: D, lat: C}] where A: Record","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":756,"column":1},"end":{"line":758,"column":94},"source":"strictFilter = (tables=<-, region) =>\n tables\n |> filter(fn: (r) => ST_Contains(region: region, geometry: {lat: r.lat, lon: r.lon}))"},"examples":[],"metadata":{"tags":"transformations,filters,geotemporal"}},"toRows":{"kind":"Function","name":"toRows","headline":"toRows pivots fields into columns based on time.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A]) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":548,"column":1},"end":{"line":550,"column":29},"source":"toRows = (tables=<-) =>\n tables\n |> v1.fieldsAsCols()"},"examples":[],"metadata":{"tags":"transformations,geotemporal"}},"totalDistance":{"kind":"Function","name":"totalDistance","headline":"totalDistance calculates the total distance covered by subsequent points\nin each input table.","description":null,"parameters":[{"name":"outputColumn","headline":"outputColumn: Total distance output column. Default is `_value`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{B with lon: float, lat: float}], ?outputColumn: A) => stream[C] where C: Record","is_option":false,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":1081,"column":1},"end":{"line":1106,"column":58},"source":"totalDistance = (tables=<-, outputColumn=\"_value\") =>\n tables\n |> reduce(\n identity: {index: 0, lat: 0.0, lon: 0.0, totalDistance: 0.0},\n fn: (r, accumulator) => {\n _lastPoint =\n if accumulator.index == 0 then\n {lat: r.lat, lon: r.lon}\n else\n {lat: accumulator.lat, lon: accumulator.lon}\n _currentPoint = {lat: r.lat, lon: r.lon}\n\n return {\n index: accumulator.index + 1,\n lat: r.lat,\n lon: r.lon,\n totalDistance:\n accumulator.totalDistance + ST_Distance(\n region: _lastPoint,\n geometry: _currentPoint,\n ),\n }\n },\n )\n |> drop(columns: [\"index\", \"lat\", \"lon\"])\n |> rename(columns: {totalDistance: outputColumn})"},"examples":[],"metadata":{"introduced":"0.192.0","tags":"transformations, geotemporal, aggregates"}},"units":{"kind":"Value","name":"units","headline":"units defines the unit of measurment used in geotemporal operations.","description":null,"flux_type":"{distance: string}","is_option":true,"source_location":{"file":"experimental/geo/geo.flux","start":{"line":187,"column":1},"end":{"line":187,"column":32},"source":"option units = {distance: \"km\"}"},"examples":[],"metadata":{"introduced":"0.78.0"}}},"examples":[],"metadata":{"introduced":"0.63.0","tags":"geotemporal"}},{"path":"experimental/http","name":"http","headline":"Package http provides functions for transferring data using HTTP protocol.","description":null,"members":{"get":{"kind":"Function","name":"get","headline":"get submits an HTTP GET request to the specified URL and returns the HTTP\nstatus code, response body, and response headers.","description":null,"parameters":[{"name":"url","headline":"url: URL to send the GET request to.","description":null,"required":true},{"name":"headers","headline":"headers: Headers to include with the GET request.","description":null,"required":false},{"name":"timeout","headline":"timeout: Timeout for the GET request. Default is `30s`.","description":null,"required":false}],"flux_type":"(url: string, ?headers: A, ?timeout: duration) => {statusCode: int, headers: B, body: bytes} where A: Record, B: Record","is_option":false,"source_location":{"file":"experimental/http/http.flux","start":{"line":41,"column":1},"end":{"line":48,"column":14},"source":"builtin get : (\n url: string,\n ?headers: A,\n ?timeout: duration,\n ) => {statusCode: int, body: bytes, headers: B}\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"tags":"http,inputs"}}},"examples":[],"metadata":{"deprecated":"0.173.0","introduced":"0.39.0","tags":"http"}},{"path":"experimental/http/requests","name":"requests","headline":"Package requests provides functions for transferring data using the HTTP protocol.","description":null,"members":{"defaultConfig":{"kind":"Value","name":"defaultConfig","headline":"defaultConfig is the global default for all http requests using the requests package.\nChanging this config will affect all other packages using the requests package.\nTo change the config for a single request, pass a new config directly into the corresponding function.","description":null,"flux_type":"{timeout: duration, insecureSkipVerify: bool}","is_option":true,"source_location":{"file":"experimental/http/requests/requests.flux","start":{"line":63,"column":1},"end":{"line":68,"column":2},"source":"option defaultConfig = {\n // Timeout on the request. If the timeout is zero no timeout is applied\n timeout: 0s,\n // insecureSkipVerify If true, TLS verification will not be performed. This is insecure.\n insecureSkipVerify: false,\n}"},"examples":[],"metadata":null},"do":{"kind":"Function","name":"do","headline":"do makes an http request.","description":null,"parameters":[{"name":"method","headline":"method: method of the http request.\n Supported methods: DELETE, GET, HEAD, PATCH, POST, PUT.","description":null,"required":true},{"name":"url","headline":"url: URL to request. This should not include any query parameters.","description":null,"required":true},{"name":"params","headline":"params: Set of key value pairs to add to the URL as query parameters.\n Query parameters will be URL encoded.\n All values for a key will be appended to the query.","description":null,"required":false},{"name":"headers","headline":"headers: Set of key values pairs to include on the request.","description":null,"required":false},{"name":"body","headline":"body: Data to send with the request.","description":null,"required":false},{"name":"config","headline":"config: Set of options to control how the request should be performed.","description":null,"required":false}],"flux_type":"(\n method: string,\n url: string,\n ?body: bytes,\n ?config: {A with timeout: duration, insecureSkipVerify: bool},\n ?headers: [string:string],\n ?params: [string:[string]],\n) => {statusCode: int, headers: [string:string], duration: duration, body: bytes}","is_option":false,"source_location":{"file":"experimental/http/requests/requests.flux","start":{"line":139,"column":1},"end":{"line":157,"column":10},"source":"do =\n // Note we do not redefine this function in terms of the promoted requests pacakge\n // so that the defaultConfig option is unique to this package.\n (\n method,\n url,\n params=[:],\n headers=[:],\n body=_emptyBody,\n config=defaultConfig,\n ) =>\n _do(\n method: method,\n url: url,\n params: params,\n headers: headers,\n body: body,\n config: config,\n )"},"examples":[],"metadata":{"tags":"http,inputs"}},"get":{"kind":"Function","name":"get","headline":"get makes a http GET request. This identical to calling `request.do(method: \"GET\", ...)`.","description":null,"parameters":[{"name":"url","headline":"url: URL to request. This should not include any query parameters.","description":null,"required":true},{"name":"params","headline":"params: Set of key value pairs to add to the URL as query parameters.\n Query parameters will be URL encoded.\n All values for a key will be appended to the query.","description":null,"required":false},{"name":"headers","headline":"headers: Set of key values pairs to include on the request.","description":null,"required":false},{"name":"body","headline":"body: Data to send with the request.","description":null,"required":false},{"name":"config","headline":"config: Set of options to control how the request should be performed.","description":null,"required":false}],"flux_type":"(\n url: string,\n ?body: bytes,\n ?config: {A with timeout: duration, insecureSkipVerify: bool},\n ?headers: [string:string],\n ?params: [string:[string]],\n) => {statusCode: int, headers: [string:string], duration: duration, body: bytes}","is_option":false,"source_location":{"file":"experimental/http/requests/requests.flux","start":{"line":273,"column":1},"end":{"line":290,"column":10},"source":"get =\n // Note we do not redefine this function in terms of the promoted requests pacakge\n // so that the defaultConfig option is unique to this package.\n (\n url,\n params=[:],\n headers=[:],\n body=_emptyBody,\n config=defaultConfig,\n ) =>\n do(\n method: \"GET\",\n url: url,\n params: params,\n headers: headers,\n body: body,\n config: config,\n )"},"examples":[],"metadata":{"tags":"http,inputs"}},"peek":{"kind":"Function","name":"peek","headline":"peek converts an HTTP response into a table for easy inspection.","description":null,"parameters":[{"name":"response","headline":"response: Response data from an HTTP request.","description":null,"required":true}],"flux_type":"(\n response: {A with statusCode: E, headers: D, duration: C, body: B},\n) => stream[{statusCode: E, headers: string, duration: int, body: string}]","is_option":false,"source_location":{"file":"experimental/http/requests/requests.flux","start":{"line":325,"column":1},"end":{"line":325,"column":21},"source":"peek = requests.peek"},"examples":[],"metadata":null},"post":{"kind":"Function","name":"post","headline":"post makes a http POST request. This identical to calling `request.do(method: \"POST\", ...)`.","description":null,"parameters":[{"name":"url","headline":"url: URL to request. This should not include any query parameters.","description":null,"required":true},{"name":"params","headline":"params: Set of key value pairs to add to the URL as query parameters.\n Query parameters will be URL encoded.\n All values for a key will be appended to the query.","description":null,"required":false},{"name":"headers","headline":"headers: Set of key values pairs to include on the request.","description":null,"required":false},{"name":"body","headline":"body: Data to send with the request.","description":null,"required":false},{"name":"config","headline":"config: Set of options to control how the request should be performed.","description":null,"required":false}],"flux_type":"(\n url: string,\n ?body: bytes,\n ?config: {A with timeout: duration, insecureSkipVerify: bool},\n ?headers: [string:string],\n ?params: [string:[string]],\n) => {statusCode: int, headers: [string:string], duration: duration, body: bytes}","is_option":false,"source_location":{"file":"experimental/http/requests/requests.flux","start":{"line":196,"column":1},"end":{"line":213,"column":10},"source":"post =\n // Note we do not redefine this function in terms of the promoted requests pacakge\n // so that the defaultConfig option is unique to this package.\n (\n url,\n params=[:],\n headers=[:],\n body=_emptyBody,\n config=defaultConfig,\n ) =>\n do(\n method: \"POST\",\n url: url,\n params: params,\n headers: headers,\n body: body,\n config: config,\n )"},"examples":[],"metadata":{"tags":"http,inputs"}}},"examples":[],"metadata":{"deprecated":"0.173.0","introduced":"0.152.0","tags":"http"}},{"path":"experimental/influxdb","name":"influxdb","headline":"Package influxdb provides tools for working with the InfluxDB API.","description":null,"members":{"api":{"kind":"Function","name":"api","headline":"api submits an HTTP request to the specified InfluxDB API path and returns a\nrecord containing the HTTP status code, response headers, and the response body.","description":null,"parameters":[{"name":"method","headline":"method: HTTP request method.","description":null,"required":true},{"name":"path","headline":"path: InfluxDB API path.","description":null,"required":true},{"name":"host","headline":"host: InfluxDB host URL _(Required when executed outside of InfluxDB)_.\n Default is `\"\"`.","description":null,"required":false},{"name":"token","headline":"token: [InfluxDB API token](https://docs.influxdata.com/influxdb/cloud/security/tokens/)\n _(Required when executed outside of InfluxDB)_.\n Default is `\"\"`.","description":null,"required":false},{"name":"headers","headline":"headers: HTTP request headers.","description":null,"required":false},{"name":"query","headline":"query: URL query parameters.","description":null,"required":false},{"name":"timeout","headline":"timeout: HTTP request timeout. Default is `30s`.","description":null,"required":false},{"name":"body","headline":"body: HTTP request body as bytes.","description":null,"required":false}],"flux_type":"(\n method: string,\n path: string,\n ?body: bytes,\n ?headers: [string:string],\n ?host: string,\n ?query: [string:string],\n ?timeout: duration,\n ?token: string,\n) => {statusCode: int, headers: [string:string], body: bytes}","is_option":false,"source_location":{"file":"experimental/influxdb/influxdb.flux","start":{"line":66,"column":1},"end":{"line":75,"column":66},"source":"builtin api : (\n method: string,\n path: string,\n ?host: string,\n ?token: string,\n ?body: bytes,\n ?headers: [string:string],\n ?query: [string:string],\n ?timeout: duration,\n ) => {statusCode: int, body: bytes, headers: [string:string]}"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.114.0"}},{"path":"experimental/iox","name":"iox","headline":"Package iox provides functions for querying data from IOx.","description":null,"members":{"from":{"kind":"Function","name":"from","headline":"from reads from the selected bucket and measurement in an IOx storage node.","description":null,"parameters":[{"name":"bucket","headline":"bucket: IOx bucket to read data from.","description":null,"required":true},{"name":"measurement","headline":"measurement: Measurement to read data from.","description":null,"required":true}],"flux_type":"(bucket: string, measurement: string) => stream[{A with _time: time}] where A: Record","is_option":false,"source_location":{"file":"experimental/iox/iox.flux","start":{"line":34,"column":1},"end":{"line":34,"column":101},"source":"builtin from : (bucket: string, measurement: string) => stream[{A with _time: time}] where A: Record"},"examples":[],"metadata":{"tags":"inputs"}},"sql":{"kind":"Function","name":"sql","headline":"sql executes an SQL query against a bucket in an IOx storage node.","description":null,"parameters":[{"name":"bucket","headline":"bucket: IOx bucket to read data from.","description":null,"required":true},{"name":"query","headline":"query: SQL query to execute.","description":null,"required":true}],"flux_type":"(bucket: string, query: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"experimental/iox/iox.flux","start":{"line":56,"column":1},"end":{"line":56,"column":75},"source":"builtin sql : (bucket: string, query: string) => stream[A] where A: Record"},"examples":[],"metadata":{"introduced":"0.186.0","tags":"inputs"}},"sqlInterval":{"kind":"Function","name":"sqlInterval","headline":"sqlInterval converts a duration value to a SQL interval string.","description":null,"parameters":[{"name":"d","headline":"d: Duration value to convert to SQL interval string.","description":null,"required":true}],"flux_type":"(d: A) => string","is_option":false,"source_location":{"file":"experimental/iox/iox.flux","start":{"line":96,"column":1},"end":{"line":113,"column":2},"source":"sqlInterval = (d) => {\n _durationString = string(v: d)\n _pipeRegex = (v=<-, r, t) => regexp.replaceAllString(v: v, r: r, t: t)\n _intervalString =\n _pipeRegex(v: _durationString, r: /([^\\d]+)/, t: \" $1 \")\n |> _pipeRegex(r: / ns /, t: \" nanoseconds \")\n |> _pipeRegex(r: / us /, t: \" microseconds \")\n |> _pipeRegex(r: / ms /, t: \" milliseconds \")\n |> _pipeRegex(r: / s /, t: \" seconds \")\n |> _pipeRegex(r: / m /, t: \" minutes \")\n |> _pipeRegex(r: / h /, t: \" hours \")\n |> _pipeRegex(r: / d /, t: \" days \")\n |> _pipeRegex(r: / w /, t: \" weeks \")\n |> _pipeRegex(r: / mo /, t: \" months \")\n |> _pipeRegex(r: / y /, t: \" years \")\n\n return strings.trimSpace(v: _intervalString)\n}"},"examples":[],"metadata":{"introduced":"0.192.0","tags":"sql, type-conversions"}}},"examples":[],"metadata":{"introduced":"0.152.0"}},{"path":"experimental/json","name":"json","headline":"Package json provides tools for working with JSON.","description":null,"members":{"parse":{"kind":"Function","name":"parse","headline":"parse takes JSON data as bytes and returns a value.","description":null,"parameters":[{"name":"data","headline":"data: JSON data (as bytes) to parse.","description":null,"required":true}],"flux_type":"(data: bytes) => A","is_option":false,"source_location":{"file":"experimental/json/json.flux","start":{"line":136,"column":1},"end":{"line":136,"column":35},"source":"builtin parse : (data: bytes) => A"},"examples":[],"metadata":{"tags":"type-conversions"}}},"examples":[],"metadata":{"introduced":"0.69.0","tags":"json"}},{"path":"experimental/mqtt","name":"mqtt","headline":"Package mqtt provides tools for working with Message Queuing Telemetry Transport (MQTT) protocol.","description":null,"members":{"publish":{"kind":"Function","name":"publish","headline":"publish sends data to an MQTT broker using MQTT protocol.","description":null,"parameters":[{"name":"broker","headline":"broker: MQTT broker connection string.","description":null,"required":true},{"name":"topic","headline":"topic: MQTT topic to send data to.","description":null,"required":true},{"name":"message","headline":"message: Message to send to the MQTT broker.","description":null,"required":true},{"name":"qos","headline":"qos: MQTT Quality of Service (QoS) level. Values range from `[0-2]`.\n Default is `0`.","description":null,"required":false},{"name":"retain","headline":"retain: MQTT retain flag. Default is `false`.","description":null,"required":false},{"name":"clientid","headline":"clientid: MQTT client ID.","description":null,"required":false},{"name":"username","headline":"username: Username to send to the MQTT broker.","description":null,"required":false},{"name":"password","headline":"password: Password to send to the MQTT broker.","description":null,"required":false},{"name":"timeout","headline":"timeout: MQTT connection timeout. Default is `1s`.","description":null,"required":false}],"flux_type":"(\n broker: string,\n message: string,\n topic: string,\n ?clientid: string,\n ?password: string,\n ?qos: int,\n ?retain: bool,\n ?timeout: duration,\n ?username: string,\n) => bool","is_option":false,"source_location":{"file":"experimental/mqtt/mqtt.flux","start":{"line":124,"column":1},"end":{"line":134,"column":14},"source":"builtin publish : (\n broker: string,\n topic: string,\n message: string,\n ?qos: int,\n ?retain: bool,\n ?clientid: string,\n ?username: string,\n ?password: string,\n ?timeout: duration,\n ) => bool"},"examples":[],"metadata":{"introduced":"0.133.0","tags":"mqtt"}},"to":{"kind":"Function","name":"to","headline":"to outputs data from a stream of tables to an MQTT broker using MQTT protocol.","description":null,"parameters":[{"name":"broker","headline":"broker: MQTT broker connection string.","description":null,"required":true},{"name":"topic","headline":"topic: MQTT topic to send data to.","description":null,"required":false},{"name":"qos","headline":"qos: MQTT Quality of Service (QoS) level. Values range from `[0-2]`. Default is `0`.","description":null,"required":false},{"name":"retain","headline":"retain: MQTT retain flag. Default is `false`.","description":null,"required":false},{"name":"clientid","headline":"clientid: MQTT client ID.","description":null,"required":false},{"name":"username","headline":"username: Username to send to the MQTT broker.","description":null,"required":false},{"name":"password","headline":"password: Password to send to the MQTT broker.\n Password is only required if the broker requires authentication.\n If you provide a password, you must provide a username.","description":null,"required":false},{"name":"name","headline":"name: Name for the MQTT message.","description":null,"required":false},{"name":"timeout","headline":"timeout: MQTT connection timeout. Default is `1s`.","description":null,"required":false},{"name":"timeColumn","headline":"timeColumn: Column to use as time values in the output line protocol.\n Default is `\"_time\"`.","description":null,"required":false},{"name":"tagColumns","headline":"tagColumns: Columns to use as tag sets in the output line protocol.\n Default is `[]`.","description":null,"required":false},{"name":"valueColumns","headline":"valueColumns: Columns to use as field values in the output line protocol.\n Default is `[\"_value\"]`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n broker: string,\n ?clientid: string,\n ?name: string,\n ?password: string,\n ?qos: int,\n ?retain: bool,\n ?tagColumns: [string],\n ?timeColumn: string,\n ?timeout: duration,\n ?topic: string,\n ?username: string,\n ?valueColumns: [string],\n) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"experimental/mqtt/mqtt.flux","start":{"line":56,"column":1},"end":{"line":73,"column":14},"source":"builtin to : (\n <-tables: stream[A],\n broker: string,\n ?topic: string,\n ?qos: int,\n ?retain: bool,\n ?clientid: string,\n ?username: string,\n ?password: string,\n ?name: string,\n ?timeout: duration,\n ?timeColumn: string,\n ?tagColumns: [string],\n ?valueColumns: [string],\n ) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"tags":"mqtt,outputs"}}},"examples":[],"metadata":{"introduced":"0.40.0","tags":"mqtt"}},{"path":"experimental/oee","name":"oee","headline":"Package oee provides functions for calculating overall equipment effectiveness (OEE).","description":null,"members":{"APQ":{"kind":"Function","name":"APQ","headline":"APQ computes availability, performance, quality (APQ) and overall equipment\neffectiveness (OEE) in producing parts.","description":null,"parameters":[{"name":"runningState","headline":"runningState: State value that represents a running state.","description":null,"required":true},{"name":"plannedTime","headline":"plannedTime: Total time that equipment is expected to produce parts.","description":null,"required":true},{"name":"idealCycleTime","headline":"idealCycleTime: Ideal minimum time to produce one part.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[D],\n idealCycleTime: A,\n plannedTime: B,\n runningState: C,\n) => stream[{\n E with\n runTime: G,\n quality: float,\n performance: float,\n oee: float,\n availability: float,\n _time: F,\n _stop: F,\n}] where C: Equatable, D: Record","is_option":false,"source_location":{"file":"experimental/oee/oee.flux","start":{"line":210,"column":1},"end":{"line":217,"column":6},"source":"APQ = (tables=<-, runningState, plannedTime, idealCycleTime) =>\n computeAPQ(\n productionEvents: tables,\n partEvents: tables,\n runningState: runningState,\n plannedTime: plannedTime,\n idealCycleTime: idealCycleTime,\n )"},"examples":[],"metadata":null},"computeAPQ":{"kind":"Function","name":"computeAPQ","headline":"computeAPQ computes availability, performance, and quality (APQ)\nand overall equipment effectiveness (OEE) using two separate input streams:\n**production events** and **part events**.","description":null,"parameters":[{"name":"productionEvents","headline":"productionEvents: Production events stream that contains the production\n state or start and stop events.","description":null,"required":true},{"name":"partEvents","headline":"partEvents: Part events that contains the running totals of parts produced and\n parts that do not meet quality standards.","description":null,"required":true},{"name":"runningState","headline":"runningState: State value that represents a running state.","description":null,"required":true},{"name":"plannedTime","headline":"plannedTime: Total time that equipment is expected to produce parts.","description":null,"required":true},{"name":"idealCycleTime","headline":"idealCycleTime: Ideal minimum time to produce one part.","description":null,"required":true}],"flux_type":"(\n idealCycleTime: A,\n partEvents: stream[B],\n plannedTime: C,\n productionEvents: stream[D],\n runningState: E,\n) => stream[{\n F with\n runTime: H,\n quality: float,\n performance: float,\n oee: float,\n availability: float,\n _time: G,\n _stop: G,\n}] where B: Record, D: Record, E: Equatable","is_option":false,"source_location":{"file":"experimental/oee/oee.flux","start":{"line":94,"column":1},"end":{"line":155,"column":6},"source":"computeAPQ = (\n productionEvents,\n partEvents,\n runningState,\n plannedTime,\n idealCycleTime,\n ) =>\n {\n availability =\n productionEvents\n |> events.duration(unit: 1ns, columnName: \"runTime\")\n |> filter(fn: (r) => r.state == runningState)\n |> sum(column: \"runTime\")\n |> map(\n fn: (r) =>\n ({r with _time: r._stop,\n availability: float(v: r.runTime) / float(v: int(v: plannedTime)),\n }),\n )\n totalCount =\n partEvents\n |> difference(columns: [\"partCount\"], nonNegative: true)\n |> sum(column: \"partCount\")\n |> duplicate(column: \"_stop\", as: \"_time\")\n badCount =\n partEvents\n |> difference(columns: [\"badCount\"], nonNegative: true)\n |> sum(column: \"badCount\")\n |> duplicate(column: \"_stop\", as: \"_time\")\n performance =\n experimental.join(\n left: availability,\n right: totalCount,\n fn: (left, right) =>\n ({left with performance:\n float(v: right.partCount) * float(v: int(v: idealCycleTime)) / float(\n v: left.runTime,\n ),\n }),\n )\n quality =\n experimental.join(\n left: badCount,\n right: totalCount,\n fn: (left, right) =>\n ({left with quality:\n (float(v: right.partCount) - float(v: left.badCount)) / float(\n v: right.partCount,\n ),\n }),\n )\n\n return\n experimental.join(\n left: performance,\n right: quality,\n fn: (left, right) =>\n ({left with quality: right.quality,\n oee: left.availability * left.performance * right.quality,\n }),\n )\n }"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.112.0"}},{"path":"experimental/polyline","name":"polyline","headline":"Package polyline provides methods for polyline simplication, an efficient way of downsampling curves while retaining moments of variation throughout the path.","description":null,"members":{"rdp":{"kind":"Function","name":"rdp","headline":"rdp applies the Ramer Douglas Peucker (RDP) algorithm to input data to downsample curves composed\nof line segments into visually indistinguishable curves with fewer points.","description":null,"parameters":[{"name":"valColumn","headline":"valColumn: Column with Y axis values of the given curve. Default is `_value`.","description":null,"required":false},{"name":"timeColumn","headline":"timeColumn: Column with X axis values of the given curve. Default is `_time`.","description":null,"required":false},{"name":"epsilon","headline":"epsilon: Maximum tolerance value that determines the amount of compression.","description":null,"required":false},{"name":"retention","headline":"retention: Percentage of points to retain after downsampling.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n ?epsilon: float,\n ?retention: float,\n ?timeColumn: string,\n ?valColumn: string,\n) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"experimental/polyline/polyline.flux","start":{"line":71,"column":1},"end":{"line":80,"column":14},"source":"builtin rdp : (\n <-tables: stream[A],\n ?valColumn: string,\n ?timeColumn: string,\n ?epsilon: float,\n ?retention: float,\n ) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"tags":"transformations"}}},"examples":[],"metadata":{"introduced":"0.181.0"}},{"path":"experimental/prometheus","name":"prometheus","headline":"Package prometheus provides tools for working with\n[Prometheus-formatted metrics](https://prometheus.io/docs/instrumenting/exposition_formats/).","description":null,"members":{"histogramQuantile":{"kind":"Function","name":"histogramQuantile","headline":"histogramQuantile calculates a quantile on a set of Prometheus histogram values.","description":null,"parameters":[{"name":"quantile","headline":"quantile: Quantile to compute. Must be a float value between 0.0 and 1.0.","description":null,"required":true},{"name":"metricVersion","headline":"metricVersion: [Prometheus metric parsing format](https://docs.influxdata.com/influxdb/latest/reference/prometheus-metrics/)\n used to parse queried Prometheus data.\n Available versions are `1` and `2`.\n Default is `2`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false},{"name":"onNonmonotonic","headline":"onNonmonotonic: Describes behavior when counts are not monotonically increasing\n when sorted by upper bound. Default is `error`.","description":null,"required":false}],"flux_type":"(<-tables: stream[{B with le: D, _field: C}], quantile: float, ?metricVersion: A, ?onNonmonotonic: string) => stream[E] where A: Equatable, C: Equatable, E: Record","is_option":false,"source_location":{"file":"experimental/prometheus/prometheus.flux","start":{"line":83,"column":1},"end":{"line":112,"column":2},"source":"histogramQuantile = (tables=<-, quantile, metricVersion=2, onNonmonotonic=\"error\") => {\n _version2 = (onNonmonotonic) =>\n tables\n |> group(mode: \"except\", columns: [\"le\", \"_value\"])\n |> map(fn: (r) => ({r with le: float(v: r.le)}))\n |> universe.histogramQuantile(quantile: quantile, onNonmonotonic: onNonmonotonic)\n |> group(mode: \"except\", columns: [\"le\", \"_value\", \"_time\"])\n |> set(key: \"quantile\", value: string(v: quantile))\n |> experimental.group(columns: [\"quantile\"], mode: \"extend\")\n\n _version1 = (onNonmonotonic) =>\n tables\n |> filter(fn: (r) => r._field != \"sum\" and r._field != \"count\")\n |> map(fn: (r) => ({r with le: float(v: r._field)}))\n |> group(mode: \"except\", columns: [\"_field\", \"le\", \"_value\"])\n |> universe.histogramQuantile(quantile: quantile, onNonmonotonic: onNonmonotonic)\n |> group(mode: \"except\", columns: [\"le\", \"_value\", \"_time\"])\n |> set(key: \"quantile\", value: string(v: quantile))\n |> experimental.group(columns: [\"quantile\"], mode: \"extend\")\n\n output =\n if metricVersion == 2 then\n _version2(onNonmonotonic)\n else if metricVersion == 1 then\n _version1(onNonmonotonic)\n else\n universe.die(msg: \"Invalid metricVersion. Available versions are 1 and 2.\")\n\n return output\n}"},"examples":[],"metadata":{"tags":"transformations,aggregates,prometheus"}},"scrape":{"kind":"Function","name":"scrape","headline":"scrape scrapes Prometheus metrics from an HTTP-accessible endpoint and returns\nthem as a stream of tables.","description":null,"parameters":[{"name":"url","headline":"url: URL to scrape Prometheus metrics from.","description":null,"required":true}],"flux_type":"(url: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"experimental/prometheus/prometheus.flux","start":{"line":33,"column":1},"end":{"line":33,"column":60},"source":"builtin scrape : (url: string) => stream[A] where A: Record"},"examples":[],"metadata":{"tags":"inputs,prometheus"}}},"examples":[],"metadata":{"introduced":"0.50.0","tags":"prometheus"}},{"path":"experimental/query","name":"query","headline":"Package query provides functions meant to simplify common InfluxDB queries.","description":null,"members":{"filterFields":{"kind":"Function","name":"filterFields","headline":"filterFields filters input data by field.","description":null,"parameters":[{"name":"fields","headline":"fields: Fields to filter by. Default is `[]`.","description":null,"required":false},{"name":"table","headline":"table: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-table: stream[{B with _field: A}], ?fields: [A]) => stream[{B with _field: A}] where A: Nullable","is_option":false,"source_location":{"file":"experimental/query/from.flux","start":{"line":83,"column":1},"end":{"line":87,"column":75},"source":"filterFields = (table=<-, fields=[]) =>\n if length(arr: fields) == 0 then\n table\n else\n table |> filter(fn: (r) => contains(value: r._field, set: fields))"},"examples":[],"metadata":{"tags":"transformations,filters"}},"filterMeasurement":{"kind":"Function","name":"filterMeasurement","headline":"filterMeasurement filters input data by measurement.","description":null,"parameters":[{"name":"measurement","headline":"measurement: InfluxDB measurement name to filter by.","description":null,"required":true},{"name":"table","headline":"table: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-table: stream[{B with _measurement: C}], measurement: A) => stream[{B with _measurement: C}] where A: Equatable, C: Equatable","is_option":false,"source_location":{"file":"experimental/query/from.flux","start":{"line":62,"column":1},"end":{"line":63,"column":62},"source":"filterMeasurement = (table=<-, measurement) =>\n table |> filter(fn: (r) => r._measurement == measurement)"},"examples":[],"metadata":{"tags":"transformations,filters"}},"fromRange":{"kind":"Function","name":"fromRange","headline":"fromRange returns all data from a specified bucket within given time bounds.","description":null,"parameters":[{"name":"bucket","headline":"bucket: InfluxDB bucket name.","description":null,"required":true},{"name":"start","headline":"start: Earliest time to include in results.","description":null,"required":true},{"name":"stop","headline":"stop: Latest time to include in results. Default is `now()`.","description":null,"required":false}],"flux_type":"(\n bucket: string,\n start: A,\n ?stop: B,\n) => stream[{\n C with\n _value: D,\n _time: time,\n _stop: time,\n _start: time,\n _measurement: string,\n _field: string,\n}]","is_option":false,"source_location":{"file":"experimental/query/from.flux","start":{"line":40,"column":1},"end":{"line":42,"column":43},"source":"fromRange = (bucket, start, stop=now()) =>\n from(bucket: bucket)\n |> range(start: start, stop: stop)"},"examples":[],"metadata":{"tags":"transformations,filters"}},"inBucket":{"kind":"Function","name":"inBucket","headline":"inBucket queries data from a specified InfluxDB bucket within given time bounds,\nfilters data by measurement, field, and optional predicate expressions.","description":null,"parameters":[{"name":"bucket","headline":"bucket: InfluxDB bucket name.","description":null,"required":true},{"name":"measurement","headline":"measurement: InfluxDB measurement name to filter by.","description":null,"required":true},{"name":"start","headline":"start: Earliest time to include in results.","description":null,"required":true},{"name":"stop","headline":"stop: Latest time to include in results. Default is `now()`.","description":null,"required":false},{"name":"fields","headline":"fields: Fields to filter by. Default is `[]`.","description":null,"required":false},{"name":"predicate","headline":"predicate: Predicate function that evaluates column values and returns `true` or `false`.\n Default is `(r) => true`.","description":null,"required":false}],"flux_type":"(\n bucket: string,\n measurement: A,\n start: B,\n ?fields: [string],\n ?predicate: (\n r: {\n C with\n _value: D,\n _time: time,\n _stop: time,\n _start: time,\n _measurement: string,\n _field: string,\n },\n ) => bool,\n ?stop: E,\n) => stream[{\n C with\n _value: D,\n _time: time,\n _stop: time,\n _start: time,\n _measurement: string,\n _field: string,\n}] where A: Equatable","is_option":false,"source_location":{"file":"experimental/query/from.flux","start":{"line":133,"column":1},"end":{"line":144,"column":32},"source":"inBucket = (\n bucket,\n measurement,\n start,\n stop=now(),\n fields=[],\n predicate=(r) => true,\n) =>\n fromRange(bucket: bucket, start: start, stop: stop)\n |> filterMeasurement(measurement)\n |> filter(fn: predicate)\n |> filterFields(fields)"},"examples":[],"metadata":{"tags":"inputs"}}},"examples":[],"metadata":{"introduced":"0.60.0"}},{"path":"experimental/record","name":"record","headline":"Package record provides tools for working with Flux records.","description":null,"members":{"any":{"kind":"Value","name":"any","headline":"any is a polymorphic record value that can be used as a default record value\nwhen input record property types are not known.","description":null,"flux_type":"A where A: Record","is_option":false,"source_location":{"file":"experimental/record/record.flux","start":{"line":17,"column":1},"end":{"line":17,"column":32},"source":"builtin any : A where A: Record"},"examples":[],"metadata":null},"get":{"kind":"Function","name":"get","headline":"get returns a value from a record by key name or a default value if the key\ndoesn’t exist in the record.","description":null,"parameters":[{"name":"r","headline":"r: Record to retrieve the value from.","description":null,"required":true},{"name":"key","headline":"key: Property key to retrieve.","description":null,"required":true},{"name":"default","headline":"default: Default value to return if the specified key does not exist in the record.","description":null,"required":true}],"flux_type":"(default: A, key: string, r: B) => A where B: Record","is_option":false,"source_location":{"file":"experimental/record/record.flux","start":{"line":47,"column":1},"end":{"line":47,"column":67},"source":"builtin get : (r: A, key: string, default: B) => B where A: Record"},"examples":[],"metadata":{"introduced":"0.134.0"}}},"examples":[],"metadata":null},{"path":"experimental/table","name":"table","headline":"Package table provides tools working with Flux tables.","description":null,"members":{"fill":{"kind":"Function","name":"fill","headline":"fill adds a single row to empty tables in a stream of tables.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A]) => stream[A] where A: Record","is_option":false,"source_location":{"file":"experimental/table/table.flux","start":{"line":33,"column":1},"end":{"line":33,"column":66},"source":"builtin fill : (<-tables: stream[A]) => stream[A] where A: Record"},"examples":[],"metadata":{"tags":"transformations,table"}}},"examples":[],"metadata":{"introduced":"0.115.0"}},{"path":"experimental/usage","name":"usage","headline":"Package usage provides tools for collecting usage and usage limit data from\n**InfluxDB Cloud**.","description":null,"members":{"from":{"kind":"Function","name":"from","headline":"from returns usage data from an **InfluxDB Cloud** organization.","description":null,"parameters":[{"name":"start","headline":"start: Earliest time to include in results.","description":null,"required":true},{"name":"stop","headline":"stop: Latest time to include in results.","description":null,"required":true},{"name":"host","headline":"host: [InfluxDB Cloud region URL](https://docs.influxdata.com/influxdb/cloud/reference/regions/).\n Default is `\"\"`.","description":null,"required":false},{"name":"orgID","headline":"orgID: InfluxDB Cloud organization ID. Default is `\"\"`.","description":null,"required":false},{"name":"token","headline":"token: InfluxDB Cloud [API token](https://docs.influxdata.com/influxdb/cloud/security/tokens/).\n Default is `\"\"`.","description":null,"required":false},{"name":"raw","headline":"raw: Return raw, high resolution usage data instead of downsampled usage data.\n Default is `false`.","description":null,"required":false}],"flux_type":"(\n start: A,\n stop: B,\n ?host: string,\n ?orgID: string,\n ?raw: C,\n ?token: string,\n) => stream[D] where D: Record","is_option":false,"source_location":{"file":"experimental/usage/usage.flux","start":{"line":178,"column":1},"end":{"line":207,"column":6},"source":"from = (\n start,\n stop,\n host=\"\",\n orgID=\"\",\n token=\"\",\n raw=false,\n ) =>\n {\n id = if orgID == \"\" then \"{orgID}\" else http.pathEscape(inputString: orgID)\n response =\n influxdb.api(\n method: \"get\",\n path: \"/api/v2/orgs/\" + id + \"/usage\",\n host: host,\n token: token,\n query: [\"start\": string(v: start), \"stop\": string(v: stop), \"raw\": string(v: raw)],\n )\n\n return\n if response.statusCode > 299 then\n die(\n msg:\n \"organization usage request returned status \" + string(\n v: response.statusCode,\n ) + \": \" + string(v: response.body),\n )\n else\n csv.from(csv: string(v: response.body))\n }"},"examples":[],"metadata":{"tags":"inputs"}},"limits":{"kind":"Function","name":"limits","headline":"limits returns a record containing usage limits for an **InfluxDB Cloud** organization.","description":null,"parameters":[{"name":"host","headline":"host: [InfluxDB Cloud region URL](https://docs.influxdata.com/influxdb/cloud/reference/regions/).\n Default is `\"\"`.","description":null,"required":false},{"name":"orgID","headline":"orgID: InfluxDB Cloud organization ID. Default is `\"\"`.","description":null,"required":false},{"name":"token","headline":"token: InfluxDB Cloud [API token](https://docs.influxdata.com/influxdb/cloud/security/tokens/).\n Default is `\"\"`.","description":null,"required":false}],"flux_type":"(?host: string, ?orgID: string, ?token: string) => A","is_option":false,"source_location":{"file":"experimental/usage/usage.flux","start":{"line":305,"column":1},"end":{"line":325,"column":2},"source":"limits = (host=\"\", orgID=\"\", token=\"\") => {\n id = if orgID == \"\" then \"{orgID}\" else http.pathEscape(inputString: orgID)\n response =\n influxdb.api(\n method: \"get\",\n path: \"/api/v2/orgs/\" + id + \"/limits\",\n host: host,\n token: token,\n )\n\n return\n if response.statusCode > 299 then\n die(\n msg:\n \"organization limits request returned status \" + string(v: response.statusCode)\n +\n \": \" + string(v: response.body),\n )\n else\n json.parse(data: response.body).limits\n}"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.114.0"}},{"path":"generate","name":"generate","headline":"Package generate provides functions for generating data.","description":null,"members":{"from":{"kind":"Function","name":"from","headline":"from generates data using the provided parameter values.","description":null,"parameters":[{"name":"count","headline":"count: Number of rows to generate.","description":null,"required":true},{"name":"fn","headline":"fn: Function used to generate values.","description":null,"required":true},{"name":"start","headline":"start: Beginning of the time range to generate values in.","description":null,"required":true},{"name":"stop","headline":"stop: End of the time range to generate values in.","description":null,"required":true}],"flux_type":"(count: int, fn: (n: int) => int, start: A, stop: A) => stream[{_value: int, _time: time, _stop: time, _start: time}] where A: Timeable","is_option":false,"source_location":{"file":"generate/generate.flux","start":{"line":37,"column":1},"end":{"line":44,"column":16},"source":"builtin from : (\n start: A,\n stop: A,\n count: int,\n fn: (n: int) => int,\n ) => stream[{_start: time, _stop: time, _time: time, _value: int}]\n where\n A: Timeable"},"examples":[],"metadata":{"tags":"inputs"}}},"examples":[],"metadata":{"introduced":"0.17.0","tags":"generate"}},{"path":"http","name":"http","headline":"Package http provides functions for transferring data using the HTTP protocol.","description":null,"members":{"basicAuth":{"kind":"Function","name":"basicAuth","headline":"basicAuth returns a Base64-encoded basic authentication header\nusing a specified username and password combination.","description":null,"parameters":[{"name":"u","headline":"u: Username to use in the basic authentication header.","description":null,"required":true},{"name":"p","headline":"p: Password to use in the basic authentication header.","description":null,"required":true}],"flux_type":"(p: string, u: string) => string","is_option":false,"source_location":{"file":"http/http.flux","start":{"line":79,"column":1},"end":{"line":79,"column":53},"source":"builtin basicAuth : (u: string, p: string) => string"},"examples":[],"metadata":{"introduced":"0.44.0"}},"endpoint":{"kind":"Function","name":"endpoint","headline":"endpoint iterates over input data and sends a single POST request per input row to\na specficied URL.","description":null,"parameters":[{"name":"url","headline":"url: URL to send the POST reqeust to.","description":null,"required":true}],"flux_type":"(\n url: string,\n) => (mapFn: (r: A) => {B with headers: C, data: bytes}) => (<-tables: stream[A]) => stream[{A with _sent: string}] where C: Record","is_option":false,"source_location":{"file":"http/http.flux","start":{"line":155,"column":1},"end":{"line":170,"column":74},"source":"endpoint = (url) =>\n (mapFn) =>\n (tables=<-) =>\n tables\n |> map(\n fn: (r) => {\n obj = mapFn(r: r)\n\n return {r with _sent:\n string(\n v: 200 == post(url: url, headers: obj.headers, data: obj.data),\n ),\n }\n },\n )\n |> experimental.group(mode: \"extend\", columns: [\"_sent\"])"},"examples":[],"metadata":{"tags":"notification endpoints"}},"pathEscape":{"kind":"Function","name":"pathEscape","headline":"pathEscape escapes special characters in a string (including `/`)\nand replaces non-ASCII characters with hexadecimal representations (`%XX`).","description":null,"parameters":[{"name":"inputString","headline":"inputString: String to escape.","description":null,"required":true}],"flux_type":"(inputString: string) => string","is_option":false,"source_location":{"file":"http/http.flux","start":{"line":114,"column":1},"end":{"line":114,"column":53},"source":"builtin pathEscape : (inputString: string) => string"},"examples":[],"metadata":{"introduced":"0.71.0"}},"post":{"kind":"Function","name":"post","headline":"post sends an HTTP POST request to the specified URL with headers and data\nand returns the HTTP status code.","description":null,"parameters":[{"name":"url","headline":"url: URL to send the POST request to.","description":null,"required":true},{"name":"headers","headline":"headers: Headers to include with the POST request.","description":null,"required":false},{"name":"data","headline":"data: Data body to include with the POST request.","description":null,"required":false}],"flux_type":"(url: string, ?data: bytes, ?headers: A) => int where A: Record","is_option":false,"source_location":{"file":"http/http.flux","start":{"line":50,"column":1},"end":{"line":50,"column":79},"source":"builtin post : (url: string, ?headers: A, ?data: bytes) => int where A: Record"},"examples":[],"metadata":{"introduced":"0.40.0","tags":"single notification"}}},"examples":[],"metadata":{"introduced":"0.39.0"}},{"path":"http/requests","name":"requests","headline":"Package requests provides functions for transferring data using the HTTP protocol.","description":null,"members":{"defaultConfig":{"kind":"Value","name":"defaultConfig","headline":"defaultConfig is the global default for all http requests using the requests package.\nChanging this config will affect all other packages using the requests package.\nTo change the config for a single request, pass a new config directly into the corresponding function.","description":null,"flux_type":"{timeout: duration, insecureSkipVerify: bool}","is_option":true,"source_location":{"file":"http/requests/requests.flux","start":{"line":55,"column":1},"end":{"line":60,"column":2},"source":"option defaultConfig = {\n // Timeout on the request. If the timeout is zero no timeout is applied\n timeout: 0s,\n // insecureSkipVerify If true, TLS verification will not be performed. This is insecure.\n insecureSkipVerify: false,\n}"},"examples":[],"metadata":null},"do":{"kind":"Function","name":"do","headline":"do makes an http request.","description":null,"parameters":[{"name":"method","headline":"method: method of the http request.\n Supported methods: DELETE, GET, HEAD, PATCH, POST, PUT.","description":null,"required":true},{"name":"url","headline":"url: URL to request. This should not include any query parameters.","description":null,"required":true},{"name":"params","headline":"params: Set of key value pairs to add to the URL as query parameters.\n Query parameters will be URL encoded.\n All values for a key will be appended to the query.","description":null,"required":false},{"name":"headers","headline":"headers: Set of key values pairs to include on the request.","description":null,"required":false},{"name":"body","headline":"body: Data to send with the request.","description":null,"required":false},{"name":"config","headline":"config: Set of options to control how the request should be performed.","description":null,"required":false}],"flux_type":"(\n method: string,\n url: string,\n ?body: bytes,\n ?config: {A with timeout: duration, insecureSkipVerify: bool},\n ?headers: [string:string],\n ?params: [string:[string]],\n) => {statusCode: int, headers: [string:string], duration: duration, body: bytes}","is_option":false,"source_location":{"file":"http/requests/requests.flux","start":{"line":136,"column":1},"end":{"line":151,"column":6},"source":"do = (\n method,\n url,\n params=[:],\n headers=[:],\n body=_emptyBody,\n config=defaultConfig,\n) =>\n _do(\n method: method,\n url: url,\n params: params,\n headers: headers,\n body: body,\n config: config,\n )"},"examples":[],"metadata":{"tags":"http,inputs"}},"get":{"kind":"Function","name":"get","headline":"get makes a http GET request. This identical to calling `request.do(method: \"GET\", ...)`.","description":null,"parameters":[{"name":"url","headline":"url: URL to request. This should not include any query parameters.","description":null,"required":true},{"name":"params","headline":"params: Set of key value pairs to add to the URL as query parameters.\n Query parameters will be URL encoded.\n All values for a key will be appended to the query.","description":null,"required":false},{"name":"headers","headline":"headers: Set of key values pairs to include on the request.","description":null,"required":false},{"name":"body","headline":"body: Data to send with the request.","description":null,"required":false},{"name":"config","headline":"config: Set of options to control how the request should be performed.","description":null,"required":false}],"flux_type":"(\n url: string,\n ?body: bytes,\n ?config: {A with timeout: duration, insecureSkipVerify: bool},\n ?headers: [string:string],\n ?params: [string:[string]],\n) => {statusCode: int, headers: [string:string], duration: duration, body: bytes}","is_option":false,"source_location":{"file":"http/requests/requests.flux","start":{"line":274,"column":1},"end":{"line":288,"column":6},"source":"get = (\n url,\n params=[:],\n headers=[:],\n body=_emptyBody,\n config=defaultConfig,\n) =>\n do(\n method: \"GET\",\n url: url,\n params: params,\n headers: headers,\n body: body,\n config: config,\n )"},"examples":[],"metadata":{"tags":"http,inputs"}},"peek":{"kind":"Function","name":"peek","headline":"peek converts an HTTP response into a table for easy inspection.","description":null,"parameters":[{"name":"response","headline":"response: Response data from an HTTP request.","description":null,"required":true}],"flux_type":"(\n response: {A with statusCode: E, headers: D, duration: C, body: B},\n) => stream[{statusCode: E, headers: string, duration: int, body: string}]","is_option":false,"source_location":{"file":"http/requests/requests.flux","start":{"line":321,"column":1},"end":{"line":331,"column":6},"source":"peek = (response) =>\n array.from(\n rows: [\n {\n statusCode: response.statusCode,\n body: string(v: response.body),\n headers: display(v: response.headers),\n duration: int(v: response.duration),\n },\n ],\n )"},"examples":[],"metadata":null},"post":{"kind":"Function","name":"post","headline":"post makes a http POST request. This identical to calling `request.do(method: \"POST\", ...)`.","description":null,"parameters":[{"name":"url","headline":"url: URL to request. This should not include any query parameters.","description":null,"required":true},{"name":"params","headline":"params: Set of key value pairs to add to the URL as query parameters.\n Query parameters will be URL encoded.\n All values for a key will be appended to the query.","description":null,"required":false},{"name":"headers","headline":"headers: Set of key values pairs to include on the request.","description":null,"required":false},{"name":"body","headline":"body: Data to send with the request.","description":null,"required":false},{"name":"config","headline":"config: Set of options to control how the request should be performed.","description":null,"required":false}],"flux_type":"(\n url: string,\n ?body: bytes,\n ?config: {A with timeout: duration, insecureSkipVerify: bool},\n ?headers: [string:string],\n ?params: [string:[string]],\n) => {statusCode: int, headers: [string:string], duration: duration, body: bytes}","is_option":false,"source_location":{"file":"http/requests/requests.flux","start":{"line":202,"column":1},"end":{"line":216,"column":6},"source":"post = (\n url,\n params=[:],\n headers=[:],\n body=_emptyBody,\n config=defaultConfig,\n) =>\n do(\n method: \"POST\",\n url: url,\n params: params,\n headers: headers,\n body: body,\n config: config,\n )"},"examples":[],"metadata":{"tags":"http,inputs"}}},"examples":[],"metadata":{"introduced":"0.173.0","tags":"http"}},{"path":"influxdata/influxdb","name":"influxdb","headline":"Package influxdb provides functions designed for working with InfluxDB and\nanalyzing InfluxDB metadata.","description":null,"members":{"buckets":{"kind":"Function","name":"buckets","headline":"buckets returns a list of buckets in the specified organization.","description":null,"parameters":[{"name":"org","headline":"org: Organization name. Default is the current organization.","description":null,"required":false},{"name":"orgID","headline":"orgID: Organization ID. Default is the ID of the current organization.","description":null,"required":false},{"name":"host","headline":"host: URL of the InfluxDB instance.","description":null,"required":false},{"name":"token","headline":"token: InfluxDB API token.","description":null,"required":false}],"flux_type":"(\n ?host: string,\n ?org: string,\n ?orgID: string,\n ?token: string,\n) => stream[{\n retentionPolicy: string,\n retentionPeriod: int,\n organizationID: string,\n name: string,\n id: string,\n}]","is_option":false,"source_location":{"file":"influxdata/influxdb/influxdb.flux","start":{"line":368,"column":1},"end":{"line":379,"column":7},"source":"builtin buckets : (\n ?org: string,\n ?orgID: string,\n ?host: string,\n ?token: string,\n ) => stream[{\n name: string,\n id: string,\n organizationID: string,\n retentionPolicy: string,\n retentionPeriod: int,\n }]"},"examples":[],"metadata":{"introduced":"0.16.0","tags":"metadata"}},"cardinality":{"kind":"Function","name":"cardinality","headline":"cardinality returns the series cardinality of data stored in InfluxDB.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Bucket to query cardinality from.","description":null,"required":false},{"name":"bucketID","headline":"bucketID: String-encoded bucket ID to query cardinality from.","description":null,"required":false},{"name":"org","headline":"org: Organization name.","description":null,"required":false},{"name":"orgID","headline":"orgID: String-encoded organization ID.","description":null,"required":false},{"name":"host","headline":"host: URL of the InfluxDB instance to query.","description":null,"required":false},{"name":"token","headline":"token: InfluxDB API token.","description":null,"required":false},{"name":"start","headline":"start: Earliest time to include when calculating cardinality.","description":null,"required":true},{"name":"stop","headline":"stop: Latest time to include when calculating cardinality.","description":null,"required":false},{"name":"predicate","headline":"predicate: Predicate function that filters records.\n Default is `(r) => true`.","description":null,"required":false}],"flux_type":"(\n start: A,\n ?bucket: string,\n ?bucketID: string,\n ?host: string,\n ?org: string,\n ?orgID: string,\n ?predicate: (r: {B with _value: C, _measurement: string, _field: string}) => bool,\n ?stop: D,\n ?token: string,\n) => stream[{_value: int, _stop: time, _start: time}] where A: Timeable, D: Timeable","is_option":false,"source_location":{"file":"influxdata/influxdb/influxdb.flux","start":{"line":75,"column":1},"end":{"line":88,"column":16},"source":"builtin cardinality : (\n ?bucket: string,\n ?bucketID: string,\n ?org: string,\n ?orgID: string,\n ?host: string,\n ?token: string,\n start: A,\n ?stop: B,\n ?predicate: (r: {T with _measurement: string, _field: string, _value: S}) => bool,\n ) => stream[{_start: time, _stop: time, _value: int}]\n where\n A: Timeable,\n B: Timeable"},"examples":[],"metadata":{"introduced":"0.92.0","tags":"metadata"}},"from":{"kind":"Function","name":"from","headline":"from queries data from an InfluxDB data source.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Name of the bucket to query.\n _`bucket` and `bucketID` are mutually exclusive_.","description":null,"required":false},{"name":"bucketID","headline":"bucketID: String-encoded bucket ID to query.\n _`bucket` and `bucketID` are mutually exclusive_.","description":null,"required":false},{"name":"host","headline":"host: URL of the InfluxDB instance to query.","description":null,"required":false},{"name":"org","headline":"org: Organization name.\n _`org` and `orgID` are mutually exclusive_.","description":null,"required":false},{"name":"orgID","headline":"orgID: String-encoded organization ID to query.\n _`org` and `orgID` are mutually exclusive_.","description":null,"required":false},{"name":"token","headline":"token: InfluxDB API token.","description":null,"required":false}],"flux_type":"(\n ?bucket: string,\n ?bucketID: string,\n ?host: string,\n ?org: string,\n ?orgID: string,\n ?token: string,\n) => stream[{A with _value: B, _time: time, _measurement: string, _field: string}]","is_option":false,"source_location":{"file":"influxdata/influxdb/influxdb.flux","start":{"line":167,"column":1},"end":{"line":174,"column":87},"source":"builtin from : (\n ?bucket: string,\n ?bucketID: string,\n ?org: string,\n ?orgID: string,\n ?host: string,\n ?token: string,\n ) => stream[{B with _measurement: string, _field: string, _time: time, _value: A}]"},"examples":[],"metadata":{"tags":"inputs"}},"to":{"kind":"Function","name":"to","headline":"to writes data to an InfluxDB Cloud or 2.x bucket and returns the written data.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Name of the bucket to write to.\n _`bucket` and `bucketID` are mutually exclusive_.","description":null,"required":false},{"name":"bucketID","headline":"bucketID: String-encoded bucket ID to to write to.\n _`bucket` and `bucketID` are mutually exclusive_.","description":null,"required":false},{"name":"host","headline":"host: URL of the InfluxDB instance to write to.","description":null,"required":false},{"name":"org","headline":"org: Organization name.\n _`org` and `orgID` are mutually exclusive_.","description":null,"required":false},{"name":"orgID","headline":"orgID: String-encoded organization ID to query.\n _`org` and `orgID` are mutually exclusive_.","description":null,"required":false},{"name":"token","headline":"token: InfluxDB API token.","description":null,"required":false},{"name":"timeColumn","headline":"timeColumn: Time column of the output. Default is `\"_time\"`.","description":null,"required":false},{"name":"measurementColumn","headline":"measurementColumn: Measurement column of the output. Default is `\"_measurement\"`.","description":null,"required":false},{"name":"tagColumns","headline":"tagColumns: Tag columns in the output. Defaults to all columns with type\n `string`, excluding all value columns and columns identified by `fieldFn`.","description":null,"required":false},{"name":"fieldFn","headline":"fieldFn: Function that maps a field key to a field value and returns a record.\n Default is `(r) => ({ [r._field]: r._value })`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n ?bucket: string,\n ?bucketID: string,\n ?fieldFn: (r: A) => B,\n ?host: string,\n ?measurementColumn: string,\n ?org: string,\n ?orgID: string,\n ?tagColumns: [string],\n ?timeColumn: string,\n ?token: string,\n) => stream[A] where A: Record, B: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/influxdb.flux","start":{"line":314,"column":1},"end":{"line":329,"column":14},"source":"builtin to : (\n <-tables: stream[A],\n ?bucket: string,\n ?bucketID: string,\n ?org: string,\n ?orgID: string,\n ?host: string,\n ?token: string,\n ?timeColumn: string,\n ?measurementColumn: string,\n ?tagColumns: [string],\n ?fieldFn: (r: A) => B,\n ) => stream[A]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"tags":"outputs"}},"wideTo":{"kind":"Function","name":"wideTo","headline":"wideTo writes wide data to an InfluxDB 2.x or InfluxDB Cloud bucket.\nWide data is _pivoted_ in that its fields are represented as columns making the table wider.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Name of the bucket to write to.\n _`bucket` and `bucketID` are mutually exclusive_.","description":null,"required":false},{"name":"bucketID","headline":"bucketID: String-encoded bucket ID to to write to.\n _`bucket` and `bucketID` are mutually exclusive_.","description":null,"required":false},{"name":"host","headline":"host: URL of the InfluxDB instance to write to.","description":null,"required":false},{"name":"org","headline":"org: Organization name.\n _`org` and `orgID` are mutually exclusive_.","description":null,"required":false},{"name":"orgID","headline":"orgID: String-encoded organization ID to query.\n _`org` and `orgID` are mutually exclusive_.","description":null,"required":false},{"name":"token","headline":"token: InfluxDB API token.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n ?bucket: string,\n ?bucketID: string,\n ?host: string,\n ?org: string,\n ?orgID: string,\n ?token: string,\n) => stream[A] where A: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/influxdb.flux","start":{"line":440,"column":1},"end":{"line":450,"column":14},"source":"builtin wideTo : (\n <-tables: stream[A],\n ?bucket: string,\n ?bucketID: string,\n ?org: string,\n ?orgID: string,\n ?host: string,\n ?token: string,\n ) => stream[A]\n where\n A: Record"},"examples":[],"metadata":{"introduced":"0.174.0","tags":"outputs"}}},"examples":[],"metadata":{"introduced":"0.7.0"}},{"path":"influxdata/influxdb/monitor","name":"monitor","headline":"Package monitor provides tools for monitoring and alerting with InfluxDB.","description":null,"members":{"bucket":{"kind":"Value","name":"bucket","headline":"bucket is the default bucket to store InfluxDB monitoring data in.","description":null,"flux_type":"string","is_option":false,"source_location":{"file":"influxdata/influxdb/monitor/monitor.flux","start":{"line":15,"column":1},"end":{"line":15,"column":23},"source":"bucket = \"_monitoring\""},"examples":[],"metadata":null},"check":{"kind":"Function","name":"check","headline":"check checks input data and assigns a level (`ok`, `info`, `warn`, or `crit`)\nto each row based on predicate functions.","description":null,"parameters":[{"name":"crit","headline":"crit: Predicate function that determines `crit` status. Default is `(r) => false`.","description":null,"required":false},{"name":"warn","headline":"warn: Predicate function that determines `warn` status. Default is `(r) => false`.","description":null,"required":false},{"name":"info","headline":"info: Predicate function that determines `info` status. Default is `(r) => false`.","description":null,"required":false},{"name":"ok","headline":"ok: Predicate function that determines `ok` status. `Default is (r) => true`.","description":null,"required":false},{"name":"messageFn","headline":"messageFn: Predicate function that constructs a message to append to each row.","description":null,"required":true},{"name":"data","headline":"data: Check data to append to output used to identify this check.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[J],\n data: {A with tags: E, _type: D, _check_name: C, _check_id: B},\n messageFn: (\n r: {\n F with\n _type: D,\n _time: H,\n _time: time,\n _source_timestamp: int,\n _source_measurement: G,\n _measurement: G,\n _measurement: string,\n _level: string,\n _check_name: C,\n _check_id: B,\n },\n ) => I,\n ?crit: (r: {F with _time: H, _measurement: G}) => bool,\n ?info: (r: {F with _time: H, _measurement: G}) => bool,\n ?ok: (r: {F with _time: H, _measurement: G}) => bool,\n ?warn: (r: {F with _time: H, _measurement: G}) => bool,\n) => stream[{\n F with\n _type: D,\n _time: H,\n _time: time,\n _source_timestamp: int,\n _source_measurement: G,\n _message: I,\n _measurement: G,\n _measurement: string,\n _level: string,\n _check_name: C,\n _check_id: B,\n}] where E: Record, J: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/monitor/monitor.flux","start":{"line":460,"column":1},"end":{"line":506,"column":19},"source":"check = (\n tables=<-,\n data,\n messageFn,\n crit=(r) => false,\n warn=(r) => false,\n info=(r) => false,\n ok=(r) => true,\n) =>\n tables\n |> experimental.set(o: data.tags)\n |> experimental.group(mode: \"extend\", columns: experimental.objectKeys(o: data.tags))\n |> map(\n fn: (r) =>\n ({r with\n _measurement: \"statuses\",\n _source_measurement: r._measurement,\n _type: data._type,\n _check_id: data._check_id,\n _check_name: data._check_name,\n _level:\n if crit(r: r) then\n levelCrit\n else if warn(r: r) then\n levelWarn\n else if info(r: r) then\n levelInfo\n else if ok(r: r) then\n levelOK\n else\n levelUnknown,\n _source_timestamp: int(v: r._time),\n _time: now(),\n }),\n )\n |> map(fn: (r) => ({r with _message: messageFn(r: r)}))\n |> experimental.group(\n mode: \"extend\",\n columns: [\n \"_source_measurement\",\n \"_type\",\n \"_check_id\",\n \"_check_name\",\n \"_level\",\n ],\n )\n |> write()"},"examples":[],"metadata":{"tags":"transformations"}},"deadman":{"kind":"Function","name":"deadman","headline":"deadman detects when a group stops reporting data.\nIt takes a stream of tables and reports if groups have been observed since time `t`.","description":null,"parameters":[{"name":"t","headline":"t: Time threshold for the deadman check.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{B with _time: C}], t: A) => stream[{B with dead: bool, _time: C}] where A: Comparable, C: Comparable","is_option":false,"source_location":{"file":"influxdata/influxdb/monitor/monitor.flux","start":{"line":386,"column":1},"end":{"line":389,"column":56},"source":"deadman = (t, tables=<-) =>\n tables\n |> max(column: \"_time\")\n |> map(fn: (r) => ({r with dead: r._time < t}))"},"examples":[],"metadata":{"tags":"transformations"}},"from":{"kind":"Function","name":"from","headline":"from retrieves check statuses stored in the `statuses` measurement in the\n`_monitoring` bucket.","description":null,"parameters":[{"name":"start","headline":"start: Earliest time to include in results.","description":null,"required":true},{"name":"stop","headline":"stop: Latest time to include in results. Default is `now()`.","description":null,"required":false},{"name":"fn","headline":"fn: Predicate function that evaluates true or false.","description":null,"required":false}],"flux_type":"(\n start: A,\n ?fn: (\n r: {\n B with\n _value: C,\n _time: time,\n _stop: time,\n _start: time,\n _measurement: string,\n _field: string,\n },\n ) => bool,\n ?stop: D,\n) => stream[E] where E: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/monitor/monitor.flux","start":{"line":107,"column":1},"end":{"line":112,"column":29},"source":"from = (start, stop=now(), fn=(r) => true) =>\n influxdb.from(bucket: bucket)\n |> range(start: start, stop: stop)\n |> filter(fn: (r) => r._measurement == \"statuses\")\n |> filter(fn: fn)\n |> v1.fieldsAsCols()"},"examples":[],"metadata":null},"levelCrit":{"kind":"Value","name":"levelCrit","headline":"levelCrit is the string representation of the \"crit\" level.","description":null,"flux_type":"string","is_option":false,"source_location":{"file":"influxdata/influxdb/monitor/monitor.flux","start":{"line":124,"column":1},"end":{"line":124,"column":19},"source":"levelCrit = \"crit\""},"examples":[],"metadata":null},"levelInfo":{"kind":"Value","name":"levelInfo","headline":"levelInfo is the string representation of the \"info\" level.","description":null,"flux_type":"string","is_option":false,"source_location":{"file":"influxdata/influxdb/monitor/monitor.flux","start":{"line":118,"column":1},"end":{"line":118,"column":19},"source":"levelInfo = \"info\""},"examples":[],"metadata":null},"levelOK":{"kind":"Value","name":"levelOK","headline":"levelOK is the string representation of the \"ok\" level.","description":null,"flux_type":"string","is_option":false,"source_location":{"file":"influxdata/influxdb/monitor/monitor.flux","start":{"line":115,"column":1},"end":{"line":115,"column":15},"source":"levelOK = \"ok\""},"examples":[],"metadata":null},"levelUnknown":{"kind":"Value","name":"levelUnknown","headline":"levelUnknown is the string representation of the an unknown level.","description":null,"flux_type":"string","is_option":false,"source_location":{"file":"influxdata/influxdb/monitor/monitor.flux","start":{"line":127,"column":1},"end":{"line":127,"column":25},"source":"levelUnknown = \"unknown\""},"examples":[],"metadata":null},"levelWarn":{"kind":"Value","name":"levelWarn","headline":"levelWarn is the string representation of the \"warn\" level.","description":null,"flux_type":"string","is_option":false,"source_location":{"file":"influxdata/influxdb/monitor/monitor.flux","start":{"line":121,"column":1},"end":{"line":121,"column":19},"source":"levelWarn = \"warn\""},"examples":[],"metadata":null},"log":{"kind":"Function","name":"log","headline":"log persists notification events to an InfluxDB bucket.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A]) => stream[A] where A: Record","is_option":true,"source_location":{"file":"influxdata/influxdb/monitor/monitor.flux","start":{"line":29,"column":1},"end":{"line":29,"column":70},"source":"option log = (tables=<-) => tables |> experimental.to(bucket: bucket)"},"examples":[],"metadata":null},"logs":{"kind":"Function","name":"logs","headline":"logs retrieves notification events stored in the `notifications` measurement\nin the `_monitoring` bucket.","description":null,"parameters":[{"name":"start","headline":"start: Earliest time to include in results.","description":null,"required":true},{"name":"stop","headline":"stop: Latest time to include in results. Default is `now()`.","description":null,"required":false},{"name":"fn","headline":"fn: Predicate function that evaluates true or false.","description":null,"required":true}],"flux_type":"(\n fn: (\n r: {\n A with\n _value: B,\n _time: time,\n _stop: time,\n _start: time,\n _measurement: string,\n _field: string,\n },\n ) => bool,\n start: C,\n ?stop: D,\n) => stream[E] where E: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/monitor/monitor.flux","start":{"line":67,"column":1},"end":{"line":72,"column":29},"source":"logs = (start, stop=now(), fn) =>\n influxdb.from(bucket: bucket)\n |> range(start: start, stop: stop)\n |> filter(fn: (r) => r._measurement == \"notifications\")\n |> filter(fn: fn)\n |> v1.fieldsAsCols()"},"examples":[],"metadata":{"tags":"inputs"}},"notify":{"kind":"Function","name":"notify","headline":"notify sends a notification to an endpoint and logs it in the `notifications`\nmeasurement in the `_monitoring` bucket.","description":null,"parameters":[{"name":"endpoint","headline":"endpoint: A function that constructs and sends the notification to an endpoint.","description":null,"required":true},{"name":"data","headline":"data: Notification data to append to the output.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[E],\n data: A,\n endpoint: (<-: stream[{B with _time: C, _time: time, _status_timestamp: int, _measurement: string}]) => stream[D],\n) => stream[D] where A: Record, D: Record, E: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/monitor/monitor.flux","start":{"line":223,"column":1},"end":{"line":236,"column":17},"source":"notify = (tables=<-, endpoint, data) =>\n tables\n |> experimental.set(o: data)\n |> experimental.group(mode: \"extend\", columns: experimental.objectKeys(o: data))\n |> map(\n fn: (r) =>\n ({r with _measurement: \"notifications\",\n _status_timestamp: int(v: r._time),\n _time: now(),\n }),\n )\n |> endpoint()\n |> experimental.group(mode: \"extend\", columns: [\"_sent\"])\n |> log()"},"examples":[],"metadata":null},"stateChanges":{"kind":"Function","name":"stateChanges","headline":"stateChanges detects state changes in a stream of data with a `_level` column\nand outputs records that change from `fromLevel` to `toLevel`.","description":null,"parameters":[{"name":"fromLevel","headline":"fromLevel: Level to detect a change from. Default is `\"any\"`.","description":null,"required":false},{"name":"toLevel","headline":"toLevel: Level to detect a change to. Default is `\"any\"`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{C with _level: D}], ?fromLevel: A, ?toLevel: B) => stream[E] where A: Equatable, B: Equatable, D: Equatable, E: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/monitor/monitor.flux","start":{"line":329,"column":1},"end":{"line":335,"column":2},"source":"stateChanges = (fromLevel=\"any\", toLevel=\"any\", tables=<-) => {\n return\n if fromLevel == \"any\" and toLevel == \"any\" then\n tables |> stateChangesOnly()\n else\n tables |> _stateChanges(fromLevel: fromLevel, toLevel: toLevel)\n}"},"examples":[],"metadata":{"introduced":"0.42.0","tags":"transformations"}},"stateChangesOnly":{"kind":"Function","name":"stateChangesOnly","headline":"stateChangesOnly takes a stream of tables that contains a _level column\nand returns a stream of tables grouped by `_level` where each record\nrepresents a state change.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _level: B}]) => stream[C] where B: Equatable, C: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/monitor/monitor.flux","start":{"line":269,"column":1},"end":{"line":295,"column":2},"source":"stateChangesOnly = (tables=<-) => {\n return\n tables\n |> map(\n fn: (r) =>\n ({r with level_value:\n if r._level == levelCrit then\n 4\n else if r._level == levelWarn then\n 3\n else if r._level == levelInfo then\n 2\n else if r._level == levelOK then\n 1\n else\n 0,\n }),\n )\n |> duplicate(column: \"_level\", as: \"____temp_level____\")\n |> drop(columns: [\"_level\"])\n |> rename(columns: {\"____temp_level____\": \"_level\"})\n |> sort(columns: [\"_source_timestamp\", \"_time\"], desc: false)\n |> difference(columns: [\"level_value\"])\n |> filter(fn: (r) => r.level_value != 0)\n |> drop(columns: [\"level_value\"])\n |> experimental.group(mode: \"extend\", columns: [\"_level\"])\n}"},"examples":[],"metadata":{"introduced":"0.65.0","tags":"transformations"}},"write":{"kind":"Function","name":"write","headline":"write persists check statuses to an InfluxDB bucket.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A]) => stream[A] where A: Record","is_option":true,"source_location":{"file":"influxdata/influxdb/monitor/monitor.flux","start":{"line":22,"column":1},"end":{"line":22,"column":72},"source":"option write = (tables=<-) => tables |> experimental.to(bucket: bucket)"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.39.0","tag":"monitor, alerts"}},{"path":"influxdata/influxdb/sample","name":"sample","headline":"Package sample provides functions for downloading and outputting InfluxDB sample datasets.","description":null,"members":{"alignToNow":{"kind":"Function","name":"alignToNow","headline":"alignToNow shifts time values in input data to align the chronological last point to _now_.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Defaults to piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A]) => stream[A] where A: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/sample/sample.flux","start":{"line":169,"column":1},"end":{"line":179,"column":2},"source":"alignToNow = (tables=<-) => {\n _lastTime =\n (tables\n |> keep(columns: [\"_time\"])\n |> last(column: \"_time\")\n |> findRecord(fn: (key) => true, idx: 0))._time\n _offset = int(v: now()) - int(v: _lastTime)\n _offsetDuration = duration(v: _offset)\n\n return tables |> timeShift(duration: _offsetDuration)\n}"},"examples":[],"metadata":{"tags":"transformations"}},"data":{"kind":"Function","name":"data","headline":"data downloads a specified InfluxDB sample dataset.","description":null,"parameters":[{"name":"set","headline":"set: Sample data set to download and output.","description":null,"required":true}],"flux_type":"(set: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/sample/sample.flux","start":{"line":110,"column":1},"end":{"line":120,"column":2},"source":"data = (set) => {\n setInfo = _setInfo(set: set)\n\n url =\n if setInfo.url == \"\" then\n die(msg: \"Invalid sample data set. Use sample.list to view available datasets.\")\n else\n setInfo.url\n\n return csv.from(url: url)\n}"},"examples":[],"metadata":null},"list":{"kind":"Function","name":"list","headline":"list outputs information about available InfluxDB sample datasets.","description":null,"parameters":[],"flux_type":"(\n \n) => stream[{\n url: string,\n type: string,\n size: string,\n name: string,\n description: string,\n}]","is_option":false,"source_location":{"file":"influxdata/influxdb/sample/sample.flux","start":{"line":133,"column":1},"end":{"line":144,"column":6},"source":"list = () =>\n array.from(\n rows: [\n _setInfo(set: \"airSensor\"),\n _setInfo(set: \"birdMigration\"),\n _setInfo(set: \"bitcoin\"),\n _setInfo(set: \"machineProduction\"),\n _setInfo(set: \"noaa\"),\n _setInfo(set: \"noaaWater\"),\n _setInfo(set: \"usgs\"),\n ],\n )"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.123.0","tags":"sample data"}},{"path":"influxdata/influxdb/schema","name":"schema","headline":"Package schema provides functions for exploring your InfluxDB data schema.","description":null,"members":{"fieldKeys":{"kind":"Function","name":"fieldKeys","headline":"fieldKeys returns field keys in a bucket.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Bucket to list field keys from.","description":null,"required":true},{"name":"predicate","headline":"predicate: Predicate function that filters field keys.\n Default is `(r) => true`.","description":null,"required":false},{"name":"start","headline":"start: Oldest time to include in results. Default is `-30d`.","description":null,"required":false},{"name":"stop","headline":"stop: Newest time include in results.\n The stop time is exclusive, meaning values with a time equal to stop time are excluded from the results.\n Default is `now()`.","description":null,"required":false}],"flux_type":"(\n bucket: string,\n ?predicate: (\n r: {\n A with\n _value: B,\n _time: time,\n _stop: time,\n _start: time,\n _measurement: string,\n _field: string,\n },\n ) => bool,\n ?start: C,\n ?stop: D,\n) => stream[E] where E: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/schema/schema.flux","start":{"line":246,"column":1},"end":{"line":253,"column":6},"source":"fieldKeys = (bucket, predicate=(r) => true, start=_startDefault, stop=_stopDefault) =>\n tagValues(\n bucket: bucket,\n tag: \"_field\",\n predicate: predicate,\n start: start,\n stop: stop,\n )"},"examples":[],"metadata":{"tags":"metadata"}},"fieldsAsCols":{"kind":"Function","name":"fieldsAsCols","headline":"fieldsAsCols is a special application of `pivot()` that pivots input data\non `_field` and `_time` columns to align fields within each input table that\nhave the same timestamp.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A]) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/schema/schema.flux","start":{"line":47,"column":1},"end":{"line":49,"column":82},"source":"fieldsAsCols = (tables=<-) =>\n tables\n |> pivot(rowKey: [\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")"},"examples":[],"metadata":{"tags":"transformations"}},"measurementFieldKeys":{"kind":"Function","name":"measurementFieldKeys","headline":"measurementFieldKeys returns a list of fields in a measurement.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Bucket to retrieve field keys from.","description":null,"required":true},{"name":"measurement","headline":"measurement: Measurement to list field keys from.","description":null,"required":true},{"name":"start","headline":"start: Oldest time to include in results. Default is `-30d`.","description":null,"required":false},{"name":"stop","headline":"stop: Newest time include in results.\n The stop time is exclusive, meaning values with a time equal to stop time are excluded from the results.\n Default is `now()`.","description":null,"required":false}],"flux_type":"(bucket: string, measurement: A, ?start: B, ?stop: C) => stream[D] where A: Equatable, D: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/schema/schema.flux","start":{"line":286,"column":1},"end":{"line":292,"column":6},"source":"measurementFieldKeys = (bucket, measurement, start=_startDefault, stop=_stopDefault) =>\n fieldKeys(\n bucket: bucket,\n predicate: (r) => r._measurement == measurement,\n start: start,\n stop: stop,\n )"},"examples":[],"metadata":{"tags":"metadata"}},"measurementTagKeys":{"kind":"Function","name":"measurementTagKeys","headline":"measurementTagKeys returns the list of tag keys for a specific measurement.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Bucket to return tag keys from for a specific measurement.","description":null,"required":true},{"name":"measurement","headline":"measurement: Measurement to return tag keys from.","description":null,"required":true},{"name":"start","headline":"start: Oldest time to include in results. Default is `-30d`.","description":null,"required":false},{"name":"stop","headline":"stop: Newest time include in results.\n The stop time is exclusive, meaning values with a time equal to stop time are excluded from the results.\n Default is `now()`.","description":null,"required":false}],"flux_type":"(bucket: string, measurement: A, ?start: B, ?stop: C) => stream[D] where A: Equatable, D: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/schema/schema.flux","start":{"line":206,"column":1},"end":{"line":212,"column":6},"source":"measurementTagKeys = (bucket, measurement, start=_startDefault, stop=_stopDefault) =>\n tagKeys(\n bucket: bucket,\n predicate: (r) => r._measurement == measurement,\n start: start,\n stop: stop,\n )"},"examples":[],"metadata":{"tags":"metadata"}},"measurementTagValues":{"kind":"Function","name":"measurementTagValues","headline":"measurementTagValues returns a list of tag values for a specific measurement.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Bucket to return tag values from for a specific measurement.","description":null,"required":true},{"name":"measurement","headline":"measurement: Measurement to return tag values from.","description":null,"required":true},{"name":"tag","headline":"tag: Tag to return all unique values from.","description":null,"required":true},{"name":"start","headline":"start: Oldest time to include in results. Default is `-30d`.","description":null,"required":false},{"name":"stop","headline":"stop: Newest time include in results.\n The stop time is exclusive, meaning values with a time equal to stop time are excluded from the results.\n Default is `now()`.","description":null,"required":false}],"flux_type":"(\n bucket: string,\n measurement: A,\n tag: string,\n ?start: B,\n ?stop: C,\n) => stream[D] where A: Equatable, D: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/schema/schema.flux","start":{"line":164,"column":1},"end":{"line":177,"column":6},"source":"measurementTagValues = (\n bucket,\n measurement,\n tag,\n start=_startDefault,\n stop=_stopDefault,\n) =>\n tagValues(\n bucket: bucket,\n tag: tag,\n predicate: (r) => r._measurement == measurement,\n start: start,\n stop: stop,\n )"},"examples":[],"metadata":{"tags":"metadata"}},"measurements":{"kind":"Function","name":"measurements","headline":"measurements returns a list of measurements in a specific bucket.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Bucket to retrieve measurements from.","description":null,"required":true},{"name":"start","headline":"start: Oldest time to include in results. Default is `-30d`.","description":null,"required":false},{"name":"stop","headline":"stop: Newest time include in results.\n The stop time is exclusive, meaning values with a time equal to stop time are excluded from the results.\n Default is `now()`.","description":null,"required":false}],"flux_type":"(bucket: string, ?start: A, ?stop: B) => stream[C] where C: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/schema/schema.flux","start":{"line":317,"column":1},"end":{"line":318,"column":77},"source":"measurements = (bucket, start=_startDefault, stop=_stopDefault) =>\n tagValues(bucket: bucket, tag: \"_measurement\", start: start, stop: stop)"},"examples":[],"metadata":{"tags":"metadata"}},"tagKeys":{"kind":"Function","name":"tagKeys","headline":"tagKeys returns a list of tag keys for all series that match the `predicate`.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Bucket to return tag keys from.","description":null,"required":true},{"name":"predicate","headline":"predicate: Predicate function that filters tag keys.\n Default is `(r) => true`.","description":null,"required":false},{"name":"start","headline":"start: Oldest time to include in results. Default is `-30d`.","description":null,"required":false},{"name":"stop","headline":"stop: Newest time include in results.\n The stop time is exclusive, meaning values with a time equal to stop time are excluded from the results.\n Default is `now()`.","description":null,"required":false}],"flux_type":"(\n bucket: string,\n ?predicate: (\n r: {\n A with\n _value: B,\n _time: time,\n _stop: time,\n _start: time,\n _measurement: string,\n _field: string,\n },\n ) => bool,\n ?start: C,\n ?stop: D,\n) => stream[E] where E: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/schema/schema.flux","start":{"line":127,"column":1},"end":{"line":133,"column":22},"source":"tagKeys = (bucket, predicate=(r) => true, start=_startDefault, stop=_stopDefault) =>\n _from(bucket: bucket)\n |> range(start: start, stop: stop)\n |> filter(fn: predicate)\n |> keys()\n |> keep(columns: [\"_value\"])\n |> distinct()"},"examples":[],"metadata":{"tags":"metadata"}},"tagValues":{"kind":"Function","name":"tagValues","headline":"tagValues returns a list of unique values for a given tag.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Bucket to return unique tag values from.","description":null,"required":true},{"name":"tag","headline":"tag: Tag to return unique values from.","description":null,"required":true},{"name":"predicate","headline":"predicate: Predicate function that filters tag values.\n Default is `(r) => true`.","description":null,"required":false},{"name":"start","headline":"start: Oldest time to include in results. Default is `-30d`.","description":null,"required":false},{"name":"stop","headline":"stop: Newest time include in results.\n The stop time is exclusive, meaning values with a time equal to stop time are excluded from the results.\n Default is `now()`.","description":null,"required":false}],"flux_type":"(\n bucket: string,\n tag: string,\n ?predicate: (\n r: {\n A with\n _value: B,\n _time: time,\n _stop: time,\n _start: time,\n _measurement: string,\n _field: string,\n },\n ) => bool,\n ?start: C,\n ?stop: D,\n) => stream[E] where E: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/schema/schema.flux","start":{"line":84,"column":1},"end":{"line":96,"column":33},"source":"tagValues = (\n bucket,\n tag,\n predicate=(r) => true,\n start=_startDefault,\n stop=_stopDefault,\n) =>\n _from(bucket: bucket)\n |> range(start: start, stop: stop)\n |> filter(fn: predicate)\n |> keep(columns: [tag])\n |> group()\n |> distinct(column: tag)"},"examples":[],"metadata":{"tags":"metadata"}}},"examples":[],"metadata":{"introduced":"0.88.0"}},{"path":"influxdata/influxdb/secrets","name":"secrets","headline":"Package secrets functions for working with sensitive secrets managed by InfluxDB.","description":null,"members":{"get":{"kind":"Function","name":"get","headline":"get retrieves a secret from the InfluxDB secret store.","description":null,"parameters":[{"name":"key","headline":"key: Secret key to retrieve.","description":null,"required":true}],"flux_type":"(key: string) => string","is_option":false,"source_location":{"file":"influxdata/influxdb/secrets/secrets.flux","start":{"line":39,"column":1},"end":{"line":39,"column":38},"source":"builtin get : (key: string) => string"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.41.0","tags":"secrets,security"}},{"path":"influxdata/influxdb/tasks","name":"tasks","headline":"Package tasks provides tools for working with InfluxDB tasks.","description":null,"members":{"lastSuccess":{"kind":"Function","name":"lastSuccess","headline":"lastSuccess returns the time of the last successful run of the InfluxDB task\nor the value of the `orTime` parameter if the task has never successfully run.","description":null,"parameters":[{"name":"orTime","headline":"orTime: Default time value returned if the task has never successfully run.","description":null,"required":true}],"flux_type":"(orTime: A) => time where A: Timeable","is_option":false,"source_location":{"file":"influxdata/influxdb/tasks/tasks.flux","start":{"line":52,"column":1},"end":{"line":52,"column":64},"source":"lastSuccess = (orTime) => _lastSuccess(orTime, lastSuccessTime)"},"examples":[],"metadata":null},"lastSuccessTime":{"kind":"Value","name":"lastSuccessTime","headline":"lastSuccessTime is the last time this task ran successfully.","description":null,"flux_type":"time","is_option":true,"source_location":{"file":"influxdata/influxdb/tasks/tasks.flux","start":{"line":14,"column":1},"end":{"line":14,"column":35},"source":"option lastSuccessTime = _zeroTime"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.84.0"}},{"path":"influxdata/influxdb/v1","name":"v1","headline":"Package v1 provides tools for managing data from an InfluxDB v1.x database or\nstructured using the InfluxDB v1 data structure.","description":null,"members":{"databases":{"kind":"Function","name":"databases","headline":"databases returns a list of databases in an InfluxDB 1.x (1.7+) instance.","description":null,"parameters":[{"name":"org","headline":"org: Organization name.","description":null,"required":false},{"name":"orgID","headline":"orgID: Organization ID.","description":null,"required":false},{"name":"host","headline":"host: InfluxDB URL. Default is `http://localhost:8086`.","description":null,"required":false},{"name":"token","headline":"token: InfluxDB API token.","description":null,"required":false}],"flux_type":"(\n ?host: string,\n ?org: string,\n ?orgID: string,\n ?token: string,\n) => stream[{\n retentionPolicy: string,\n retentionPeriod: int,\n organizationID: string,\n default: bool,\n databaseName: string,\n bucketID: string,\n}]","is_option":false,"source_location":{"file":"influxdata/influxdb/v1/v1.flux","start":{"line":122,"column":1},"end":{"line":134,"column":7},"source":"builtin databases : (\n ?org: string,\n ?orgID: string,\n ?host: string,\n ?token: string,\n ) => stream[{\n organizationID: string,\n databaseName: string,\n retentionPolicy: string,\n retentionPeriod: int,\n default: bool,\n bucketID: string,\n }]"},"examples":[],"metadata":{"tags":"metadata"}},"fieldKeys":{"kind":"Function","name":"fieldKeys","headline":"fieldKeys returns field keys in a bucket.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Bucket to list field keys from.","description":null,"required":true},{"name":"predicate","headline":"predicate: Predicate function that filters field keys.\n Default is `(r) => true`.","description":null,"required":false},{"name":"start","headline":"start: Oldest time to include in results. Default is `-30d`.","description":null,"required":false},{"name":"stop","headline":"stop: Newest time include in results.\n The stop time is exclusive, meaning values with a time equal to stop time are excluded from the results.\n Default is `now()`.","description":null,"required":false}],"flux_type":"(\n bucket: string,\n ?predicate: (\n r: {\n A with\n _value: B,\n _time: time,\n _stop: time,\n _start: time,\n _measurement: string,\n _field: string,\n },\n ) => bool,\n ?start: C,\n ?stop: D,\n) => stream[E] where E: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/v1/v1.flux","start":{"line":337,"column":1},"end":{"line":337,"column":29},"source":"fieldKeys = schema.fieldKeys"},"examples":[],"metadata":{"deprecated":"0.88.0","tags":"metadata"}},"fieldsAsCols":{"kind":"Function","name":"fieldsAsCols","headline":"fieldsAsCols is a special application of `pivot()` that pivots input data\non `_field` and `_time` columns to align fields within each input table that\nhave the same timestamp.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A]) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/v1/v1.flux","start":{"line":172,"column":1},"end":{"line":172,"column":35},"source":"fieldsAsCols = schema.fieldsAsCols"},"examples":[],"metadata":{"deprecated":"0.88.0","tags":"transformations"}},"json":{"kind":"Function","name":"json","headline":"json parses an InfluxDB 1.x JSON result into a stream of tables.","description":null,"parameters":[{"name":"json","headline":"json: InfluxDB 1.x query results in JSON format.","description":null,"required":false},{"name":"file","headline":"file: File path to file containing InfluxDB 1.x query results in JSON format.","description":null,"required":false}],"flux_type":"(?file: string, ?json: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/v1/v1.flux","start":{"line":93,"column":1},"end":{"line":93,"column":75},"source":"builtin json : (?json: string, ?file: string) => stream[A] where A: Record"},"examples":[],"metadata":{"tags":"inputs"}},"measurementFieldKeys":{"kind":"Function","name":"measurementFieldKeys","headline":"measurementFieldKeys returns a list of fields in a measurement.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Bucket to retrieve field keys from.","description":null,"required":true},{"name":"measurement","headline":"measurement: Measurement to list field keys from.","description":null,"required":true},{"name":"start","headline":"start: Oldest time to include in results. Default is `-30d`.","description":null,"required":false},{"name":"stop","headline":"stop: Newest time include in results.\n The stop time is exclusive, meaning values with a time equal to stop time are excluded from the results.\n Default is `now()`.","description":null,"required":false}],"flux_type":"(bucket: string, measurement: A, ?start: B, ?stop: C) => stream[D] where A: Equatable, D: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/v1/v1.flux","start":{"line":371,"column":1},"end":{"line":371,"column":51},"source":"measurementFieldKeys = schema.measurementFieldKeys"},"examples":[],"metadata":{"deprecated":"0.88.0","tags":"metadata"}},"measurementTagKeys":{"kind":"Function","name":"measurementTagKeys","headline":"measurementTagKeys returns the list of tag keys for a specific measurement.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Bucket to return tag keys from for a specific measurement.","description":null,"required":true},{"name":"measurement","headline":"measurement: Measurement to return tag keys from.","description":null,"required":true},{"name":"start","headline":"start: Oldest time to include in results. Default is `-30d`.","description":null,"required":false},{"name":"stop","headline":"stop: Newest time include in results.\n The stop time is exclusive, meaning values with a time equal to stop time are excluded from the results.\n Default is `now()`.","description":null,"required":false}],"flux_type":"(bucket: string, measurement: A, ?start: B, ?stop: C) => stream[D] where A: Equatable, D: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/v1/v1.flux","start":{"line":302,"column":1},"end":{"line":302,"column":47},"source":"measurementTagKeys = schema.measurementTagKeys"},"examples":[],"metadata":{"deprecated":"0.88.0","tags":"metadata"}},"measurementTagValues":{"kind":"Function","name":"measurementTagValues","headline":"measurementTagValues returns a list of tag values for a specific measurement.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Bucket to return tag values from for a specific measurement.","description":null,"required":true},{"name":"measurement","headline":"measurement: Measurement to return tag values from.","description":null,"required":true},{"name":"tag","headline":"tag: Tag to return all unique values from.","description":null,"required":true},{"name":"start","headline":"start: Oldest time to include in results. Default is `-30d`.","description":null,"required":false},{"name":"stop","headline":"stop: Newest time include in results.\n The stop time is exclusive, meaning values with a time equal to stop time are excluded from the results.\n Default is `now()`.","description":null,"required":false}],"flux_type":"(\n bucket: string,\n measurement: A,\n tag: string,\n ?start: B,\n ?stop: C,\n) => stream[D] where A: Equatable, D: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/v1/v1.flux","start":{"line":240,"column":1},"end":{"line":240,"column":51},"source":"measurementTagValues = schema.measurementTagValues"},"examples":[],"metadata":{"deprecated":"0.88.0","tags":"metadata"}},"measurements":{"kind":"Function","name":"measurements","headline":"measurements returns a list of measurements in a specific bucket.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Bucket to retrieve measurements from.","description":null,"required":true},{"name":"start","headline":"start: Oldest time to include in results. Default is `-30d`.","description":null,"required":false},{"name":"stop","headline":"stop: Newest time include in results.\n The stop time is exclusive, meaning values with a time equal to stop time are excluded from the results.\n Default is `now()`.","description":null,"required":false}],"flux_type":"(bucket: string, ?start: A, ?stop: B) => stream[C] where C: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/v1/v1.flux","start":{"line":397,"column":1},"end":{"line":398,"column":24},"source":"measurements =\n schema.measurements"},"examples":[],"metadata":{"deprecated":"0.88.0","tags":"metadata"}},"tagKeys":{"kind":"Function","name":"tagKeys","headline":"tagKeys returns a list of tag keys for all series that match the `predicate`.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Bucket to return tag keys from.","description":null,"required":true},{"name":"predicate","headline":"predicate: Predicate function that filters tag keys.\n Default is `(r) => true`.","description":null,"required":false},{"name":"start","headline":"start: Oldest time to include in results. Default is `-30d`.","description":null,"required":false},{"name":"stop","headline":"stop: Newest time include in results.\n The stop time is exclusive, meaning values with a time equal to stop time are excluded from the results.\n Default is `now()`.","description":null,"required":false}],"flux_type":"(\n bucket: string,\n ?predicate: (\n r: {\n A with\n _value: B,\n _time: time,\n _stop: time,\n _start: time,\n _measurement: string,\n _field: string,\n },\n ) => bool,\n ?start: C,\n ?stop: D,\n) => stream[E] where E: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/v1/v1.flux","start":{"line":272,"column":1},"end":{"line":272,"column":25},"source":"tagKeys = schema.tagKeys"},"examples":[],"metadata":{"deprecated":"0.88.0","tags":"metadata"}},"tagValues":{"kind":"Function","name":"tagValues","headline":"tagValues returns a list of unique values for a given tag.","description":null,"parameters":[{"name":"bucket","headline":"bucket: Bucket to return unique tag values from.","description":null,"required":true},{"name":"tag","headline":"tag: Tag to return unique values from.","description":null,"required":true},{"name":"predicate","headline":"predicate: Predicate function that filters tag values.\n Default is `(r) => true`.","description":null,"required":false},{"name":"start","headline":"start: Oldest time to include in results. Default is `-30d`.","description":null,"required":false},{"name":"stop","headline":"stop: Newest time include in results.\n The stop time is exclusive, meaning values with a time equal to stop time are excluded from the results.\n Default is `now()`.","description":null,"required":false}],"flux_type":"(\n bucket: string,\n tag: string,\n ?predicate: (\n r: {\n A with\n _value: B,\n _time: time,\n _stop: time,\n _start: time,\n _measurement: string,\n _field: string,\n },\n ) => bool,\n ?start: C,\n ?stop: D,\n) => stream[E] where E: Record","is_option":false,"source_location":{"file":"influxdata/influxdb/v1/v1.flux","start":{"line":208,"column":1},"end":{"line":208,"column":29},"source":"tagValues = schema.tagValues"},"examples":[],"metadata":{"deprecated":"0.88.0","tags":"metadata"}}},"examples":[],"metadata":{"introduced":"0.16.0"}},{"path":"internal/boolean","name":"boolean","headline":"Package boolean provides constants for true and false values.","description":null,"members":{"false":{"kind":"Value","name":"false","headline":"false is a constant that is the false value.","description":null,"flux_type":"bool","is_option":false,"source_location":{"file":"internal/boolean/boolean.flux","start":{"line":12,"column":1},"end":{"line":12,"column":21},"source":"builtin false : bool"},"examples":[],"metadata":null},"true":{"kind":"Value","name":"true","headline":"true is a constant that is the truth value.","description":null,"flux_type":"bool","is_option":false,"source_location":{"file":"internal/boolean/boolean.flux","start":{"line":9,"column":1},"end":{"line":9,"column":20},"source":"builtin true : bool"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.129.0"}},{"path":"internal/debug","name":"debug","headline":"Package debug provides methods for debugging the Flux engine.","description":null,"members":{"feature":{"kind":"Function","name":"feature","headline":"feature returns the value associated with the given feature flag.","description":null,"parameters":[{"name":"key","headline":"key: Feature flag name.","description":null,"required":true}],"flux_type":"(key: string) => A","is_option":false,"source_location":{"file":"internal/debug/debug.flux","start":{"line":54,"column":1},"end":{"line":54,"column":37},"source":"builtin feature : (key: string) => A"},"examples":[],"metadata":null},"getOption":{"kind":"Function","name":"getOption","headline":"getOption gets the value of an option using a form of reflection.","description":null,"parameters":[{"name":"pkg","headline":"pkg: Full path of the package.","description":null,"required":true},{"name":"name","headline":"name: Option name.","description":null,"required":true}],"flux_type":"(name: string, pkg: string) => A","is_option":false,"source_location":{"file":"internal/debug/debug.flux","start":{"line":47,"column":1},"end":{"line":47,"column":53},"source":"builtin getOption : (pkg: string, name: string) => A"},"examples":[],"metadata":null},"null":{"kind":"Function","name":"null","headline":"null returns the null value with a given type.","description":null,"parameters":[{"name":"type","headline":"type: Null type.","description":null,"required":false}],"flux_type":"(?type: string) => A where A: Basic","is_option":false,"source_location":{"file":"internal/debug/debug.flux","start":{"line":86,"column":1},"end":{"line":86,"column":51},"source":"builtin null : (?type: string) => A where A: Basic"},"examples":[],"metadata":{"introduced":"0.179.0"}},"opaque":{"kind":"Function","name":"opaque","headline":"opaque works like `pass` in that it passes any incoming tables directly to the\nfollowing transformation, save for its type signature does not indicate that the\ninput type has any correlation with the output type.","description":null,"parameters":[{"name":"tables","headline":"tables: Stream to pass unmodified to next transformation.","description":null,"required":false}],"flux_type":"(<-tables: stream[A]) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"internal/debug/debug.flux","start":{"line":23,"column":1},"end":{"line":23,"column":79},"source":"builtin opaque : (<-tables: stream[A]) => stream[B] where A: Record, B: Record"},"examples":[],"metadata":null},"pass":{"kind":"Function","name":"pass","headline":"pass will pass any incoming tables directly next to the following transformation.\nIt is best used to interrupt any planner rules that rely on a specific ordering.","description":null,"parameters":[{"name":"tables","headline":"tables: Stream to pass unmodified to next transformation.","description":null,"required":false}],"flux_type":"(<-tables: stream[A]) => stream[A] where A: Record","is_option":false,"source_location":{"file":"internal/debug/debug.flux","start":{"line":14,"column":1},"end":{"line":14,"column":66},"source":"builtin pass : (<-tables: stream[A]) => stream[A] where A: Record"},"examples":[],"metadata":null},"sink":{"kind":"Function","name":"sink","headline":"sink will discard all data that comes into it.","description":null,"parameters":[{"name":"tables","headline":"tables: Stream to discard.","description":null,"required":false}],"flux_type":"(<-tables: stream[A]) => stream[A] where A: Record","is_option":false,"source_location":{"file":"internal/debug/debug.flux","start":{"line":39,"column":1},"end":{"line":39,"column":66},"source":"builtin sink : (<-tables: stream[A]) => stream[A] where A: Record"},"examples":[],"metadata":null},"slurp":{"kind":"Function","name":"slurp","headline":"slurp will read the incoming tables and concatenate buffers with the same group key\ninto a single in memory table buffer. This is useful for testing the performance impact of multiple\nbuffers versus a single buffer.","description":null,"parameters":[{"name":"tables","headline":"tables: Stream to consume into single buffers per table.","description":null,"required":false}],"flux_type":"(<-tables: stream[A]) => stream[A] where A: Record","is_option":false,"source_location":{"file":"internal/debug/debug.flux","start":{"line":32,"column":1},"end":{"line":32,"column":67},"source":"builtin slurp : (<-tables: stream[A]) => stream[A] where A: Record"},"examples":[],"metadata":null},"vectorize":{"kind":"Value","name":"vectorize","headline":"vectorize controls whether the compiler attempts to vectorize Flux functions.","description":null,"flux_type":"bool","is_option":true,"source_location":{"file":"internal/debug/debug.flux","start":{"line":89,"column":1},"end":{"line":89,"column":25},"source":"option vectorize = false"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.68.0"}},{"path":"internal/gen","name":"gen","headline":"Package gen provides methods for generating data.","description":null,"members":{"tables":{"kind":"Function","name":"tables","headline":"tables generates a stream of table data.","description":null,"parameters":[{"name":"n","headline":"n: Number of rows to generate.","description":null,"required":true},{"name":"nulls","headline":"nulls: Percentage chance that a null value will be used in the input. Valid value range is `[0.0 - 1.0]`.","description":null,"required":false},{"name":"tags","headline":"tags: Set of tags with their cardinality to generate.","description":null,"required":false},{"name":"seed","headline":"seed: Pass seed to tables generator to get the very same sequence each time.","description":null,"required":false}],"flux_type":"(\n n: int,\n ?nulls: float,\n ?seed: int,\n ?tags: [{name: string, cardinality: int}],\n) => stream[{A with _value: float, _time: time}]","is_option":false,"source_location":{"file":"internal/gen/gen.flux","start":{"line":15,"column":1},"end":{"line":20,"column":53},"source":"builtin tables : (\n n: int,\n ?nulls: float,\n ?tags: [{name: string, cardinality: int}],\n ?seed: int,\n ) => stream[{A with _time: time, _value: float}]"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.50.0"}},{"path":"internal/influxql","name":"influxql","headline":"Package influxql provides constants for working with InfluxQL.","description":null,"members":{"epoch":{"kind":"Value","name":"epoch","headline":"epoch is the absolute time that all InfluxQL time and duration values use as a zero reference.","description":null,"flux_type":"time","is_option":false,"source_location":{"file":"internal/influxql/influxql.flux","start":{"line":9,"column":1},"end":{"line":9,"column":29},"source":"epoch = 1970-01-01T00:00:00Z"},"examples":[],"metadata":null},"maxTime":{"kind":"Value","name":"maxTime","headline":"maxTime is the latest time InfluxQL can represent.","description":null,"flux_type":"time","is_option":false,"source_location":{"file":"internal/influxql/influxql.flux","start":{"line":15,"column":1},"end":{"line":15,"column":41},"source":"maxTime = 2262-04-11T23:47:16.854775806Z"},"examples":[],"metadata":null},"minTime":{"kind":"Value","name":"minTime","headline":"minTime is the earliest time InfluxQL can represent.","description":null,"flux_type":"time","is_option":false,"source_location":{"file":"internal/influxql/influxql.flux","start":{"line":12,"column":1},"end":{"line":12,"column":41},"source":"minTime = 1677-09-21T00:12:43.145224194Z"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.60.0"}},{"path":"internal/location","name":"location","headline":"Package location loads a timezone based on a location name.","description":null,"members":{"location":{"kind":"Value","name":"location","headline":"location loads a timezone based on a location name.","description":null,"flux_type":"{zone: string, offset: duration}","is_option":true,"source_location":{"file":"internal/location/location.flux","start":{"line":9,"column":1},"end":{"line":9,"column":44},"source":"option location = {zone: \"UTC\", offset: 0h}"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.149.0"}},{"path":"internal/promql","name":"promql","headline":"Package promql provides an internal API for implementing PromQL via Flux.","description":null,"members":{"changes":{"kind":"Function","name":"changes","headline":"changes implements functionality equivalent to\n[PromQL's `changes()` function](https://prometheus.io/docs/prometheus/latest/querying/functions/#changes).","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: float}]) => stream[{B with _value: float}]","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":33,"column":1},"end":{"line":33,"column":95},"source":"builtin changes : (<-tables: stream[{A with _value: float}]) => stream[{B with _value: float}]"},"examples":[],"metadata":null},"emptyTable":{"kind":"Function","name":"emptyTable","headline":"emptyTable returns an empty table, which is used as a helper function to implement\nPromQL's [`time()`](https://prometheus.io/docs/prometheus/latest/querying/functions/#time) and\n[`vector()`](https://prometheus.io/docs/prometheus/latest/querying/functions/#vector) functions.","description":null,"parameters":[],"flux_type":"() => stream[{_value: float, _time: time, _stop: time, _start: time}]","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":68,"column":1},"end":{"line":68,"column":91},"source":"builtin emptyTable : () => stream[{_start: time, _stop: time, _time: time, _value: float}]"},"examples":[],"metadata":null},"extrapolatedRate":{"kind":"Function","name":"extrapolatedRate","headline":"extrapolatedRate is a helper function that calculates extrapolated rates over\ncounters and is used to implement PromQL's\n[`rate()`](https://prometheus.io/docs/prometheus/latest/querying/functions/#rate),\n[`delta()`](https://prometheus.io/docs/prometheus/latest/querying/functions/#increase),\nand [`increase()`](https://prometheus.io/docs/prometheus/latest/querying/functions/#delta) functions.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false},{"name":"isCounter","headline":"isCounter: Data represents a counter.","description":null,"required":false},{"name":"isRate","headline":"isRate: Data represents a rate.","description":null,"required":false}],"flux_type":"(\n <-tables: stream[{A with _value: float, _time: time, _stop: time, _start: time}],\n ?isCounter: bool,\n ?isRate: bool,\n) => stream[{B with _value: float}]","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":82,"column":1},"end":{"line":86,"column":40},"source":"builtin extrapolatedRate : (\n <-tables: stream[{A with _start: time, _stop: time, _time: time, _value: float}],\n ?isCounter: bool,\n ?isRate: bool,\n ) => stream[{B with _value: float}]"},"examples":[],"metadata":null},"holtWinters":{"kind":"Function","name":"holtWinters","headline":"holtWinters implements functionality equivalent to\n[PromQL's `holt_winters()` function](https://prometheus.io/docs/prometheus/latest/querying/functions/#holt_winters).","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false},{"name":"smoothingFactor","headline":"smoothingFactor: Exponential smoothing factor.","description":null,"required":false},{"name":"trendFactor","headline":"trendFactor: Trend factor.","description":null,"required":false}],"flux_type":"(\n <-tables: stream[{A with _value: float, _time: time}],\n ?smoothingFactor: float,\n ?trendFactor: float,\n) => stream[{B with _value: float}]","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":97,"column":1},"end":{"line":101,"column":40},"source":"builtin holtWinters : (\n <-tables: stream[{A with _time: time, _value: float}],\n ?smoothingFactor: float,\n ?trendFactor: float,\n ) => stream[{B with _value: float}]"},"examples":[],"metadata":null},"instantRate":{"kind":"Function","name":"instantRate","headline":"instantRate is a helper function that calculates instant rates over\ncounters and is used to implement PromQL's\n[`irate()`](https://prometheus.io/docs/prometheus/latest/querying/functions/#irate) and\n[`idelta()`](https://prometheus.io/docs/prometheus/latest/querying/functions/#idelta) functions.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Defaults is piped-forward data (`<-`).","description":null,"required":false},{"name":"isRate","headline":"isRate: Data represents a rate.","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: float, _time: time}], ?isRate: bool) => stream[{B with _value: float}]","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":122,"column":1},"end":{"line":125,"column":40},"source":"builtin instantRate : (\n <-tables: stream[{A with _time: time, _value: float}],\n ?isRate: bool,\n ) => stream[{B with _value: float}]"},"examples":[],"metadata":null},"join":{"kind":"Function","name":"join","headline":"join joins two streams of tables on the **group key and `_time` column**.\nSee [`experimental.join`](https://docs.influxdata.com/flux/v0.x/stdlib/experimental/join/).","description":null,"parameters":[{"name":"left","headline":"left: First of two streams of tables to join.","description":null,"required":true},{"name":"right","headline":"right: Second of two streams of tables to join.","description":null,"required":true},{"name":"fn","headline":"fn: Function with left and right arguments that maps a new output record\n using values from the `left` and `right` input records.\n The return value must be a record.","description":null,"required":true}],"flux_type":"(fn: (left: A, right: B) => C, left: stream[A], right: stream[B]) => stream[C] where A: Record, B: Record, C: Record","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":274,"column":1},"end":{"line":274,"column":25},"source":"join = experimental.join"},"examples":[],"metadata":null},"labelReplace":{"kind":"Function","name":"labelReplace","headline":"labelReplace implements functionality equivalent to\n[PromQL's `label_replace()` function](https://prometheus.io/docs/prometheus/latest/querying/functions/#label_replace).","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false},{"name":"source","headline":"source: Input label.","description":null,"required":true},{"name":"destination","headline":"destination: Output label.","description":null,"required":true},{"name":"regex","headline":"regex: Pattern as a regex string.","description":null,"required":true},{"name":"replacement","headline":"replacement: Replacement value.","description":null,"required":true}],"flux_type":"(\n <-tables: stream[{A with _value: float}],\n destination: string,\n regex: string,\n replacement: string,\n source: string,\n) => stream[{B with _value: float}]","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":138,"column":1},"end":{"line":144,"column":40},"source":"builtin labelReplace : (\n <-tables: stream[{A with _value: float}],\n source: string,\n destination: string,\n regex: string,\n replacement: string,\n ) => stream[{B with _value: float}]"},"examples":[],"metadata":null},"linearRegression":{"kind":"Function","name":"linearRegression","headline":"linearRegression implements linear regression functionality required to implement\nPromQL's [`deriv()`](https://prometheus.io/docs/prometheus/latest/querying/functions/#deriv)\nand [`predict_linear()`](https://prometheus.io/docs/prometheus/latest/querying/functions/#predict_linear) functions.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false},{"name":"predict","headline":"predict: Output should contain a prediction.","description":null,"required":false},{"name":"fromNow","headline":"fromNow: Time as a floating point value.","description":null,"required":false}],"flux_type":"(\n <-tables: stream[{A with _value: float, _time: time, _stop: time}],\n ?fromNow: float,\n ?predict: bool,\n) => stream[{B with _value: float}]","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":156,"column":1},"end":{"line":160,"column":40},"source":"builtin linearRegression : (\n <-tables: stream[{A with _time: time, _stop: time, _value: float}],\n ?predict: bool,\n ?fromNow: float,\n ) => stream[{B with _value: float}]"},"examples":[],"metadata":null},"promHistogramQuantile":{"kind":"Function","name":"promHistogramQuantile","headline":"promHistogramQuantile implements functionality equivalent to\n[PromQL's `histogram_quantile()` function](https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_quantile).","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false},{"name":"quantile","headline":"quantile: Quantile to compute (`[0.0 - 1.0]`).","description":null,"required":false},{"name":"countColumn","headline":"countColumn: Count column name.","description":null,"required":false},{"name":"upperBoundColumn","headline":"upperBoundColumn: Upper bound column name.","description":null,"required":false},{"name":"valueColumn","headline":"valueColumn: Output value column name.","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n ?countColumn: string,\n ?quantile: float,\n ?upperBoundColumn: string,\n ?valueColumn: string,\n) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":191,"column":1},"end":{"line":200,"column":14},"source":"builtin promHistogramQuantile : (\n <-tables: stream[A],\n ?quantile: float,\n ?countColumn: string,\n ?upperBoundColumn: string,\n ?valueColumn: string,\n ) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":null},"promqlDayOfMonth":{"kind":"Function","name":"promqlDayOfMonth","headline":"promqlDayOfMonth implements functionality equivalent to\n[PromQL's `day_of_month()` function](https://prometheus.io/docs/prometheus/latest/querying/functions/#day_of_month).","description":null,"parameters":[{"name":"timestamp","headline":"timestamp: Time as a floating point value.","description":null,"required":true}],"flux_type":"(timestamp: float) => float","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":42,"column":1},"end":{"line":42,"column":55},"source":"builtin promqlDayOfMonth : (timestamp: float) => float"},"examples":[],"metadata":null},"promqlDayOfWeek":{"kind":"Function","name":"promqlDayOfWeek","headline":"promqlDayOfWeek implements functionality equivalent to\n[PromQL's `day_of_week()` function](https://prometheus.io/docs/prometheus/latest/querying/functions/#day_of_week).","description":null,"parameters":[{"name":"timestamp","headline":"timestamp: Time as a floating point value.","description":null,"required":true}],"flux_type":"(timestamp: float) => float","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":51,"column":1},"end":{"line":51,"column":54},"source":"builtin promqlDayOfWeek : (timestamp: float) => float"},"examples":[],"metadata":null},"promqlDaysInMonth":{"kind":"Function","name":"promqlDaysInMonth","headline":"promqlDaysInMonth implements functionality equivalent to\n[PromQL's `days_in_month()` function](https://prometheus.io/docs/prometheus/latest/querying/functions/#days_in_month).","description":null,"parameters":[{"name":"timestamp","headline":"timestamp: Time as a floating point value.","description":null,"required":true}],"flux_type":"(timestamp: float) => float","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":60,"column":1},"end":{"line":60,"column":56},"source":"builtin promqlDaysInMonth : (timestamp: float) => float"},"examples":[],"metadata":null},"promqlHour":{"kind":"Function","name":"promqlHour","headline":"promqlHour implements functionality equivalent to\n[PromQL's `hour()` function](https://prometheus.io/docs/prometheus/latest/querying/functions/#hour).","description":null,"parameters":[{"name":"timestamp","headline":"timestamp: Time as a floating point value.","description":null,"required":true}],"flux_type":"(timestamp: float) => float","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":110,"column":1},"end":{"line":110,"column":49},"source":"builtin promqlHour : (timestamp: float) => float"},"examples":[],"metadata":null},"promqlMinute":{"kind":"Function","name":"promqlMinute","headline":"promqlMinute implements functionality equivalent to\n[PromQL's `minute()` function]( https://prometheus.io/docs/prometheus/latest/querying/functions/#minute).","description":null,"parameters":[{"name":"timestamp","headline":"timestamp: Time as a floating point value.","description":null,"required":true}],"flux_type":"(timestamp: float) => float","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":169,"column":1},"end":{"line":169,"column":51},"source":"builtin promqlMinute : (timestamp: float) => float"},"examples":[],"metadata":null},"promqlMonth":{"kind":"Function","name":"promqlMonth","headline":"promqlMonth implements functionality equivalent to\n[PromQL's `month()` function](https://prometheus.io/docs/prometheus/latest/querying/functions/#month).","description":null,"parameters":[{"name":"timestamp","headline":"timestamp: Time as a floating point value.","description":null,"required":true}],"flux_type":"(timestamp: float) => float","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":178,"column":1},"end":{"line":178,"column":50},"source":"builtin promqlMonth : (timestamp: float) => float"},"examples":[],"metadata":null},"promqlYear":{"kind":"Function","name":"promqlYear","headline":"promqlYear implements functionality equivalent to\n[PromQL's `year()` function](https://prometheus.io/docs/prometheus/latest/querying/functions/#year).","description":null,"parameters":[{"name":"timestamp","headline":"timestamp: Time as a floating point value.","description":null,"required":true}],"flux_type":"(timestamp: float) => float","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":239,"column":1},"end":{"line":239,"column":49},"source":"builtin promqlYear : (timestamp: float) => float"},"examples":[],"metadata":null},"quantile":{"kind":"Function","name":"quantile","headline":"quantile accounts checks for quantile values that are out of range, above 1.0 or\nbelow 0.0, by either returning positive infinity or negative infinity in the `_value`\ncolumn respectively. `q` must be a float.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false},{"name":"q","headline":"q: Quantile to compute (`[0.0 - 1.0]`).","description":null,"required":true},{"name":"method","headline":"method: Quantile method to use.","description":null,"required":false}],"flux_type":"(<-tables: stream[A], q: float, ?method: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":251,"column":1},"end":{"line":261,"column":99},"source":"quantile = (q, tables=<-, method=\"exact_mean\") =>\n // value is in normal range. We can use the normal quantile function\n if q <= 1.0 and q >= 0.0 then\n tables\n |> universe.quantile(q: q, method: method)\n else if q < 0.0 then\n tables\n |> reduce(identity: {_value: math.mInf(sign: -1)}, fn: (r, accumulator) => accumulator)\n else\n tables\n |> reduce(identity: {_value: math.mInf(sign: 1)}, fn: (r, accumulator) => accumulator)"},"examples":[],"metadata":null},"resets":{"kind":"Function","name":"resets","headline":"resets implements functionality equivalent to\n[PromQL's `resets()` function](https://prometheus.io/docs/prometheus/latest/querying/functions/#resets).","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Defaults is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: float}]) => stream[{B with _value: float}]","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":209,"column":1},"end":{"line":209,"column":94},"source":"builtin resets : (<-tables: stream[{A with _value: float}]) => stream[{B with _value: float}]"},"examples":[],"metadata":null},"timestamp":{"kind":"Function","name":"timestamp","headline":"timestamp implements functionality equivalent to\n[PromQL's `timestamp()` function](https://prometheus.io/docs/prometheus/latest/querying/functions/#timestamp).","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Defaults is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: float}]) => stream[{A with _value: float}]","is_option":false,"source_location":{"file":"internal/promql/promql.flux","start":{"line":230,"column":1},"end":{"line":230,"column":97},"source":"builtin timestamp : (<-tables: stream[{A with _value: float}]) => stream[{A with _value: float}]"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.47.0"}},{"path":"internal/testing","name":"testing","headline":"Package testing provides functions for testing Flux operations.","description":null,"members":{"assertMatches":{"kind":"Function","name":"assertMatches","headline":"assertMatches tests whether a string matches a given regex.","description":null,"parameters":[{"name":"got","headline":"got: Value to test.","description":null,"required":true},{"name":"want","headline":"want: Regex to test against.","description":null,"required":true}],"flux_type":"(got: string, want: regexp) => stream[{v: string, _diff: string}]","is_option":false,"source_location":{"file":"internal/testing/testing.flux","start":{"line":67,"column":1},"end":{"line":73,"column":2},"source":"assertMatches = (got, want) => {\n return\n if got =~ want then\n testing.assertEqualValues(got: \"\", want: \"\")\n else\n die(msg: \"Regex `${regexp.getString(r: want)}` does not match `${got}`\")\n}"},"examples":[],"metadata":{"introduced":"LATEST","tags":"tests"}},"shouldErrorWithCode":{"kind":"Function","name":"shouldErrorWithCode","headline":"shouldErrorWithCode calls a function that catches any error and checks that the error matches the expected value.","description":null,"parameters":[{"name":"fn","headline":"fn: Function to call.","description":null,"required":true},{"name":"want","headline":"want: Regular expression to match the expected error.","description":null,"required":true},{"name":"code","headline":"code: Which flux error code to expect","description":null,"required":true}],"flux_type":"(code: uint, fn: () => A, want: regexp) => stream[{match: bool, code: uint, _diff: string}]","is_option":false,"source_location":{"file":"internal/testing/testing.flux","start":{"line":35,"column":1},"end":{"line":46,"column":2},"source":"shouldErrorWithCode = (fn, want, code) => {\n got = experimental.catch(fn)\n\n return\n if exists got.msg then\n testing.diff(\n got: array.from(rows: [{code: got.code, match: got.msg =~ want}]),\n want: array.from(rows: [{code: code, match: true}]),\n )\n else\n die(msg: \"shouldErrorWithCode expected an error\")\n}"},"examples":[],"metadata":{"introduced":"0.182.0","tags":"tests"}}},"examples":[],"metadata":{"introduced":"0.182.0"}},{"path":"internal/testutil","name":"testutil","headline":"Package testutil provides helper function for writing test cases.","description":null,"members":{"fail":{"kind":"Function","name":"fail","headline":"fail causes the current script to fail.","description":null,"parameters":[],"flux_type":"() => bool","is_option":false,"source_location":{"file":"internal/testutil/testutil.flux","start":{"line":9,"column":1},"end":{"line":9,"column":26},"source":"builtin fail : () => bool"},"examples":[],"metadata":null},"makeAny":{"kind":"Function","name":"makeAny","headline":"makeAny constructs any value based on a type description as a string.","description":null,"parameters":[{"name":"typ","headline":"typ: Description of the type to create.","description":null,"required":true}],"flux_type":"(typ: string) => A","is_option":false,"source_location":{"file":"internal/testutil/testutil.flux","start":{"line":27,"column":1},"end":{"line":27,"column":37},"source":"builtin makeAny : (typ: string) => A"},"examples":[],"metadata":null},"makeRecord":{"kind":"Function","name":"makeRecord","headline":"makeRecord is the identity function, but breaks the type connection from input to output.","description":null,"parameters":[{"name":"o","headline":"o: Record value.","description":null,"required":true}],"flux_type":"(o: A) => B where A: Record, B: Record","is_option":false,"source_location":{"file":"internal/testutil/testutil.flux","start":{"line":21,"column":1},"end":{"line":21,"column":60},"source":"builtin makeRecord : (o: A) => B where A: Record, B: Record"},"examples":[],"metadata":null},"yield":{"kind":"Function","name":"yield","headline":"yield is the identity function.","description":null,"parameters":[{"name":"v","headline":"v: Any value.","description":null,"required":false}],"flux_type":"(<-v: A) => A","is_option":false,"source_location":{"file":"internal/testutil/testutil.flux","start":{"line":15,"column":1},"end":{"line":15,"column":30},"source":"builtin yield : (<-v: A) => A"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.68.0"}},{"path":"interpolate","name":"interpolate","headline":"Package interpolate provides functions that insert rows for missing data\nat regular intervals and estimate values using different interpolation methods.","description":null,"members":{"linear":{"kind":"Function","name":"linear","headline":"linear inserts rows at regular intervals using linear interpolation to\ndetermine values for inserted rows.","description":null,"parameters":[{"name":"every","headline":"every: Duration of time between interpolated points.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: float, _time: time}], every: duration) => stream[{A with _value: float, _time: time}]","is_option":false,"source_location":{"file":"interpolate/interpolate.flux","start":{"line":45,"column":1},"end":{"line":48,"column":53},"source":"builtin linear : (\n <-tables: stream[{T with _time: time, _value: float}],\n every: duration,\n ) => stream[{T with _time: time, _value: float}]"},"examples":[],"metadata":{"tags":"transformations"}}},"examples":[],"metadata":{"introduced":"0.87.0"}},{"path":"join","name":"join","headline":"Package join provides functions that join two table streams together.","description":null,"members":{"full":{"kind":"Function","name":"full","headline":"full performs a full outer join on two table streams.","description":null,"parameters":[{"name":"left","headline":"left: Left input stream. Default is piped-forward data (<-).","description":null,"required":false},{"name":"right","headline":"right: Right input stream.","description":null,"required":true},{"name":"on","headline":"on: Function that takes a left and right record (`l`, and `r` respectively), and returns a boolean.","description":null,"required":true},{"name":"as","headline":"as: Function that takes a left and a right record (`l` and `r` respectively), and returns a record.\n The returned record is included in the final output.","description":null,"required":true}],"flux_type":"(<-left: stream[A], as: (l: A, r: B) => C, on: (l: A, r: B) => bool, right: stream[B]) => stream[C] where A: Record, B: Record, C: Record","is_option":false,"source_location":{"file":"join/join.flux","start":{"line":392,"column":1},"end":{"line":399,"column":6},"source":"full = (left=<-, right, on, as) =>\n tables(\n left: left,\n right: right,\n on: on,\n as: as,\n method: \"full\",\n )"},"examples":[],"metadata":{"introduced":"0.172.0","tags":"transformations"}},"inner":{"kind":"Function","name":"inner","headline":"inner performs an inner join on two table streams.","description":null,"parameters":[{"name":"left","headline":"left: Left input stream. Default is piped-forward data (<-).","description":null,"required":false},{"name":"right","headline":"right: Right input stream.","description":null,"required":true},{"name":"on","headline":"on: Function that takes a left and right record (`l`, and `r` respectively), and returns a boolean.","description":null,"required":true},{"name":"as","headline":"as: Function that takes a left and a right record (`l` and `r` respectively), and returns a record.\n The returned record is included in the final output.","description":null,"required":true}],"flux_type":"(<-left: stream[A], as: (l: A, r: B) => C, on: (l: A, r: B) => bool, right: stream[B]) => stream[C] where A: Record, B: Record, C: Record","is_option":false,"source_location":{"file":"join/join.flux","start":{"line":311,"column":1},"end":{"line":318,"column":6},"source":"inner = (left=<-, right, on, as) =>\n tables(\n left: left,\n right: right,\n on: on,\n as: as,\n method: \"inner\",\n )"},"examples":[],"metadata":{"introduced":"0.172.0","tags":"transformations"}},"left":{"kind":"Function","name":"left","headline":"left performs a left outer join on two table streams.","description":null,"parameters":[{"name":"left","headline":"left: Left input stream. Default is piped-forward data (<-).","description":null,"required":false},{"name":"right","headline":"right: Right input stream.","description":null,"required":true},{"name":"on","headline":"on: Function that takes a left and right record (`l`, and `r` respectively), and returns a boolean.","description":null,"required":true},{"name":"as","headline":"as: Function that takes a left and a right record (`l` and `r` respectively), and returns a record.\n The returned record is included in the final output.","description":null,"required":true}],"flux_type":"(<-left: stream[A], as: (l: A, r: B) => C, on: (l: A, r: B) => bool, right: stream[B]) => stream[C] where A: Record, B: Record, C: Record","is_option":false,"source_location":{"file":"join/join.flux","start":{"line":460,"column":1},"end":{"line":467,"column":6},"source":"left = (left=<-, right, on, as) =>\n tables(\n left: left,\n right: right,\n on: on,\n as: as,\n method: \"left\",\n )"},"examples":[],"metadata":{"introduced":"0.172.0","tags":"transformations"}},"right":{"kind":"Function","name":"right","headline":"right performs a right outer join on two table streams.","description":null,"parameters":[{"name":"left","headline":"left: Left input stream. Default is piped-forward data (<-).","description":null,"required":false},{"name":"right","headline":"right: Right input stream.","description":null,"required":true},{"name":"on","headline":"on: Function that takes a left and right record (`l`, and `r` respectively), and returns a boolean.","description":null,"required":true},{"name":"as","headline":"as: Function that takes a left and a right record (`l` and `r` respectively), and returns a record.\n The returned record is included in the final output.","description":null,"required":true}],"flux_type":"(<-left: stream[A], as: (l: A, r: B) => C, on: (l: A, r: B) => bool, right: stream[B]) => stream[C] where A: Record, B: Record, C: Record","is_option":false,"source_location":{"file":"join/join.flux","start":{"line":528,"column":1},"end":{"line":535,"column":6},"source":"right = (left=<-, right, on, as) =>\n tables(\n left: left,\n right: right,\n on: on,\n as: as,\n method: \"right\",\n )"},"examples":[],"metadata":{"introduced":"0.172.0","tags":"transformations"}},"tables":{"kind":"Function","name":"tables","headline":"tables joins two input streams together using a specified method, predicate, and a function to join two corresponding records, one from each input stream.","description":null,"parameters":[{"name":"left","headline":"left: Left input stream. Default is piped-forward data (`<-`).","description":null,"required":false},{"name":"right","headline":"right: Right input stream.","description":null,"required":true},{"name":"on","headline":"on: Function that takes a left and right record (`l`, and `r` respectively), and returns a boolean.","description":null,"required":true},{"name":"as","headline":"as: Function that takes a left and a right record (`l` and `r` respectively), and returns a record.\n The returned record is included in the final output.","description":null,"required":true},{"name":"method","headline":"method: String that specifies the join method.","description":null,"required":true}],"flux_type":"(\n <-left: stream[A],\n as: (l: A, r: B) => C,\n method: string,\n on: (l: A, r: B) => bool,\n right: stream[B],\n) => stream[C] where A: Record, B: Record, C: Record","is_option":false,"source_location":{"file":"join/join.flux","start":{"line":216,"column":1},"end":{"line":226,"column":14},"source":"builtin tables : (\n <-left: stream[L],\n right: stream[R],\n on: (l: L, r: R) => bool,\n as: (l: L, r: R) => A,\n method: string,\n ) => stream[A]\n where\n A: Record,\n L: Record,\n R: Record"},"examples":[],"metadata":{"introduced":"0.172.0","tags":"transformations"}},"time":{"kind":"Function","name":"time","headline":"time joins two table streams together exclusively on the `_time` column.","description":null,"parameters":[{"name":"left","headline":"left: Left input stream. Default is piped-forward data (<-).","description":null,"required":false},{"name":"right","headline":"right: Right input stream.","description":null,"required":true},{"name":"as","headline":"as: Function that takes a left and a right record (`l` and `r` respectively), and returns a record.\n The returned record is included in the final output.","description":null,"required":true},{"name":"method","headline":"method: String that specifies the join method. Default is `inner`.","description":null,"required":false}],"flux_type":"(\n <-left: stream[{A with _time: B}],\n as: (l: {A with _time: B}, r: {C with _time: D}) => E,\n right: stream[{C with _time: D}],\n ?method: string,\n) => stream[E] where B: Equatable, D: Equatable, E: Record","is_option":false,"source_location":{"file":"join/join.flux","start":{"line":265,"column":1},"end":{"line":272,"column":6},"source":"time = (left=<-, right, as, method=\"inner\") =>\n tables(\n left: left,\n right: right,\n on: (l, r) => l._time == r._time,\n as: as,\n method: method,\n )"},"examples":[],"metadata":{"introduced":"0.172.0","tags":"transformations"}}},"examples":[],"metadata":{"introduced":"0.172.0","tags":"transformations"}},{"path":"json","name":"json","headline":"Package json provides tools for working with JSON.","description":null,"members":{"encode":{"kind":"Function","name":"encode","headline":"encode converts a value into JSON bytes.","description":null,"parameters":[{"name":"v","headline":"v: Value to convert.","description":null,"required":true}],"flux_type":"(v: A) => bytes","is_option":false,"source_location":{"file":"json/json.flux","start":{"line":38,"column":1},"end":{"line":38,"column":33},"source":"builtin encode : (v: A) => bytes"},"examples":[],"metadata":{"tags":"type-conversions"}}},"examples":[],"metadata":{"introduced":"0.40.0"}},{"path":"kafka","name":"kafka","headline":"Package kafka provides tools for working with [Apache Kafka](https://kafka.apache.org/).","description":null,"members":{"to":{"kind":"Function","name":"to","headline":"to sends data to [Apache Kafka](https://kafka.apache.org/) brokers.","description":null,"parameters":[{"name":"brokers","headline":"brokers: List of Kafka brokers to send data to.","description":null,"required":true},{"name":"topic","headline":"topic: Kafka topic to send data to.","description":null,"required":true},{"name":"balancer","headline":"balancer: Kafka load balancing strategy. Default is `hash`.","description":null,"required":false},{"name":"name","headline":"name: Kafka metric name. Default is the value of the `nameColumn`.","description":null,"required":false},{"name":"nameColumn","headline":"nameColumn: Column to use as the Kafka metric name.\n Default is `_measurement`.","description":null,"required":false},{"name":"timeColumn","headline":"timeColumn: Time column. Default is `_time`.","description":null,"required":false},{"name":"tagColumns","headline":"tagColumns: List of tag columns in input data.","description":null,"required":false},{"name":"valueColumns","headline":"valueColumns: List of value columns in input data. Default is `[\"_value\"]`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n brokers: [string],\n topic: string,\n ?balancer: string,\n ?name: string,\n ?nameColumn: string,\n ?tagColumns: [string],\n ?timeColumn: string,\n ?valueColumns: [string],\n) => stream[A] where A: Record","is_option":false,"source_location":{"file":"kafka/kafka.flux","start":{"line":49,"column":1},"end":{"line":61,"column":14},"source":"builtin to : (\n <-tables: stream[A],\n brokers: [string],\n topic: string,\n ?balancer: string,\n ?name: string,\n ?nameColumn: string,\n ?timeColumn: string,\n ?tagColumns: [string],\n ?valueColumns: [string],\n ) => stream[A]\n where\n A: Record"},"examples":[],"metadata":{"tags":"outputs"}}},"examples":[],"metadata":{"introduced":"0.14.0","tags":"kafka"}},{"path":"math","name":"math","headline":"Package math provides basic constants and mathematical functions.","description":null,"members":{"NaN":{"kind":"Function","name":"NaN","headline":"NaN returns a IEEE 754 \"not-a-number\" value.","description":null,"parameters":[],"flux_type":"() => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1704,"column":1},"end":{"line":1704,"column":26},"source":"builtin NaN : () => float"},"examples":[],"metadata":null},"abs":{"kind":"Function","name":"abs","headline":"abs returns the absolute value of `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":86,"column":1},"end":{"line":86,"column":34},"source":"builtin abs : (x: float) => float"},"examples":[],"metadata":null},"acos":{"kind":"Function","name":"acos","headline":"acos returns the acosine of `x` in radians.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":123,"column":1},"end":{"line":123,"column":35},"source":"builtin acos : (x: float) => float"},"examples":[],"metadata":null},"acosh":{"kind":"Function","name":"acosh","headline":"acosh returns the inverse hyperbolic cosine of `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":160,"column":1},"end":{"line":160,"column":36},"source":"builtin acosh : (x: float) => float"},"examples":[],"metadata":null},"asin":{"kind":"Function","name":"asin","headline":"asin returns the arcsine of `x` in radians.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":198,"column":1},"end":{"line":198,"column":35},"source":"builtin asin : (x: float) => float"},"examples":[],"metadata":null},"asinh":{"kind":"Function","name":"asinh","headline":"asinh returns the inverse hyperbolic sine of `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":231,"column":1},"end":{"line":231,"column":36},"source":"builtin asinh : (x: float) => float"},"examples":[],"metadata":null},"atan":{"kind":"Function","name":"atan","headline":"atan returns the arctangent of `x` in radians.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":263,"column":1},"end":{"line":263,"column":35},"source":"builtin atan : (x: float) => float"},"examples":[],"metadata":null},"atan2":{"kind":"Function","name":"atan2","headline":"atan2 returns the artangent of `x/y`, using the signs\nof the two to determine the quadrant of the return value.","description":null,"parameters":[{"name":"y","headline":"y: y-coordinate to use in the operation.","description":null,"required":true},{"name":"x","headline":"x: x-corrdinate to use in the operation.","description":null,"required":true}],"flux_type":"(x: float, y: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":322,"column":1},"end":{"line":322,"column":46},"source":"builtin atan2 : (y: float, x: float) => float"},"examples":[],"metadata":null},"atanh":{"kind":"Function","name":"atanh","headline":"atanh returns the inverse hyperbolic tangent of `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":363,"column":1},"end":{"line":363,"column":36},"source":"builtin atanh : (x: float) => float"},"examples":[],"metadata":null},"cbrt":{"kind":"Function","name":"cbrt","headline":"cbrt returns the cube root of x.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":396,"column":1},"end":{"line":396,"column":35},"source":"builtin cbrt : (x: float) => float"},"examples":[],"metadata":null},"ceil":{"kind":"Function","name":"ceil","headline":"ceil returns the least integer value greater than or equal to `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":429,"column":1},"end":{"line":429,"column":35},"source":"builtin ceil : (x: float) => float"},"examples":[],"metadata":null},"copysign":{"kind":"Function","name":"copysign","headline":"copysign returns a value with the magnitude `x` and the sign of `y`.","description":null,"parameters":[{"name":"x","headline":"x: Magnitude to use in the operation.","description":null,"required":true},{"name":"y","headline":"y: Sign to use in the operation.","description":null,"required":true}],"flux_type":"(x: float, y: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":465,"column":1},"end":{"line":465,"column":49},"source":"builtin copysign : (x: float, y: float) => float"},"examples":[],"metadata":null},"cos":{"kind":"Function","name":"cos","headline":"cos returns the cosine of the radian argument `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":497,"column":1},"end":{"line":497,"column":34},"source":"builtin cos : (x: float) => float"},"examples":[],"metadata":null},"cosh":{"kind":"Function","name":"cosh","headline":"cosh returns the hyperbolic cosine of `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":530,"column":1},"end":{"line":530,"column":35},"source":"builtin cosh : (x: float) => float"},"examples":[],"metadata":null},"dim":{"kind":"Function","name":"dim","headline":"dim returns the maximum of `x - y` or `0`.","description":null,"parameters":[{"name":"x","headline":"x: x-value to use in the operation.","description":null,"required":true},{"name":"y","headline":"y: y-value to use in the operation.","description":null,"required":true}],"flux_type":"(x: float, y: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":575,"column":1},"end":{"line":575,"column":44},"source":"builtin dim : (x: float, y: float) => float"},"examples":[],"metadata":null},"e":{"kind":"Value","name":"e","headline":"e represents the base of the natural logarithm, also known as Euler's number.","description":null,"flux_type":"float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":12,"column":1},"end":{"line":12,"column":18},"source":"builtin e : float"},"examples":[],"metadata":null},"erf":{"kind":"Function","name":"erf","headline":"erf returns the error function of `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":608,"column":1},"end":{"line":608,"column":34},"source":"builtin erf : (x: float) => float"},"examples":[],"metadata":null},"erfc":{"kind":"Function","name":"erfc","headline":"erfc returns the complementary error function of `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":641,"column":1},"end":{"line":641,"column":35},"source":"builtin erfc : (x: float) => float"},"examples":[],"metadata":null},"erfcinv":{"kind":"Function","name":"erfcinv","headline":"erfcinv returns the inverse of `math.erfc()`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":682,"column":1},"end":{"line":682,"column":38},"source":"builtin erfcinv : (x: float) => float"},"examples":[],"metadata":null},"erfinv":{"kind":"Function","name":"erfinv","headline":"erfinv returns the inverse error function of `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":723,"column":1},"end":{"line":723,"column":37},"source":"builtin erfinv : (x: float) => float"},"examples":[],"metadata":null},"exp":{"kind":"Function","name":"exp","headline":"exp returns `e**x`, the base-e exponential of `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":755,"column":1},"end":{"line":755,"column":34},"source":"builtin exp : (x: float) => float"},"examples":[],"metadata":null},"exp2":{"kind":"Function","name":"exp2","headline":"exp2 returns `2**x`, the base-2 exponential of `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":789,"column":1},"end":{"line":789,"column":35},"source":"builtin exp2 : (x: float) => float"},"examples":[],"metadata":null},"expm1":{"kind":"Function","name":"expm1","headline":"expm1 returns `e**x - 1`, the base-e exponential of `x` minus 1.\nIt is more accurate than `math.exp(x:x) - 1` when `x` is near zero.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":827,"column":1},"end":{"line":827,"column":36},"source":"builtin expm1 : (x: float) => float"},"examples":[],"metadata":null},"float64bits":{"kind":"Function","name":"float64bits","headline":"float64bits returns the IEEE 754 binary representation of `f`,\nwith the sign bit of `f` and the result in the same bit position.","description":null,"parameters":[{"name":"f","headline":"f: Value to operate on.","description":null,"required":true}],"flux_type":"(f: float) => uint","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":853,"column":1},"end":{"line":853,"column":41},"source":"builtin float64bits : (f: float) => uint"},"examples":[],"metadata":null},"float64frombits":{"kind":"Function","name":"float64frombits","headline":"float64frombits returns the floating-point number corresponding to the IEE\n754 binary representation `b`, with the sign bit of `b` and the result in the\nsame bit position.","description":null,"parameters":[{"name":"b","headline":"b: Value to operate on.","description":null,"required":true}],"flux_type":"(b: uint) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":882,"column":1},"end":{"line":882,"column":45},"source":"builtin float64frombits : (b: uint) => float"},"examples":[],"metadata":null},"floor":{"kind":"Function","name":"floor","headline":"floor returns the greatest integer value less than or equal to `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":915,"column":1},"end":{"line":915,"column":36},"source":"builtin floor : (x: float) => float"},"examples":[],"metadata":null},"frexp":{"kind":"Function","name":"frexp","headline":"frexp breaks `f` into a normalized fraction and an integral part of two.","description":null,"parameters":[{"name":"f","headline":"f: Value to operate on.","description":null,"required":true}],"flux_type":"(f: float) => {frac: float, exp: int}","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":957,"column":1},"end":{"line":957,"column":54},"source":"builtin frexp : (f: float) => {frac: float, exp: int}"},"examples":[],"metadata":null},"gamma":{"kind":"Function","name":"gamma","headline":"gamma returns the gamma function of `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":993,"column":1},"end":{"line":993,"column":36},"source":"builtin gamma : (x: float) => float"},"examples":[],"metadata":null},"hypot":{"kind":"Function","name":"hypot","headline":"hypot returns the square root of `p*p + q*q`, taking care to avoid overflow\nand underflow.","description":null,"parameters":[{"name":"p","headline":"p: p-value to use in the operation.","description":null,"required":true},{"name":"q","headline":"q: q-value to use in the operation.","description":null,"required":true}],"flux_type":"(p: float, q: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1039,"column":1},"end":{"line":1039,"column":46},"source":"builtin hypot : (p: float, q: float) => float"},"examples":[],"metadata":null},"ilogb":{"kind":"Function","name":"ilogb","headline":"ilogb returns the binary exponent of `x` as an integer.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => int","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1072,"column":1},"end":{"line":1072,"column":34},"source":"builtin ilogb : (x: float) => int"},"examples":[],"metadata":null},"isInf":{"kind":"Function","name":"isInf","headline":"isInf reports whether `f` is an infinity, according to `sign`.","description":null,"parameters":[{"name":"f","headline":"f: is the value used in the evaluation.","description":null,"required":true},{"name":"sign","headline":"sign: is the sign used in the eveluation.","description":null,"required":true}],"flux_type":"(f: float, sign: int) => bool","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1131,"column":1},"end":{"line":1131,"column":46},"source":"builtin isInf : (f: float, sign: int) => bool"},"examples":[],"metadata":null},"isNaN":{"kind":"Function","name":"isNaN","headline":"isNaN reports whether `f` is an IEEE 754 \"not-a-number\" value.","description":null,"parameters":[{"name":"f","headline":"f: Value to operate on.","description":null,"required":true}],"flux_type":"(f: float) => bool","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1159,"column":1},"end":{"line":1159,"column":35},"source":"builtin isNaN : (f: float) => bool"},"examples":[],"metadata":null},"j0":{"kind":"Function","name":"j0","headline":"j0 returns the order-zero Bessel function of the first kind.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1192,"column":1},"end":{"line":1192,"column":33},"source":"builtin j0 : (x: float) => float"},"examples":[],"metadata":null},"j1":{"kind":"Function","name":"j1","headline":"j1 is a funciton that returns the order-one Bessel function for the first kind.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1224,"column":1},"end":{"line":1224,"column":33},"source":"builtin j1 : (x: float) => float"},"examples":[],"metadata":null},"jn":{"kind":"Function","name":"jn","headline":"jn returns the order-n Bessel funciton of the first kind.","description":null,"parameters":[{"name":"n","headline":"n: Order number.","description":null,"required":true},{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(n: int, x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1257,"column":1},"end":{"line":1257,"column":41},"source":"builtin jn : (n: int, x: float) => float"},"examples":[],"metadata":null},"ldexp":{"kind":"Function","name":"ldexp","headline":"ldexp is the inverse of `math.frexp()`. It returns `frac x 2**exp`.","description":null,"parameters":[{"name":"frac","headline":"frac: Fraction to use in the operation.","description":null,"required":true},{"name":"exp","headline":"exp: Exponent to use in the operation.","description":null,"required":true}],"flux_type":"(exp: int, frac: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1309,"column":1},"end":{"line":1309,"column":49},"source":"builtin ldexp : (frac: float, exp: int) => float"},"examples":[],"metadata":null},"lgamma":{"kind":"Function","name":"lgamma","headline":"lgamma returns the natural logarithm and sign (-1 or +1) of `math.gamma(x:x)`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => {sign: int, lgamma: float}","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1350,"column":1},"end":{"line":1350,"column":58},"source":"builtin lgamma : (x: float) => {lgamma: float, sign: int}"},"examples":[],"metadata":null},"ln10":{"kind":"Value","name":"ln10","headline":"ln10 represents the natural logarithm of 10.","description":null,"flux_type":"float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":36,"column":1},"end":{"line":36,"column":21},"source":"builtin ln10 : float"},"examples":[],"metadata":null},"ln2":{"kind":"Value","name":"ln2","headline":"ln2 represents the natural logarithm of 2.","description":null,"flux_type":"float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":30,"column":1},"end":{"line":30,"column":20},"source":"builtin ln2 : float"},"examples":[],"metadata":null},"log":{"kind":"Function","name":"log","headline":"log returns the natural logarithm of `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1384,"column":1},"end":{"line":1384,"column":34},"source":"builtin log : (x: float) => float"},"examples":[],"metadata":null},"log10":{"kind":"Function","name":"log10","headline":"log10 returns the decimal logarithm of x.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1418,"column":1},"end":{"line":1418,"column":36},"source":"builtin log10 : (x: float) => float"},"examples":[],"metadata":null},"log10e":{"kind":"Value","name":"log10e","headline":"log10e represents the base 10 logarithm of **e** (`math.e`).","description":null,"flux_type":"float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":39,"column":1},"end":{"line":39,"column":23},"source":"builtin log10e : float"},"examples":[],"metadata":null},"log1p":{"kind":"Function","name":"log1p","headline":"log1p returns the natural logarithm of 1 plus `x`.\nThis operation is more accurate than `math.log(x: 1 + x)` when `x` is\nnear zero.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1459,"column":1},"end":{"line":1459,"column":36},"source":"builtin log1p : (x: float) => float"},"examples":[],"metadata":null},"log2":{"kind":"Function","name":"log2","headline":"log2 is a function returns the binary logarithm of `x`.","description":null,"parameters":[{"name":"x","headline":"x: the value used in the operation.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1493,"column":1},"end":{"line":1493,"column":35},"source":"builtin log2 : (x: float) => float"},"examples":[],"metadata":null},"log2e":{"kind":"Value","name":"log2e","headline":"log2e represents the base 2 logarithm of **e** (`math.e`).","description":null,"flux_type":"float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":33,"column":1},"end":{"line":33,"column":22},"source":"builtin log2e : float"},"examples":[],"metadata":null},"logb":{"kind":"Function","name":"logb","headline":"logb returns the binary exponent of `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1526,"column":1},"end":{"line":1526,"column":35},"source":"builtin logb : (x: float) => float"},"examples":[],"metadata":null},"mInf":{"kind":"Function","name":"mInf","headline":"mInf returns positive infinity if `sign >= 0`, negative infinity\nif `sign < 0`.","description":null,"parameters":[{"name":"sign","headline":"sign: Value to operate on.","description":null,"required":true}],"flux_type":"(sign: int) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1098,"column":1},"end":{"line":1098,"column":36},"source":"builtin mInf : (sign: int) => float"},"examples":[],"metadata":null},"mMax":{"kind":"Function","name":"mMax","headline":"mMax returns the larger of `x` or `y`.","description":null,"parameters":[{"name":"x","headline":"x: x-value to use in the operation.","description":null,"required":true},{"name":"y","headline":"y: y-value to use in the operation.","description":null,"required":true}],"flux_type":"(x: float, y: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1567,"column":1},"end":{"line":1567,"column":45},"source":"builtin mMax : (x: float, y: float) => float"},"examples":[],"metadata":null},"mMin":{"kind":"Function","name":"mMin","headline":"mMin is a function taht returns the lessser of `x` or `y`.","description":null,"parameters":[{"name":"x","headline":"x: x-value to use in the operation.","description":null,"required":true},{"name":"y","headline":"y: y-value to use in the operation.","description":null,"required":true}],"flux_type":"(x: float, y: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1607,"column":1},"end":{"line":1607,"column":45},"source":"builtin mMin : (x: float, y: float) => float"},"examples":[],"metadata":null},"maxfloat":{"kind":"Value","name":"maxfloat","headline":"maxfloat represents the maximum float value.","description":null,"flux_type":"float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":42,"column":1},"end":{"line":42,"column":25},"source":"builtin maxfloat : float"},"examples":[],"metadata":null},"maxint":{"kind":"Value","name":"maxint","headline":"maxint represents the maximum integer value (`2^63 - 1`).","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":48,"column":1},"end":{"line":48,"column":21},"source":"builtin maxint : int"},"examples":[],"metadata":null},"maxuint":{"kind":"Value","name":"maxuint","headline":"maxuint representes the maximum unsigned integer value (`2^64 - 1`).","description":null,"flux_type":"uint","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":54,"column":1},"end":{"line":54,"column":23},"source":"builtin maxuint : uint"},"examples":[],"metadata":null},"minint":{"kind":"Value","name":"minint","headline":"minint represents the minimum integer value (`-2^63`).","description":null,"flux_type":"int","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":51,"column":1},"end":{"line":51,"column":21},"source":"builtin minint : int"},"examples":[],"metadata":null},"mod":{"kind":"Function","name":"mod","headline":"mod returns a floating-point remainder of `x/y`.","description":null,"parameters":[{"name":"x","headline":"x: x-value to use in the operation.","description":null,"required":true},{"name":"y","headline":"y: y-value to use in the operation.","description":null,"required":true}],"flux_type":"(x: float, y: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1651,"column":1},"end":{"line":1651,"column":44},"source":"builtin mod : (x: float, y: float) => float"},"examples":[],"metadata":null},"modf":{"kind":"Function","name":"modf","headline":"modf returns integer and fractional floating-point numbers that sum to `f`.","description":null,"parameters":[{"name":"f","headline":"f: Value to operate on.","description":null,"required":true}],"flux_type":"(f: float) => {int: float, frac: float}","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1691,"column":1},"end":{"line":1691,"column":55},"source":"builtin modf : (f: float) => {int: float, frac: float}"},"examples":[],"metadata":null},"nextafter":{"kind":"Function","name":"nextafter","headline":"nextafter returns the next representable float value after `x` towards `y`.","description":null,"parameters":[{"name":"x","headline":"x: x-value to use in the operation.","description":null,"required":true},{"name":"y","headline":"y: y-value to use in the operation.","description":null,"required":true}],"flux_type":"(x: float, y: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1741,"column":1},"end":{"line":1741,"column":50},"source":"builtin nextafter : (x: float, y: float) => float"},"examples":[],"metadata":null},"phi":{"kind":"Value","name":"phi","headline":"phi represents the [Golden Ratio](https://www.britannica.com/science/golden-ratio).","description":null,"flux_type":"float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":15,"column":1},"end":{"line":15,"column":20},"source":"builtin phi : float"},"examples":[],"metadata":null},"pi":{"kind":"Value","name":"pi","headline":"pi represents pi (π).","description":null,"flux_type":"float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":9,"column":1},"end":{"line":9,"column":19},"source":"builtin pi : float"},"examples":[],"metadata":null},"pow":{"kind":"Function","name":"pow","headline":"pow returns `x**y`, the base-x exponential of `y`.","description":null,"parameters":[{"name":"x","headline":"x: Base value to operate on.","description":null,"required":true},{"name":"y","headline":"y: Exponent value.","description":null,"required":true}],"flux_type":"(x: float, y: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1796,"column":1},"end":{"line":1796,"column":44},"source":"builtin pow : (x: float, y: float) => float"},"examples":[],"metadata":null},"pow10":{"kind":"Function","name":"pow10","headline":"pow10 returns 10**n, the base-10 exponential of `n`.","description":null,"parameters":[{"name":"n","headline":"n: Exponent value.","description":null,"required":true}],"flux_type":"(n: int) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1828,"column":1},"end":{"line":1828,"column":34},"source":"builtin pow10 : (n: int) => float"},"examples":[],"metadata":null},"remainder":{"kind":"Function","name":"remainder","headline":"remainder returns the IEEE 754 floating-point remainder of `x/y`.","description":null,"parameters":[{"name":"x","headline":"x: Numerator to use in the operation.","description":null,"required":true},{"name":"y","headline":"y: Denominator to use in the operation.","description":null,"required":true}],"flux_type":"(x: float, y: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1867,"column":1},"end":{"line":1867,"column":50},"source":"builtin remainder : (x: float, y: float) => float"},"examples":[],"metadata":null},"round":{"kind":"Function","name":"round","headline":"round returns the nearest integer, rounding half away from zero.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1900,"column":1},"end":{"line":1900,"column":36},"source":"builtin round : (x: float) => float"},"examples":[],"metadata":null},"roundtoeven":{"kind":"Function","name":"roundtoeven","headline":"roundtoeven returns the nearest integer, rounding ties to even.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1934,"column":1},"end":{"line":1934,"column":42},"source":"builtin roundtoeven : (x: float) => float"},"examples":[],"metadata":null},"signbit":{"kind":"Function","name":"signbit","headline":"signbit reports whether `x` is negative or negative zero.","description":null,"parameters":[{"name":"x","headline":"x: Value to evaluate.","description":null,"required":true}],"flux_type":"(x: float) => bool","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1961,"column":1},"end":{"line":1961,"column":37},"source":"builtin signbit : (x: float) => bool"},"examples":[],"metadata":null},"sin":{"kind":"Function","name":"sin","headline":"sin returns the sine of the radian argument `x`.","description":null,"parameters":[{"name":"x","headline":"x: Radian value to use in the operation.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":1994,"column":1},"end":{"line":1994,"column":34},"source":"builtin sin : (x: float) => float"},"examples":[],"metadata":null},"sincos":{"kind":"Function","name":"sincos","headline":"sincos returns the values of `math.sin(x:x)` and `math.cos(x:x)`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => {sin: float, cos: float}","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":2033,"column":1},"end":{"line":2033,"column":56},"source":"builtin sincos : (x: float) => {sin: float, cos: float}"},"examples":[],"metadata":null},"sinh":{"kind":"Function","name":"sinh","headline":"sinh returns the hyperbolic sine of `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":2066,"column":1},"end":{"line":2066,"column":35},"source":"builtin sinh : (x: float) => float"},"examples":[],"metadata":null},"smallestNonzeroFloat":{"kind":"Value","name":"smallestNonzeroFloat","headline":"smallestNonzeroFloat represents the smallest nonzero float value.","description":null,"flux_type":"float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":45,"column":1},"end":{"line":45,"column":37},"source":"builtin smallestNonzeroFloat : float"},"examples":[],"metadata":null},"sqrt":{"kind":"Function","name":"sqrt","headline":"sqrt returns the square root of `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":2100,"column":1},"end":{"line":2100,"column":35},"source":"builtin sqrt : (x: float) => float"},"examples":[],"metadata":null},"sqrt2":{"kind":"Value","name":"sqrt2","headline":"sqrt2 represents the square root of 2.","description":null,"flux_type":"float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":18,"column":1},"end":{"line":18,"column":22},"source":"builtin sqrt2 : float"},"examples":[],"metadata":null},"sqrte":{"kind":"Value","name":"sqrte","headline":"sqrte represents the square root of **e** (`math.e`).","description":null,"flux_type":"float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":21,"column":1},"end":{"line":21,"column":22},"source":"builtin sqrte : float"},"examples":[],"metadata":null},"sqrtphi":{"kind":"Value","name":"sqrtphi","headline":"sqrtphi represents the square root of phi (`math.phi`), the Golden Ratio.","description":null,"flux_type":"float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":27,"column":1},"end":{"line":27,"column":24},"source":"builtin sqrtphi : float"},"examples":[],"metadata":null},"sqrtpi":{"kind":"Value","name":"sqrtpi","headline":"sqrtpi represents the square root of pi (π).","description":null,"flux_type":"float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":24,"column":1},"end":{"line":24,"column":23},"source":"builtin sqrtpi : float"},"examples":[],"metadata":null},"tan":{"kind":"Function","name":"tan","headline":"tan returns the tangent of the radian argument `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":2133,"column":1},"end":{"line":2133,"column":34},"source":"builtin tan : (x: float) => float"},"examples":[],"metadata":null},"tanh":{"kind":"Function","name":"tanh","headline":"tanh returns the hyperbolic tangent of `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":2166,"column":1},"end":{"line":2166,"column":35},"source":"builtin tanh : (x: float) => float"},"examples":[],"metadata":null},"trunc":{"kind":"Function","name":"trunc","headline":"trunc returns the integer value of `x`.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":2199,"column":1},"end":{"line":2199,"column":36},"source":"builtin trunc : (x: float) => float"},"examples":[],"metadata":null},"y0":{"kind":"Function","name":"y0","headline":"y0 returns the order-zero Bessel function of the second kind.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":2233,"column":1},"end":{"line":2233,"column":33},"source":"builtin y0 : (x: float) => float"},"examples":[],"metadata":null},"y1":{"kind":"Function","name":"y1","headline":"y1 returns the order-one Bessel function of the second kind.","description":null,"parameters":[{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":2267,"column":1},"end":{"line":2267,"column":33},"source":"builtin y1 : (x: float) => float"},"examples":[],"metadata":null},"yn":{"kind":"Function","name":"yn","headline":"yn returns the order-n Bessel function of the second kind.","description":null,"parameters":[{"name":"n","headline":"n: Order number to use in the operation.","description":null,"required":true},{"name":"x","headline":"x: Value to operate on.","description":null,"required":true}],"flux_type":"(n: int, x: float) => float","is_option":false,"source_location":{"file":"math/math.flux","start":{"line":2313,"column":1},"end":{"line":2313,"column":41},"source":"builtin yn : (n: int, x: float) => float"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.22.0"}},{"path":"pagerduty","name":"pagerduty","headline":"Package pagerduty provides functions for sending data to PagerDuty.","description":null,"members":{"actionFromLevel":{"kind":"Function","name":"actionFromLevel","headline":"actionFromLevel converts a monitoring level to a PagerDuty action.","description":null,"parameters":[{"name":"level","headline":"level: Monitoring level to convert to a PagerDuty action.","description":null,"required":true}],"flux_type":"(level: string) => string","is_option":false,"source_location":{"file":"pagerduty/pagerduty.flux","start":{"line":121,"column":1},"end":{"line":121,"column":96},"source":"actionFromLevel = (level) => if strings.toLower(v: level) == \"ok\" then \"resolve\" else \"trigger\""},"examples":[],"metadata":null},"actionFromSeverity":{"kind":"Function","name":"actionFromSeverity","headline":"actionFromSeverity converts a severity to a PagerDuty action.","description":null,"parameters":[{"name":"severity","headline":"severity: Severity to convert to a PagerDuty action.","description":null,"required":true}],"flux_type":"(severity: string) => string","is_option":false,"source_location":{"file":"pagerduty/pagerduty.flux","start":{"line":98,"column":1},"end":{"line":102,"column":18},"source":"actionFromSeverity = (severity) =>\n if strings.toLower(v: severity) == \"ok\" then\n \"resolve\"\n else\n \"trigger\""},"examples":[],"metadata":null},"dedupKey":{"kind":"Function","name":"dedupKey","headline":"dedupKey uses the group key of an input table to generate and store a\ndeduplication key in the `_pagerdutyDedupKey`column.\nThe function sorts, newline-concatenates, SHA256-hashes, and hex-encodes the\ngroup key to create a unique deduplication key for each input table.","description":null,"parameters":[{"name":"exclude","headline":"exclude: Group key columns to exclude when generating the deduplication key.\n Default is [\"_start\", \"_stop\", \"_level\"].","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?exclude: [string]) => stream[{A with _pagerdutyDedupKey: string}]","is_option":false,"source_location":{"file":"pagerduty/pagerduty.flux","start":{"line":35,"column":1},"end":{"line":38,"column":53},"source":"builtin dedupKey : (\n <-tables: stream[A],\n ?exclude: [string],\n ) => stream[{A with _pagerdutyDedupKey: string}]"},"examples":[],"metadata":null},"defaultURL":{"kind":"Value","name":"defaultURL","headline":"defaultURL is the default PagerDuty URL used by functions in the `pagerduty` package.","description":null,"flux_type":"string","is_option":true,"source_location":{"file":"pagerduty/pagerduty.flux","start":{"line":41,"column":1},"end":{"line":41,"column":62},"source":"option defaultURL = \"https://events.pagerduty.com/v2/enqueue\""},"examples":[],"metadata":null},"endpoint":{"kind":"Function","name":"endpoint","headline":"endpoint returns a function that sends a message to PagerDuty that includes output data.","description":null,"parameters":[{"name":"url","headline":"url: PagerDuty v2 Events API URL.","description":null,"required":false}],"flux_type":"(\n ?url: string,\n) => (\n mapFn: (\n r: {A with _pagerdutyDedupKey: string},\n ) => {\n B with\n timestamp: K,\n summary: string,\n source: J,\n severity: I,\n routingKey: H,\n group: G,\n eventAction: F,\n clientURL: E,\n client: D,\n class: C,\n },\n) => (<-tables: stream[A]) => stream[{A with _status: string, _sent: string, _pagerdutyDedupKey: string, _body: string}]","is_option":false,"source_location":{"file":"pagerduty/pagerduty.flux","start":{"line":348,"column":1},"end":{"line":381,"column":18},"source":"endpoint = (url=defaultURL) =>\n (mapFn) =>\n (tables=<-) =>\n tables\n |> dedupKey()\n |> map(\n fn: (r) => {\n obj = mapFn(r: r)\n\n response =\n _sendEvent(\n pagerdutyURL: url,\n routingKey: obj.routingKey,\n client: obj.client,\n clientURL: obj.clientURL,\n dedupKey: r._pagerdutyDedupKey,\n class: obj.class,\n group: obj.group,\n severity: obj.severity,\n eventAction: obj.eventAction,\n source: obj.source,\n component: record.get(r: obj, key: \"component\", default: \"\"),\n summary: obj.summary,\n timestamp: obj.timestamp,\n customDetails:\n record.get(r: obj, key: \"customDetails\", default: record.any),\n )\n\n return {r with _sent: string(v: 2 == response.statusCode / 100),\n _status: string(v: response.statusCode),\n _body: string(v: response.body),\n }\n },\n )"},"examples":[],"metadata":{"tags":"notification endpoints, transformations"}},"sendEvent":{"kind":"Function","name":"sendEvent","headline":"sendEvent sends an event to PagerDuty and returns the HTTP response code of the request.","description":null,"parameters":[{"name":"pagerdutyURL","headline":"pagerdutyURL: PagerDuty endpoint URL.","description":null,"required":false},{"name":"routingKey","headline":"routingKey: Routing key generated from your PagerDuty integration.","description":null,"required":true},{"name":"client","headline":"client: Name of the client sending the alert.","description":null,"required":true},{"name":"clientURL","headline":"clientURL: URL of the client sending the alert.","description":null,"required":true},{"name":"dedupKey","headline":"dedupKey: Per-alert ID that acts as deduplication key and allows you to\n acknowledge or change the severity of previous messages.\n Supports a maximum of 255 characters.","description":null,"required":true},{"name":"class","headline":"class: Class or type of the event.","description":null,"required":true},{"name":"group","headline":"group: Logical grouping used by PagerDuty.","description":null,"required":true},{"name":"severity","headline":"severity: Severity of the event.","description":null,"required":true},{"name":"eventAction","headline":"eventAction: Event type to send to PagerDuty.","description":null,"required":true},{"name":"source","headline":"source: Unique location of the affected system.\n For example, the hostname or fully qualified domain name (FQDN).","description":null,"required":true},{"name":"component","headline":"component: Component responsible for the event.","description":null,"required":false},{"name":"summary","headline":"summary: Brief text summary of the event used as the summaries or titles of associated alerts.\n The maximum permitted length is 1024 characters.","description":null,"required":true},{"name":"timestamp","headline":"timestamp: Time the detected event occurred in RFC3339nano format.","description":null,"required":true},{"name":"customDetails","headline":"customDetails: Record with additional details about the event.","description":null,"required":false}],"flux_type":"(\n class: A,\n client: B,\n clientURL: C,\n dedupKey: D,\n eventAction: E,\n group: F,\n routingKey: G,\n severity: H,\n source: I,\n summary: string,\n timestamp: J,\n ?component: K,\n ?customDetails: L,\n ?pagerdutyURL: string,\n) => int where L: Equatable","is_option":false,"source_location":{"file":"pagerduty/pagerduty.flux","start":{"line":248,"column":1},"end":{"line":279,"column":17},"source":"sendEvent = (\n pagerdutyURL=defaultURL,\n routingKey,\n client,\n clientURL,\n dedupKey,\n class,\n group,\n severity,\n eventAction,\n source,\n component=\"\",\n summary,\n timestamp,\n customDetails=record.any,\n) =>\n _sendEvent(\n pagerdutyURL,\n routingKey,\n client,\n clientURL,\n dedupKey,\n class,\n group,\n severity,\n eventAction,\n source,\n component,\n summary,\n timestamp,\n customDetails,\n ).statusCode"},"examples":[],"metadata":{"tags":"single notification"}},"severityFromLevel":{"kind":"Function","name":"severityFromLevel","headline":"severityFromLevel converts an InfluxDB status level to a PagerDuty severity.","description":null,"parameters":[{"name":"level","headline":"level: InfluxDB status level to convert to a PagerDuty severity.","description":null,"required":true}],"flux_type":"(level: string) => string","is_option":false,"source_location":{"file":"pagerduty/pagerduty.flux","start":{"line":64,"column":1},"end":{"line":79,"column":2},"source":"severityFromLevel = (level) => {\n lvl = strings.toLower(v: level)\n sev =\n if lvl == \"warn\" then\n \"warning\"\n else if lvl == \"crit\" then\n \"critical\"\n else if lvl == \"info\" then\n \"info\"\n else if lvl == \"ok\" then\n \"info\"\n else\n \"error\"\n\n return sev\n}"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.43.0"}},{"path":"planner","name":"planner","headline":"Package planner provides an API for interacting with the Flux engine planner.","description":null,"members":{"disableLogicalRules":{"kind":"Value","name":"disableLogicalRules","headline":"disableLogicalRules is a set of logical planner rules that should NOT be applied.","description":null,"flux_type":"[string]","is_option":true,"source_location":{"file":"planner/planner.flux","start":{"line":6,"column":1},"end":{"line":6,"column":34},"source":"option disableLogicalRules = [\"\"]"},"examples":[],"metadata":null},"disablePhysicalRules":{"kind":"Value","name":"disablePhysicalRules","headline":"disablePhysicalRules is a set of physical planner rules that should NOT be applied.","description":null,"flux_type":"[string]","is_option":true,"source_location":{"file":"planner/planner.flux","start":{"line":9,"column":1},"end":{"line":9,"column":35},"source":"option disablePhysicalRules = [\"\"]"},"examples":[],"metadata":null}},"examples":[],"metadata":null},{"path":"profiler","name":"profiler","headline":"Package profiler provides performance profiling tools for Flux queries and operations.","description":null,"members":{"enabledProfilers":{"kind":"Value","name":"enabledProfilers","headline":"enabledProfilers is a list of profilers to enable during execution.","description":null,"flux_type":"[string]","is_option":true,"source_location":{"file":"profiler/profiler.flux","start":{"line":60,"column":1},"end":{"line":60,"column":31},"source":"option enabledProfilers = [\"\"]"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.82.0","tags":"optimize"}},{"path":"pushbullet","name":"pushbullet","headline":"Package pushbullet provides functions for sending data to Pushbullet.","description":null,"members":{"defaultURL":{"kind":"Value","name":"defaultURL","headline":"defaultURL is the default Pushbullet API URL used by functions in the `pushbullet` package.","description":null,"flux_type":"string","is_option":true,"source_location":{"file":"pushbullet/pushbullet.flux","start":{"line":13,"column":1},"end":{"line":13,"column":59},"source":"option defaultURL = \"https://api.pushbullet.com/v2/pushes\""},"examples":[],"metadata":null},"endpoint":{"kind":"Function","name":"endpoint","headline":"endpoint creates the endpoint for the Pushbullet API and sends a notification of type note.","description":null,"parameters":[{"name":"url","headline":"url: PushBullet API endpoint URL. Default is `\"https://api.pushbullet.com/v2/pushes\"`.","description":null,"required":false},{"name":"token","headline":"token: Pushbullet API token string. Default is `\"\"`.","description":null,"required":false}],"flux_type":"(\n ?token: A,\n ?url: string,\n) => (mapFn: (r: B) => {C with title: E, text: D}) => (<-tables: stream[B]) => stream[{B with _sent: string}]","is_option":false,"source_location":{"file":"pushbullet/pushbullet.flux","start":{"line":111,"column":1},"end":{"line":131,"column":18},"source":"endpoint = (url=defaultURL, token=\"\") =>\n (mapFn) =>\n (tables=<-) =>\n tables\n |> map(\n fn: (r) => {\n obj = mapFn(r: r)\n\n return {r with _sent:\n string(\n v:\n 2 == pushNote(\n url: url,\n token: token,\n title: obj.title,\n text: obj.text,\n ) / 100,\n ),\n }\n },\n )"},"examples":[],"metadata":{"tags":"notification endpoints, transformations"}},"pushData":{"kind":"Function","name":"pushData","headline":"pushData sends a push notification to the Pushbullet API.","description":null,"parameters":[{"name":"url","headline":"url: URL of the PushBullet endpoint. Default is `\"https://api.pushbullet.com/v2/pushes\"`.","description":null,"required":false},{"name":"token","headline":"token: API token string. Default is `\"\"`.","description":null,"required":false},{"name":"data","headline":"data: Data to send to the endpoint. Data is JSON-encoded and sent to the Pushbullet's endpoint.","description":null,"required":true}],"flux_type":"(data: A, ?token: B, ?url: string) => int","is_option":false,"source_location":{"file":"pushbullet/pushbullet.flux","start":{"line":37,"column":1},"end":{"line":42,"column":2},"source":"pushData = (url=defaultURL, token=\"\", data) => {\n headers = {\"Access-Token\": token, \"Content-Type\": \"application/json\"}\n enc = json.encode(v: data)\n\n return http.post(headers: headers, url: url, data: enc)\n}"},"examples":[],"metadata":{"tags":"single notification"}},"pushNote":{"kind":"Function","name":"pushNote","headline":"pushNote sends a push notification of type \"note\" to the Pushbullet API.","description":null,"parameters":[{"name":"url","headline":"url: URL of the PushBullet endpoint. Default is `\"https://api.pushbullet.com/v2/pushes\"`.","description":null,"required":false},{"name":"token","headline":"token: API token string. Defaults to: `\"\"`.","description":null,"required":false},{"name":"title","headline":"title: Title of the notification.","description":null,"required":true},{"name":"text","headline":"text: Text to display in the notification.","description":null,"required":true}],"flux_type":"(text: A, title: B, ?token: C, ?url: string) => int","is_option":false,"source_location":{"file":"pushbullet/pushbullet.flux","start":{"line":65,"column":1},"end":{"line":69,"column":2},"source":"pushNote = (url=defaultURL, token=\"\", title, text) => {\n data = {type: \"note\", title: title, body: text}\n\n return pushData(token: token, url: url, data: data)\n}"},"examples":[],"metadata":{"tags":"single notification"}}},"examples":[],"metadata":{"introduced":"0.66.0"}},{"path":"regexp","name":"regexp","headline":"Package regexp provides tools for working with regular expressions.","description":null,"members":{"compile":{"kind":"Function","name":"compile","headline":"compile parses a string into a regular expression and returns a regexp type\nthat can be used to match against strings.","description":null,"parameters":[{"name":"v","headline":"v: String value to parse into a regular expression.","description":null,"required":true}],"flux_type":"(v: string) => regexp","is_option":false,"source_location":{"file":"regexp/regexp.flux","start":{"line":28,"column":1},"end":{"line":28,"column":40},"source":"builtin compile : (v: string) => regexp"},"examples":[],"metadata":{"tags":"type-conversions"}},"findString":{"kind":"Function","name":"findString","headline":"findString returns the left-most regular expression match in a string.","description":null,"parameters":[{"name":"r","headline":"r: Regular expression used to search `v`.","description":null,"required":true},{"name":"v","headline":"v: String value to search.","description":null,"required":true}],"flux_type":"(r: regexp, v: string) => string","is_option":false,"source_location":{"file":"regexp/regexp.flux","start":{"line":74,"column":1},"end":{"line":74,"column":54},"source":"builtin findString : (r: regexp, v: string) => string"},"examples":[],"metadata":null},"findStringIndex":{"kind":"Function","name":"findStringIndex","headline":"findStringIndex returns a two-element array of integers that represent the\nbeginning and ending indexes of the first regular expression match in a string.","description":null,"parameters":[{"name":"r","headline":"r: Regular expression used to search `v`.","description":null,"required":true},{"name":"v","headline":"v: String value to search.","description":null,"required":true}],"flux_type":"(r: regexp, v: string) => [int]","is_option":false,"source_location":{"file":"regexp/regexp.flux","start":{"line":93,"column":1},"end":{"line":93,"column":58},"source":"builtin findStringIndex : (r: regexp, v: string) => [int]"},"examples":[],"metadata":null},"getString":{"kind":"Function","name":"getString","headline":"getString returns the source string used to compile a regular expression.","description":null,"parameters":[{"name":"r","headline":"r: Regular expression object to convert to a string.","description":null,"required":true}],"flux_type":"(r: regexp) => string","is_option":false,"source_location":{"file":"regexp/regexp.flux","start":{"line":190,"column":1},"end":{"line":190,"column":42},"source":"builtin getString : (r: regexp) => string"},"examples":[],"metadata":null},"matchRegexpString":{"kind":"Function","name":"matchRegexpString","headline":"matchRegexpString tests if a string contains any match to a regular expression.","description":null,"parameters":[{"name":"r","headline":"r: Regular expression used to search `v`.","description":null,"required":true},{"name":"v","headline":"v: String value to search.","description":null,"required":true}],"flux_type":"(r: regexp, v: string) => bool","is_option":false,"source_location":{"file":"regexp/regexp.flux","start":{"line":119,"column":1},"end":{"line":119,"column":59},"source":"builtin matchRegexpString : (r: regexp, v: string) => bool"},"examples":[],"metadata":null},"quoteMeta":{"kind":"Function","name":"quoteMeta","headline":"quoteMeta escapes all regular expression metacharacters in a string.","description":null,"parameters":[{"name":"v","headline":"v: String that contains regular expression metacharacters to escape.","description":null,"required":true}],"flux_type":"(v: string) => string","is_option":false,"source_location":{"file":"regexp/regexp.flux","start":{"line":45,"column":1},"end":{"line":45,"column":42},"source":"builtin quoteMeta : (v: string) => string"},"examples":[],"metadata":null},"replaceAllString":{"kind":"Function","name":"replaceAllString","headline":"replaceAllString replaces all reguar expression matches in a string with a\nspecified replacement.","description":null,"parameters":[{"name":"r","headline":"r: Regular expression used to search `v`.","description":null,"required":true},{"name":"v","headline":"v: String value to search.","description":null,"required":true},{"name":"t","headline":"t: Replacement for matches to `r`.","description":null,"required":true}],"flux_type":"(r: regexp, t: string, v: string) => string","is_option":false,"source_location":{"file":"regexp/regexp.flux","start":{"line":148,"column":1},"end":{"line":148,"column":71},"source":"builtin replaceAllString : (r: regexp, v: string, t: string) => string"},"examples":[],"metadata":null},"splitRegexp":{"kind":"Function","name":"splitRegexp","headline":"splitRegexp splits a string into substrings separated by regular expression\nmatches and returns an array of `i` substrings between matches.","description":null,"parameters":[{"name":"r","headline":"r: Regular expression used to search `v`.","description":null,"required":true},{"name":"v","headline":"v: String value to be searched.","description":null,"required":true},{"name":"i","headline":"i: Maximum number of substrings to return.","description":null,"required":true}],"flux_type":"(i: int, r: regexp, v: string) => [string]","is_option":false,"source_location":{"file":"regexp/regexp.flux","start":{"line":170,"column":1},"end":{"line":170,"column":65},"source":"builtin splitRegexp : (r: regexp, v: string, i: int) => [string]"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.33.0"}},{"path":"runtime","name":"runtime","headline":"Package runtime provides information about the current Flux runtime.","description":null,"members":{"version":{"kind":"Function","name":"version","headline":"version returns the current Flux version.","description":null,"parameters":[],"flux_type":"() => string","is_option":false,"source_location":{"file":"runtime/runtime.flux","start":{"line":19,"column":1},"end":{"line":19,"column":31},"source":"builtin version : () => string"},"examples":[],"metadata":null}},"examples":[],"metadata":null},{"path":"sampledata","name":"sampledata","headline":"Package sampledata provides functions that return basic sample datasets.","description":null,"members":{"bool":{"kind":"Function","name":"bool","headline":"bool returns a sample data set with boolean values.","description":null,"parameters":[{"name":"includeNull","headline":"includeNull: Include null values in the returned dataset.\n Default is `false`.","description":null,"required":false}],"flux_type":"(?includeNull: bool) => stream[A] where A: Record","is_option":false,"source_location":{"file":"sampledata/sampledata.flux","start":{"line":258,"column":1},"end":{"line":262,"column":2},"source":"bool = (includeNull=false) => {\n _csvData = _bool(includeNull: includeNull)\n\n return csv.from(csv: _csvData)\n}"},"examples":[],"metadata":null},"float":{"kind":"Function","name":"float","headline":"float returns a sample data set with float values.","description":null,"parameters":[{"name":"includeNull","headline":"includeNull: Include null values in the returned dataset.\n Default is `false`.","description":null,"required":false}],"flux_type":"(?includeNull: bool) => stream[A] where A: Record","is_option":false,"source_location":{"file":"sampledata/sampledata.flux","start":{"line":170,"column":1},"end":{"line":174,"column":2},"source":"float = (includeNull=false) => {\n _csvData = _numeric(includeNull: includeNull)\n\n return csv.from(csv: _csvData)\n}"},"examples":[],"metadata":null},"int":{"kind":"Function","name":"int","headline":"int returns a sample data set with integer values.","description":null,"parameters":[{"name":"includeNull","headline":"includeNull: Include null values in the returned dataset.\n Default is `false`.","description":null,"required":false}],"flux_type":"(?includeNull: bool) => stream[{A with _value: B, _value: int}]","is_option":false,"source_location":{"file":"sampledata/sampledata.flux","start":{"line":192,"column":1},"end":{"line":196,"column":2},"source":"int = (includeNull=false) => {\n _csvData = _numeric(includeNull: includeNull)\n\n return csv.from(csv: _csvData) |> toInt()\n}"},"examples":[],"metadata":null},"numericBool":{"kind":"Function","name":"numericBool","headline":"numericBool returns a sample data set with numeric (integer) boolean values.","description":null,"parameters":[{"name":"includeNull","headline":"includeNull: Include null values in the returned dataset.\n Default is `false`.","description":null,"required":false}],"flux_type":"(?includeNull: bool) => stream[{A with _value: B, _value: int}]","is_option":false,"source_location":{"file":"sampledata/sampledata.flux","start":{"line":280,"column":1},"end":{"line":284,"column":2},"source":"numericBool = (includeNull=false) => {\n _csvData = _bool(includeNull: includeNull)\n\n return csv.from(csv: _csvData) |> toInt()\n}"},"examples":[],"metadata":null},"start":{"kind":"Value","name":"start","headline":"start represents the earliest time included in sample datasets.","description":null,"flux_type":"time","is_option":false,"source_location":{"file":"sampledata/sampledata.flux","start":{"line":17,"column":1},"end":{"line":17,"column":29},"source":"start = 2021-01-01T00:00:00Z"},"examples":[],"metadata":null},"stop":{"kind":"Value","name":"stop","headline":"stop represents the latest time included in sample datasets.","description":null,"flux_type":"time","is_option":false,"source_location":{"file":"sampledata/sampledata.flux","start":{"line":24,"column":1},"end":{"line":24,"column":28},"source":"stop = 2021-01-01T00:01:00Z"},"examples":[],"metadata":null},"string":{"kind":"Function","name":"string","headline":"string returns a sample data set with string values.","description":null,"parameters":[{"name":"includeNull","headline":"includeNull: Include null values in the returned dataset.\n Default is `false`.","description":null,"required":false}],"flux_type":"(?includeNull: bool) => stream[A] where A: Record","is_option":false,"source_location":{"file":"sampledata/sampledata.flux","start":{"line":236,"column":1},"end":{"line":240,"column":2},"source":"string = (includeNull=false) => {\n _csvData = _string(includeNull: includeNull)\n\n return csv.from(csv: _csvData)\n}"},"examples":[],"metadata":null},"uint":{"kind":"Function","name":"uint","headline":"uint returns a sample data set with unsigned integer values.","description":null,"parameters":[{"name":"includeNull","headline":"includeNull: Include null values in the returned dataset.\n Default is `false`.","description":null,"required":false}],"flux_type":"(?includeNull: bool) => stream[{A with _value: B, _value: uint}]","is_option":false,"source_location":{"file":"sampledata/sampledata.flux","start":{"line":214,"column":1},"end":{"line":218,"column":2},"source":"uint = (includeNull=false) => {\n _csvData = _numeric(includeNull: includeNull)\n\n return csv.from(csv: _csvData) |> toUInt()\n}"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.128.0","tags":"sample data"}},{"path":"slack","name":"slack","headline":"Package slack provides functions for sending messages to [Slack](https://slack.com/).","description":null,"members":{"defaultURL":{"kind":"Value","name":"defaultURL","headline":"defaultURL defines the default Slack API URL used by functions in the `slack` package.","description":null,"flux_type":"string","is_option":true,"source_location":{"file":"slack/slack.flux","start":{"line":29,"column":1},"end":{"line":29,"column":61},"source":"option defaultURL = \"https://slack.com/api/chat.postMessage\""},"examples":[],"metadata":null},"endpoint":{"kind":"Function","name":"endpoint","headline":"endpoint returns a function that can be used to send a message to Slack per input row.","description":null,"parameters":[{"name":"url","headline":"url: Slack API URL. Default is `https://slack.com/api/chat.postMessage`.","description":null,"required":false},{"name":"token","headline":"token: Slack API token. Default is `\"\"`.","description":null,"required":false}],"flux_type":"(\n ?token: string,\n ?url: string,\n) => (\n mapFn: (r: A) => {B with text: D, color: string, channel: C},\n) => (<-tables: stream[A]) => stream[{A with _sent: string}]","is_option":false,"source_location":{"file":"slack/slack.flux","start":{"line":152,"column":1},"end":{"line":173,"column":18},"source":"endpoint = (url=defaultURL, token=\"\") =>\n (mapFn) =>\n (tables=<-) =>\n tables\n |> map(\n fn: (r) => {\n obj = mapFn(r: r)\n\n return {r with _sent:\n string(\n v:\n 2 == message(\n url: url,\n token: token,\n channel: obj.channel,\n text: obj.text,\n color: obj.color,\n ) / 100,\n ),\n }\n },\n )"},"examples":[],"metadata":{"tags":"notification endpoints, transformations"}},"message":{"kind":"Function","name":"message","headline":"message sends a single message to a Slack channel and returns the HTTP\nresponse code of the request.","description":null,"parameters":[{"name":"url","headline":"url: Slack API URL.\n Default is `https://slack.com/api/chat.postMessage`.","description":null,"required":false},{"name":"token","headline":"token: Slack API token. Default is `\"\"`.","description":null,"required":false},{"name":"channel","headline":"channel: Slack channel or user to send the message to.","description":null,"required":true},{"name":"text","headline":"text: Message text.","description":null,"required":true},{"name":"color","headline":"color: Slack message color.","description":null,"required":true}],"flux_type":"(\n channel: A,\n color: string,\n text: B,\n ?token: string,\n ?url: string,\n) => int","is_option":false,"source_location":{"file":"slack/slack.flux","start":{"line":87,"column":1},"end":{"line":103,"column":6},"source":"message = (\n url=defaultURL,\n token=\"\",\n channel,\n text,\n color,\n ) =>\n {\n attachments = [\n {color: validateColorString(color), text: string(v: text), mrkdwn_in: [\"text\"]},\n ]\n data = {channel: channel, attachments: attachments}\n headers = {\"Authorization\": \"Bearer \" + token, \"Content-Type\": \"application/json\"}\n enc = json.encode(v: data)\n\n return http.post(headers: headers, url: url, data: enc)\n }"},"examples":[],"metadata":{"tags":"single notification"}},"validateColorString":{"kind":"Function","name":"validateColorString","headline":"validateColorString ensures a string contains a valid hex color code.","description":null,"parameters":[{"name":"color","headline":"color: Hex color code.","description":null,"required":true}],"flux_type":"(color: string) => string","is_option":false,"source_location":{"file":"slack/slack.flux","start":{"line":26,"column":1},"end":{"line":26,"column":56},"source":"builtin validateColorString : (color: string) => string"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.41.0"}},{"path":"socket","name":"socket","headline":"Package socket provides tools for returning data from socket connections.","description":null,"members":{"from":{"kind":"Function","name":"from","headline":"from returns data from a socket connection and outputs a stream of tables\ngiven a specified decoder.","description":null,"parameters":[{"name":"url","headline":"url: URL to return data from.","description":null,"required":true},{"name":"decoder","headline":"decoder: Decoder to use to parse returned data into a stream of tables.","description":null,"required":false}],"flux_type":"(url: string, ?decoder: string) => stream[A]","is_option":false,"source_location":{"file":"socket/socket.flux","start":{"line":47,"column":1},"end":{"line":47,"column":60},"source":"builtin from : (url: string, ?decoder: string) => stream[A]"},"examples":[],"metadata":{"tags":"inputs"}}},"examples":[],"metadata":{"introduced":"0.21.0"}},{"path":"sql","name":"sql","headline":"Package sql provides tools for working with data in SQL databases.","description":null,"members":{"from":{"kind":"Function","name":"from","headline":"from retrieves data from a SQL data source.","description":null,"parameters":[{"name":"driverName","headline":"driverName: Driver to use to connect to the SQL database.","description":null,"required":true},{"name":"dataSourceName","headline":"dataSourceName: Data source name (DNS) or connection string used to connect\n to the SQL database.","description":null,"required":true},{"name":"query","headline":"query: Query to run against the SQL database.","description":null,"required":true}],"flux_type":"(dataSourceName: string, driverName: string, query: string) => stream[A]","is_option":false,"source_location":{"file":"sql/sql.flux","start":{"line":146,"column":1},"end":{"line":146,"column":88},"source":"builtin from : (driverName: string, dataSourceName: string, query: string) => stream[A]"},"examples":[],"metadata":null},"to":{"kind":"Function","name":"to","headline":"to writes data to an SQL database.","description":null,"parameters":[{"name":"driverName","headline":"driverName: Driver used to connect to the SQL database.","description":null,"required":true},{"name":"dataSourceName","headline":"dataSourceName: Data source name (DNS) or connection string used\n to connect to the SQL database.","description":null,"required":true},{"name":"table","headline":"table: Destination table.","description":null,"required":true},{"name":"batchSize","headline":"batchSize: Number of parameters or columns that can be queued within each\n call to `Exec`. Default is `10000`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n dataSourceName: string,\n driverName: string,\n table: string,\n ?batchSize: int,\n) => stream[A]","is_option":false,"source_location":{"file":"sql/sql.flux","start":{"line":180,"column":1},"end":{"line":186,"column":19},"source":"builtin to : (\n <-tables: stream[A],\n driverName: string,\n dataSourceName: string,\n table: string,\n ?batchSize: int,\n ) => stream[A]"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.34.0"}},{"path":"strings","name":"strings","headline":"Package strings provides functions to operate on UTF-8 encoded strings.","description":null,"members":{"compare":{"kind":"Function","name":"compare","headline":"compare compares the lexicographical order of two strings.","description":null,"parameters":[{"name":"v","headline":"v: String value to compare.","description":null,"required":true},{"name":"t","headline":"t: String value to compare against.","description":null,"required":true}],"flux_type":"(t: string, v: string) => int","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":387,"column":1},"end":{"line":387,"column":48},"source":"builtin compare : (v: string, t: string) => int"},"examples":[],"metadata":null},"containsAny":{"kind":"Function","name":"containsAny","headline":"containsAny reports whether a specified string contains characters from another string.","description":null,"parameters":[{"name":"v","headline":"v: String value to search.","description":null,"required":true},{"name":"chars","headline":"chars: Characters to search for.","description":null,"required":true}],"flux_type":"(chars: string, v: string) => bool","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":320,"column":1},"end":{"line":320,"column":57},"source":"builtin containsAny : (v: string, chars: string) => bool"},"examples":[],"metadata":null},"containsStr":{"kind":"Function","name":"containsStr","headline":"containsStr reports whether a string contains a specified substring.","description":null,"parameters":[{"name":"v","headline":"v: String value to search.","description":null,"required":true},{"name":"substr","headline":"substr: Substring value to search for.","description":null,"required":true}],"flux_type":"(substr: string, v: string) => bool","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":300,"column":1},"end":{"line":300,"column":58},"source":"builtin containsStr : (v: string, substr: string) => bool"},"examples":[],"metadata":null},"countStr":{"kind":"Function","name":"countStr","headline":"countStr counts the number of non-overlapping instances of a substring appears in a string.","description":null,"parameters":[{"name":"v","headline":"v: String value to search.","description":null,"required":true},{"name":"substr","headline":"substr: Substring to count occurences of.","description":null,"required":true}],"flux_type":"(substr: string, v: string) => int","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":409,"column":1},"end":{"line":409,"column":54},"source":"builtin countStr : (v: string, substr: string) => int"},"examples":[],"metadata":null},"equalFold":{"kind":"Function","name":"equalFold","headline":"equalFold reports whether two UTF-8 strings are equal under Unicode case-folding.","description":null,"parameters":[{"name":"v","headline":"v: String value to compare.","description":null,"required":true},{"name":"t","headline":"t: String value to compare against.","description":null,"required":true}],"flux_type":"(t: string, v: string) => bool","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":350,"column":1},"end":{"line":350,"column":51},"source":"builtin equalFold : (v: string, t: string) => bool"},"examples":[],"metadata":null},"hasPrefix":{"kind":"Function","name":"hasPrefix","headline":"hasPrefix indicates if a string begins with a specified prefix.","description":null,"parameters":[{"name":"v","headline":"v: String value to search.","description":null,"required":true},{"name":"prefix","headline":"prefix: Prefix to search for.","description":null,"required":true}],"flux_type":"(prefix: string, v: string) => bool","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":260,"column":1},"end":{"line":260,"column":56},"source":"builtin hasPrefix : (v: string, prefix: string) => bool"},"examples":[],"metadata":null},"hasSuffix":{"kind":"Function","name":"hasSuffix","headline":"hasSuffix indicates if a string ends with a specified suffix.","description":null,"parameters":[{"name":"v","headline":"v: String value to search.","description":null,"required":true},{"name":"suffix","headline":"suffix: Suffix to search for.","description":null,"required":true}],"flux_type":"(suffix: string, v: string) => bool","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":280,"column":1},"end":{"line":280,"column":56},"source":"builtin hasSuffix : (v: string, suffix: string) => bool"},"examples":[],"metadata":null},"index":{"kind":"Function","name":"index","headline":"index returns the index of the first instance of a substring in a string.\nIf the substring is not present, it returns `-1`.","description":null,"parameters":[{"name":"v","headline":"v: String value to search.","description":null,"required":true},{"name":"substr","headline":"substr: Substring to search for.","description":null,"required":true}],"flux_type":"(substr: string, v: string) => int","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":430,"column":1},"end":{"line":430,"column":51},"source":"builtin index : (v: string, substr: string) => int"},"examples":[],"metadata":null},"indexAny":{"kind":"Function","name":"indexAny","headline":"indexAny returns the index of the first instance of specified characters in a string.\nIf none of the specified characters are present, it returns `-1`.","description":null,"parameters":[{"name":"v","headline":"v: String value to search.","description":null,"required":true},{"name":"chars","headline":"chars: Characters to search for.","description":null,"required":true}],"flux_type":"(chars: string, v: string) => int","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":451,"column":1},"end":{"line":451,"column":53},"source":"builtin indexAny : (v: string, chars: string) => int"},"examples":[],"metadata":null},"isDigit":{"kind":"Function","name":"isDigit","headline":"isDigit tests if a single-character string is a digit (0-9).","description":null,"parameters":[{"name":"v","headline":"v: Single-character string to test.","description":null,"required":true}],"flux_type":"(v: string) => bool","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":516,"column":1},"end":{"line":516,"column":38},"source":"builtin isDigit : (v: string) => bool"},"examples":[],"metadata":null},"isLetter":{"kind":"Function","name":"isLetter","headline":"isLetter tests if a single character string is a letter (a-z, A-Z).","description":null,"parameters":[{"name":"v","headline":"v: Single-character string to test.","description":null,"required":true}],"flux_type":"(v: string) => bool","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":538,"column":1},"end":{"line":538,"column":39},"source":"builtin isLetter : (v: string) => bool"},"examples":[],"metadata":null},"isLower":{"kind":"Function","name":"isLower","headline":"isLower tests if a single-character string is lowercase.","description":null,"parameters":[{"name":"v","headline":"v: Single-character string value to test.","description":null,"required":true}],"flux_type":"(v: string) => bool","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":572,"column":1},"end":{"line":572,"column":38},"source":"builtin isLower : (v: string) => bool"},"examples":[],"metadata":null},"isUpper":{"kind":"Function","name":"isUpper","headline":"isUpper tests if a single character string is uppercase.","description":null,"parameters":[{"name":"v","headline":"v: Single-character string value to test.","description":null,"required":true}],"flux_type":"(v: string) => bool","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":606,"column":1},"end":{"line":606,"column":38},"source":"builtin isUpper : (v: string) => bool"},"examples":[],"metadata":null},"joinStr":{"kind":"Function","name":"joinStr","headline":"joinStr concatenates elements of a string array into a single string using a specified separator.","description":null,"parameters":[{"name":"arr","headline":"arr: Array of strings to concatenate.","description":null,"required":true},{"name":"v","headline":"v: Separator to use in the concatenated value.","description":null,"required":true}],"flux_type":"(arr: [string], v: string) => string","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":777,"column":1},"end":{"line":777,"column":55},"source":"builtin joinStr : (arr: [string], v: string) => string"},"examples":[],"metadata":null},"lastIndex":{"kind":"Function","name":"lastIndex","headline":"lastIndex returns the index of the last instance of a substring in a string.\nIf the substring is not present, the function returns -1.","description":null,"parameters":[{"name":"v","headline":"v: String value to search.","description":null,"required":true},{"name":"substr","headline":"substr: Substring to search for.","description":null,"required":true}],"flux_type":"(substr: string, v: string) => int","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":472,"column":1},"end":{"line":472,"column":55},"source":"builtin lastIndex : (v: string, substr: string) => int"},"examples":[],"metadata":null},"lastIndexAny":{"kind":"Function","name":"lastIndexAny","headline":"lastIndexAny returns the index of the last instance of any specified\ncharacters in a string.\nIf none of the specified characters are present, the function returns `-1`.","description":null,"parameters":[{"name":"v","headline":"v: String value to search.","description":null,"required":true},{"name":"chars","headline":"chars: Characters to search for.","description":null,"required":true}],"flux_type":"(chars: string, v: string) => int","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":494,"column":1},"end":{"line":494,"column":57},"source":"builtin lastIndexAny : (v: string, chars: string) => int"},"examples":[],"metadata":null},"repeat":{"kind":"Function","name":"repeat","headline":"repeat returns a string consisting of `i` copies of a specified string.","description":null,"parameters":[{"name":"v","headline":"v: String value to repeat.","description":null,"required":true},{"name":"i","headline":"i: Number of times to repeat `v`.","description":null,"required":true}],"flux_type":"(i: int, v: string) => string","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":629,"column":1},"end":{"line":629,"column":47},"source":"builtin repeat : (v: string, i: int) => string"},"examples":[],"metadata":null},"replace":{"kind":"Function","name":"replace","headline":"replace replaces the first `i` non-overlapping instances of a substring with\na specified replacement.","description":null,"parameters":[{"name":"v","headline":"v: String value to search.","description":null,"required":true},{"name":"t","headline":"t: Substring value to replace.","description":null,"required":true},{"name":"u","headline":"u: Replacement for `i` instances of `t`.","description":null,"required":true},{"name":"i","headline":"i: Number of non-overlapping `t` matches to replace.","description":null,"required":true}],"flux_type":"(i: int, t: string, u: string, v: string) => string","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":651,"column":1},"end":{"line":651,"column":70},"source":"builtin replace : (v: string, t: string, u: string, i: int) => string"},"examples":[],"metadata":null},"replaceAll":{"kind":"Function","name":"replaceAll","headline":"replaceAll replaces all non-overlapping instances of a substring with a specified replacement.","description":null,"parameters":[{"name":"v","headline":"v: String value to search.","description":null,"required":true},{"name":"t","headline":"t: Substring to replace.","description":null,"required":true},{"name":"u","headline":"u: Replacement for all instances of `t`.","description":null,"required":true}],"flux_type":"(t: string, u: string, v: string) => string","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":672,"column":1},"end":{"line":672,"column":65},"source":"builtin replaceAll : (v: string, t: string, u: string) => string"},"examples":[],"metadata":null},"split":{"kind":"Function","name":"split","headline":"split splits a string on a specified separator and returns an array of substrings.","description":null,"parameters":[{"name":"v","headline":"v: String value to split.","description":null,"required":true},{"name":"t","headline":"t: String value that acts as the separator.","description":null,"required":true}],"flux_type":"(t: string, v: string) => [string]","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":691,"column":1},"end":{"line":691,"column":51},"source":"builtin split : (v: string, t: string) => [string]"},"examples":[],"metadata":null},"splitAfter":{"kind":"Function","name":"splitAfter","headline":"splitAfter splits a string after a specified separator and returns an array of substrings.\nSplit substrings include the separator, `t`.","description":null,"parameters":[{"name":"v","headline":"v: String value to split.","description":null,"required":true},{"name":"t","headline":"t: String value that acts as the separator.","description":null,"required":true}],"flux_type":"(t: string, v: string) => [string]","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":711,"column":1},"end":{"line":711,"column":56},"source":"builtin splitAfter : (v: string, t: string) => [string]"},"examples":[],"metadata":null},"splitAfterN":{"kind":"Function","name":"splitAfterN","headline":"splitAfterN splits a string after a specified separator and returns an array of `i` substrings.\nSplit substrings include the separator, `t`.","description":null,"parameters":[{"name":"v","headline":"v: String value to split.","description":null,"required":true},{"name":"t","headline":"t: String value that acts as the separator.","description":null,"required":true},{"name":"i","headline":"i: Maximum number of split substrings to return.","description":null,"required":true}],"flux_type":"(i: int, t: string, v: string) => [string]","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":758,"column":1},"end":{"line":758,"column":65},"source":"builtin splitAfterN : (v: string, t: string, i: int) => [string]"},"examples":[],"metadata":null},"splitN":{"kind":"Function","name":"splitN","headline":"splitN splits a string on a specified separator and returns an array of `i` substrings.","description":null,"parameters":[{"name":"v","headline":"v: String value to split.","description":null,"required":true},{"name":"t","headline":"t: String value that acts as the separator.","description":null,"required":true},{"name":"i","headline":"i: Maximum number of split substrings to return.","description":null,"required":true}],"flux_type":"(i: int, t: string, v: string) => [string]","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":734,"column":1},"end":{"line":734,"column":60},"source":"builtin splitN : (v: string, t: string, i: int) => [string]"},"examples":[],"metadata":null},"strlen":{"kind":"Function","name":"strlen","headline":"strlen returns the length of a string. String length is determined by the number of UTF code points a string contains.","description":null,"parameters":[{"name":"v","headline":"v: String value to measure.","description":null,"required":true}],"flux_type":"(v: string) => int","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":811,"column":1},"end":{"line":811,"column":36},"source":"builtin strlen : (v: string) => int"},"examples":[],"metadata":null},"substring":{"kind":"Function","name":"substring","headline":"substring returns a substring based on start and end parameters. These parameters are represent indices of UTF code points in the string.","description":null,"parameters":[{"name":"v","headline":"v: String value to search for.","description":null,"required":true},{"name":"start","headline":"start: Starting inclusive index of the substring.","description":null,"required":true},{"name":"end","headline":"end: Ending exclusive index of the substring.","description":null,"required":true}],"flux_type":"(end: int, start: int, v: string) => string","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":834,"column":1},"end":{"line":834,"column":64},"source":"builtin substring : (v: string, start: int, end: int) => string"},"examples":[],"metadata":null},"title":{"kind":"Function","name":"title","headline":"title converts a string to title case.","description":null,"parameters":[{"name":"v","headline":"v: String value to convert.","description":null,"required":true}],"flux_type":"(v: string) => string","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":26,"column":1},"end":{"line":26,"column":38},"source":"builtin title : (v: string) => string"},"examples":[],"metadata":null},"toLower":{"kind":"Function","name":"toLower","headline":"toLower converts a string to lowercase.","description":null,"parameters":[{"name":"v","headline":"v: String value to convert.","description":null,"required":true}],"flux_type":"(v: string) => string","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":75,"column":1},"end":{"line":75,"column":40},"source":"builtin toLower : (v: string) => string"},"examples":[],"metadata":null},"toTitle":{"kind":"Function","name":"toTitle","headline":"toTitle converts all characters in a string to title case.","description":null,"parameters":[{"name":"v","headline":"v: String value to convert.","description":null,"required":true}],"flux_type":"(v: string) => string","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":240,"column":1},"end":{"line":240,"column":40},"source":"builtin toTitle : (v: string) => string"},"examples":[],"metadata":null},"toUpper":{"kind":"Function","name":"toUpper","headline":"toUpper converts a string to uppercase.","description":null,"parameters":[{"name":"v","headline":"v: String value to convert.","description":null,"required":true}],"flux_type":"(v: string) => string","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":56,"column":1},"end":{"line":56,"column":40},"source":"builtin toUpper : (v: string) => string"},"examples":[],"metadata":null},"trim":{"kind":"Function","name":"trim","headline":"trim removes leading and trailing characters specified in the cutset from a string.","description":null,"parameters":[{"name":"v","headline":"v: String to remove characters from.","description":null,"required":true},{"name":"cutset","headline":"cutset: Leading and trailing characters to remove from the string.","description":null,"required":true}],"flux_type":"(cutset: string, v: string) => string","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":99,"column":1},"end":{"line":99,"column":53},"source":"builtin trim : (v: string, cutset: string) => string"},"examples":[],"metadata":null},"trimLeft":{"kind":"Function","name":"trimLeft","headline":"trimLeft removes specified leading characters from a string.","description":null,"parameters":[{"name":"v","headline":"v: String to to remove characters from.","description":null,"required":true},{"name":"cutset","headline":"cutset: Leading characters to trim from the string.","description":null,"required":true}],"flux_type":"(cutset: string, v: string) => string","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":210,"column":1},"end":{"line":210,"column":57},"source":"builtin trimLeft : (v: string, cutset: string) => string"},"examples":[],"metadata":null},"trimPrefix":{"kind":"Function","name":"trimPrefix","headline":"trimPrefix removes a prefix from a string. Strings that do not start with the prefix are returned unchanged.","description":null,"parameters":[{"name":"v","headline":"v: String to trim.","description":null,"required":true},{"name":"prefix","headline":"prefix: Prefix to remove.","description":null,"required":true}],"flux_type":"(prefix: string, v: string) => string","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":119,"column":1},"end":{"line":119,"column":59},"source":"builtin trimPrefix : (v: string, prefix: string) => string"},"examples":[],"metadata":null},"trimRight":{"kind":"Function","name":"trimRight","headline":"trimRight removes trailing characters specified in the cutset from a string.","description":null,"parameters":[{"name":"v","headline":"v: String to to remove characters from.","description":null,"required":true},{"name":"cutset","headline":"cutset: Trailing characters to trim from the string.","description":null,"required":true}],"flux_type":"(cutset: string, v: string) => string","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":188,"column":1},"end":{"line":188,"column":58},"source":"builtin trimRight : (v: string, cutset: string) => string"},"examples":[],"metadata":null},"trimSpace":{"kind":"Function","name":"trimSpace","headline":"trimSpace removes leading and trailing spaces from a string.","description":null,"parameters":[{"name":"v","headline":"v: String to remove spaces from.","description":null,"required":true}],"flux_type":"(v: string) => string","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":140,"column":1},"end":{"line":140,"column":42},"source":"builtin trimSpace : (v: string) => string"},"examples":[],"metadata":null},"trimSuffix":{"kind":"Function","name":"trimSuffix","headline":"trimSuffix removes a suffix from a string.","description":null,"parameters":[{"name":"v","headline":"v: String to trim.","description":null,"required":true},{"name":"suffix","headline":"suffix: Suffix to remove.","description":null,"required":true}],"flux_type":"(suffix: string, v: string) => string","is_option":false,"source_location":{"file":"strings/strings.flux","start":{"line":164,"column":1},"end":{"line":164,"column":59},"source":"builtin trimSuffix : (v: string, suffix: string) => string"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.18.0"}},{"path":"system","name":"system","headline":"Package system provides functions for reading values from the system.","description":null,"members":{"time":{"kind":"Function","name":"time","headline":"time returns the current system time.","description":null,"parameters":[],"flux_type":"() => time","is_option":false,"source_location":{"file":"system/system.flux","start":{"line":24,"column":1},"end":{"line":24,"column":26},"source":"builtin time : () => time"},"examples":[],"metadata":{"tags":"date/time"}}},"examples":[],"metadata":{"introduced":"0.18.0"}},{"path":"testing","name":"testing","headline":"Package testing provides functions for testing Flux operations.","description":null,"members":{"assertEmpty":{"kind":"Function","name":"assertEmpty","headline":"assertEmpty tests if an input stream is empty. If not empty, the function returns an error.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A]) => stream[A]","is_option":false,"source_location":{"file":"testing/testing.flux","start":{"line":92,"column":1},"end":{"line":92,"column":57},"source":"builtin assertEmpty : (<-tables: stream[A]) => stream[A]"},"examples":[],"metadata":{"introduced":"0.18.0","tags":"tests"}},"assertEqualValues":{"kind":"Function","name":"assertEqualValues","headline":"assertEqualValues tests whether two values are equal.","description":null,"parameters":[{"name":"got","headline":"got: Value to test.","description":null,"required":true},{"name":"want","headline":"want: Expected value to test against.","description":null,"required":true}],"flux_type":"(got: A, want: A) => stream[{v: A, _diff: string}]","is_option":false,"source_location":{"file":"testing/testing.flux","start":{"line":218,"column":1},"end":{"line":220,"column":2},"source":"assertEqualValues = (got, want) => {\n return diff(got: array.from(rows: [{v: got}]), want: array.from(rows: [{v: want}]))\n}"},"examples":[],"metadata":{"introduced":"0.141.0","tags":"tests"}},"assertEquals":{"kind":"Function","name":"assertEquals","headline":"assertEquals tests whether two streams of tables are identical.","description":null,"parameters":[{"name":"name","headline":"name: Unique assertion name.","description":null,"required":true},{"name":"got","headline":"got: Data to test. Default is piped-forward data (`<-`).","description":null,"required":false},{"name":"want","headline":"want: Expected data to test against.","description":null,"required":true}],"flux_type":"(<-got: stream[A], name: string, want: stream[A]) => stream[A]","is_option":false,"source_location":{"file":"testing/testing.flux","start":{"line":61,"column":1},"end":{"line":61,"column":86},"source":"builtin assertEquals : (name: string, <-got: stream[A], want: stream[A]) => stream[A]"},"examples":[],"metadata":{"tags":"tests"}},"diff":{"kind":"Function","name":"diff","headline":"diff produces a diff between two streams.","description":null,"parameters":[{"name":"got","headline":"got: Stream containing data to test. Default is piped-forward data (`<-`).","description":null,"required":false},{"name":"want","headline":"want: Stream that contains data to test against.","description":null,"required":true},{"name":"epsilon","headline":"epsilon: Specify how far apart two float values can be, but still considered equal. Defaults to 0.000000001.","description":null,"required":false},{"name":"verbose","headline":"verbose: Include detailed differences in output. Default is `false`.","description":null,"required":false},{"name":"nansEqual","headline":"nansEqual: Consider `NaN` float values equal. Default is `false`.","description":null,"required":false}],"flux_type":"(\n <-got: stream[A],\n want: stream[A],\n ?epsilon: B,\n ?nansEqual: C,\n ?verbose: D,\n) => stream[{A with _diff: string}]","is_option":false,"source_location":{"file":"testing/testing.flux","start":{"line":144,"column":1},"end":{"line":155,"column":6},"source":"diff = (\n got=<-,\n want,\n verbose=false,\n epsilon=0.000001,\n nansEqual=false,\n ) =>\n {\n return\n experimental.diff(got, want)\n |> yield(name: \"errorOutput\")\n }"},"examples":[],"metadata":{"introduced":"0.18.0","tags":"tests"}},"load":{"kind":"Function","name":"load","headline":"load loads test data from a stream of tables.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: A) => A","is_option":true,"source_location":{"file":"testing/testing.flux","start":{"line":197,"column":1},"end":{"line":197,"column":36},"source":"option load = (tables=<-) => tables"},"examples":[],"metadata":{"introduced":"0.112.0"}},"shouldError":{"kind":"Function","name":"shouldError","headline":"shouldError calls a function that catches any error and checks that the error matches the expected value.","description":null,"parameters":[{"name":"fn","headline":"fn: Function to call.","description":null,"required":true},{"name":"want","headline":"want: Regular expression to match the expected error.","description":null,"required":true}],"flux_type":"(fn: () => A, want: regexp) => stream[{v: string}]","is_option":false,"source_location":{"file":"testing/testing.flux","start":{"line":242,"column":1},"end":{"line":252,"column":2},"source":"shouldError = (fn, want) => {\n got = experimental.catch(fn)\n\n return\n if exists got.msg then\n array.from(rows: [{v: got.msg}])\n |> filter(fn: (r) => r.v !~ want)\n |> yield(name: \"errorOutput\")\n else\n die(msg: \"shouldError expected an error\")\n}"},"examples":[],"metadata":{"introduced":"0.174.0","tags":"tests"}},"tags":{"kind":"Value","name":"tags","headline":"tags is a list of tags that will be applied to a test case.","description":null,"flux_type":"[A]","is_option":true,"source_location":{"file":"testing/testing.flux","start":{"line":19,"column":1},"end":{"line":19,"column":17},"source":"option tags = []"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.14.0"}},{"path":"testing/expect","name":"expect","headline":"Package expect includes functions to mark\nany expectations for a testcase to be satisfied\nbefore the testcase finishes running.","description":null,"members":{"planner":{"kind":"Function","name":"planner","headline":"planner will cause the present testcase to\nexpect the given planner rules will be invoked\nexactly as many times as the number given.","description":null,"parameters":[{"name":"rules","headline":"rules: Mapping of rules names to expected counts.","description":null,"required":true}],"flux_type":"(rules: [string:int]) => {}","is_option":false,"source_location":{"file":"testing/expect/expect.flux","start":{"line":19,"column":1},"end":{"line":19,"column":46},"source":"builtin planner : (rules: [string:int]) => {}"},"examples":[],"metadata":null}},"examples":[],"metadata":null},{"path":"timezone","name":"timezone","headline":"Package timezone defines functions for setting timezones\non the location option in package universe.","description":null,"members":{"fixed":{"kind":"Function","name":"fixed","headline":"fixed returns a location record with a fixed offset.","description":null,"parameters":[{"name":"offset","headline":"offset: Fixed duration for the location offset.\n This duration is the offset from UTC.","description":null,"required":true}],"flux_type":"(offset: A) => {zone: string, offset: A}","is_option":false,"source_location":{"file":"timezone/timezone.flux","start":{"line":42,"column":1},"end":{"line":42,"column":55},"source":"fixed = (offset) => ({zone: utc.zone, offset: offset})"},"examples":[],"metadata":{"tags":"date/time,location"}},"location":{"kind":"Function","name":"location","headline":"location returns a location record based on a location or timezone name.","description":null,"parameters":[{"name":"name","headline":"name: Location name (as defined by your operating system timezone database).","description":null,"required":true}],"flux_type":"(name: string) => {zone: string, offset: duration}","is_option":false,"source_location":{"file":"timezone/timezone.flux","start":{"line":70,"column":1},"end":{"line":70,"column":70},"source":"builtin location : (name: string) => {zone: string, offset: duration}"},"examples":[],"metadata":{"tags":"date/time,location"}},"utc":{"kind":"Value","name":"utc","headline":"utc is the default location with a completely linear clock and no offset.\nIt is used as the default for location-related options.","description":null,"flux_type":"{zone: string, offset: duration}","is_option":false,"source_location":{"file":"timezone/timezone.flux","start":{"line":12,"column":1},"end":{"line":12,"column":32},"source":"utc = {zone: \"UTC\", offset: 0h}"},"examples":[],"metadata":null}},"examples":[],"metadata":{"introduced":"0.134.0"}},{"path":"types","name":"types","headline":"Package types provides functions for working with Flux's types.","description":null,"members":{"isNumeric":{"kind":"Function","name":"isNumeric","headline":"isNumeric tests if a value is a numeric type (int, uint, or float).","description":null,"parameters":[{"name":"v","headline":"v: Value to test.","description":null,"required":true}],"flux_type":"(v: A) => bool where A: Basic","is_option":false,"source_location":{"file":"types/types.flux","start":{"line":189,"column":1},"end":{"line":190,"column":91},"source":"isNumeric = (v) =>\n isType(v: v, type: \"int\") or isType(v: v, type: \"uint\") or isType(v: v, type: \"float\")"},"examples":[],"metadata":{"introduced":"0.187.0","tags":"types, tests"}},"isType":{"kind":"Function","name":"isType","headline":"isType tests if a value is a specified type.","description":null,"parameters":[{"name":"v","headline":"v: Value to test.","description":null,"required":true},{"name":"type","headline":"type: String describing the type to check against.","description":null,"required":true}],"flux_type":"(type: string, v: A) => bool where A: Basic","is_option":false,"source_location":{"file":"types/types.flux","start":{"line":128,"column":1},"end":{"line":128,"column":61},"source":"builtin isType : (v: A, type: string) => bool where A: Basic"},"examples":[],"metadata":{"tags":"types, tests"}}},"examples":[],"metadata":{"introduced":"0.141.0","tags":"types"}},{"path":"universe","name":"universe","headline":"Package universe provides options and primitive functions that are\nloaded into the Flux runtime by default and do not require an\nimport statement.","description":null,"members":{"aggregateWindow":{"kind":"Function","name":"aggregateWindow","headline":"aggregateWindow downsamples data by grouping data into fixed windows of time\nand applying an aggregate or selector function to each window.","description":null,"parameters":[{"name":"every","headline":"every: Duration of time between windows.","description":null,"required":true},{"name":"period","headline":"period: Duration of windows. Default is the `every` value.","description":null,"required":false},{"name":"offset","headline":"offset: Duration to shift the window boundaries by. Default is `0s`.","description":null,"required":false},{"name":"fn","headline":"fn: Aggregate or selector function to apply to each time window.","description":null,"required":true},{"name":"location","headline":"location: Location used to determine timezone. Default is the `location` option.","description":null,"required":false},{"name":"column","headline":"column: Column to operate on.","description":null,"required":false},{"name":"timeSrc","headline":"timeSrc: Column to use as the source of the new time value for aggregate values.\n Default is `_stop`.","description":null,"required":false},{"name":"timeDst","headline":"timeDst: Column to store time values for aggregate values in.\n Default is `_time`.","description":null,"required":false},{"name":"createEmpty","headline":"createEmpty: Create empty tables for empty window. Default is `true`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[D],\n every: duration,\n fn: (<-: stream[B], column: A) => stream[C],\n ?column: A,\n ?createEmpty: bool,\n ?location: {zone: string, offset: duration},\n ?offset: duration,\n ?period: duration,\n ?timeDst: string,\n ?timeSrc: string,\n) => stream[E] where B: Record, C: Record, D: Record, E: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3881,"column":1},"end":{"line":3904,"column":51},"source":"aggregateWindow = (\n every,\n period=0s,\n fn,\n offset=0s,\n location=location,\n column=\"_value\",\n timeSrc=\"_stop\",\n timeDst=\"_time\",\n createEmpty=true,\n tables=<-,\n) =>\n tables\n |> window(\n every: every,\n period: period,\n offset: offset,\n location: location,\n createEmpty: createEmpty,\n )\n |> fn(column: column)\n |> _fillEmpty(createEmpty: createEmpty)\n |> duplicate(column: timeSrc, as: timeDst)\n |> window(every: inf, timeColumn: timeDst)"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, aggregates, selectors"}},"bool":{"kind":"Function","name":"bool","headline":"bool converts a value to a boolean type.","description":null,"parameters":[{"name":"v","headline":"v: Value to convert.","description":null,"required":true}],"flux_type":"(v: A) => bool","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3142,"column":1},"end":{"line":3142,"column":30},"source":"builtin bool : (v: A) => bool"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"type-conversions"}},"bottom":{"kind":"Function","name":"bottom","headline":"bottom sorts each input table by specified columns and keeps the bottom `n`\nrecords in each table.","description":null,"parameters":[{"name":"n","headline":"n: Number of rows to return from each input table.","description":null,"required":true},{"name":"columns","headline":"columns: List of columns to sort by. Default is `[\"_value\"]`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], n: int, ?columns: [string]) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4151,"column":1},"end":{"line":4153,"column":59},"source":"bottom = (n, columns=[\"_value\"], tables=<-) =>\n tables\n |> _sortLimit(n: n, columns: columns, desc: false)"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, selectors"}},"bytes":{"kind":"Function","name":"bytes","headline":"bytes converts a string value to a bytes type.","description":null,"parameters":[{"name":"v","headline":"v: Value to convert.","description":null,"required":true}],"flux_type":"(v: A) => bytes","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3160,"column":1},"end":{"line":3160,"column":32},"source":"builtin bytes : (v: A) => bytes"},"examples":[],"metadata":{"introduced":"0.40.0","tags":"type-conversions"}},"chandeMomentumOscillator":{"kind":"Function","name":"chandeMomentumOscillator","headline":"chandeMomentumOscillator applies the technical momentum indicator developed\nby Tushar Chande to input data.","description":null,"parameters":[{"name":"n","headline":"n: Period or number of points to use in the calculation.","description":null,"required":true},{"name":"columns","headline":"columns: List of columns to operate on. Default is `[\"_value\"]`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], n: int, ?columns: [string]) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":80,"column":1},"end":{"line":83,"column":14},"source":"builtin chandeMomentumOscillator : (<-tables: stream[A], n: int, ?columns: [string]) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.39.0","tags":"transformations"}},"columns":{"kind":"Function","name":"columns","headline":"columns returns the column labels in each input table.","description":null,"parameters":[{"name":"column","headline":"column: Name of the output column to store column labels in.\n Default is \"_value\".","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?column: string) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":113,"column":1},"end":{"line":113,"column":97},"source":"builtin columns : (<-tables: stream[A], ?column: string) => stream[B] where A: Record, B: Record"},"examples":[],"metadata":{"introduced":"0.14.0","tags":"transformations"}},"contains":{"kind":"Function","name":"contains","headline":"contains tests if an array contains a specified value and returns `true` or `false`.","description":null,"parameters":[{"name":"value","headline":"value: Value to search for.","description":null,"required":true},{"name":"set","headline":"set: Array to search.","description":null,"required":true}],"flux_type":"(set: [A], value: A) => bool where A: Nullable","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3565,"column":1},"end":{"line":3565,"column":66},"source":"builtin contains : (value: A, set: [A]) => bool where A: Nullable"},"examples":[],"metadata":{"introduced":"0.19.0"}},"count":{"kind":"Function","name":"count","headline":"count returns the number of records in each input table.","description":null,"parameters":[{"name":"column","headline":"column: Column to count values in and store the total count.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?column: string) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":163,"column":1},"end":{"line":163,"column":95},"source":"builtin count : (<-tables: stream[A], ?column: string) => stream[B] where A: Record, B: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations,aggregates"}},"cov":{"kind":"Function","name":"cov","headline":"cov computes the covariance between two streams of tables.","description":null,"parameters":[{"name":"x","headline":"x: First input stream.","description":null,"required":true},{"name":"y","headline":"y: Second input stream.","description":null,"required":true},{"name":"on","headline":"on: List of columns to join on.","description":null,"required":true},{"name":"pearsonr","headline":"pearsonr: Normalize results to the Pearson R coefficient. Default is `false`.","description":null,"required":false}],"flux_type":"(on: [string], x: A, y: B, ?pearsonr: bool) => stream[C] where C: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3703,"column":1},"end":{"line":3705,"column":77},"source":"cov = (x, y, on, pearsonr=false) =>\n join(tables: {x: x, y: y}, on: on)\n |> covariance(pearsonr: pearsonr, columns: [\"_value_x\", \"_value_y\"])"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, aggregates"}},"covariance":{"kind":"Function","name":"covariance","headline":"covariance computes the covariance between two columns.","description":null,"parameters":[{"name":"columns","headline":"columns: List of two columns to operate on.","description":null,"required":true},{"name":"pearsonr","headline":"pearsonr: Normalize results to the Pearson R coefficient. Default is `false`.","description":null,"required":false},{"name":"valueDst","headline":"valueDst: Column to store the result in. Default is `_value`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], columns: [string], ?pearsonr: bool, ?valueDst: string) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":192,"column":1},"end":{"line":200,"column":14},"source":"builtin covariance : (\n <-tables: stream[A],\n ?pearsonr: bool,\n ?valueDst: string,\n columns: [string],\n ) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations,aggregates"}},"cumulativeSum":{"kind":"Function","name":"cumulativeSum","headline":"cumulativeSum computes a running sum for non-null records in a table.","description":null,"parameters":[{"name":"columns","headline":"columns: List of columns to operate on. Default is `[\"_value\"]`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?columns: [string]) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":224,"column":1},"end":{"line":227,"column":14},"source":"builtin cumulativeSum : (<-tables: stream[A], ?columns: [string]) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations"}},"derivative":{"kind":"Function","name":"derivative","headline":"derivative computes the rate of change per unit of time between subsequent\nnon-null records.","description":null,"parameters":[{"name":"unit","headline":"unit: Time duration used to calculate the derivative. Default is `1s`.","description":null,"required":false},{"name":"nonNegative","headline":"nonNegative: Disallow negative derivative values. Default is `false`.","description":null,"required":false},{"name":"columns","headline":"columns: List of columns to operate on. Default is `[\"_value\"]`.","description":null,"required":false},{"name":"timeColumn","headline":"timeColumn: Column containing time values to use in the calculation.\n Default is `_time`.","description":null,"required":false},{"name":"initialZero","headline":"initialZero: Use zero (0) as the initial value in the derivative calculation\n when the subsequent value is less than the previous value and `nonNegative` is\n `true`. Default is `false`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n ?columns: [string],\n ?initialZero: bool,\n ?nonNegative: bool,\n ?timeColumn: string,\n ?unit: duration,\n) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":276,"column":1},"end":{"line":286,"column":14},"source":"builtin derivative : (\n <-tables: stream[A],\n ?unit: duration,\n ?nonNegative: bool,\n ?columns: [string],\n ?timeColumn: string,\n ?initialZero: bool,\n ) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations"}},"die":{"kind":"Function","name":"die","headline":"die stops the Flux script execution and returns an error message.","description":null,"parameters":[{"name":"msg","headline":"msg: Error message to return.","description":null,"required":true}],"flux_type":"(msg: string) => A","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":303,"column":1},"end":{"line":303,"column":33},"source":"builtin die : (msg: string) => A"},"examples":[],"metadata":{"introduced":"0.82.0"}},"difference":{"kind":"Function","name":"difference","headline":"difference returns the difference between subsequent values.","description":null,"parameters":[{"name":"nonNegative","headline":"nonNegative: Disallow negative differences. Default is `false`.","description":null,"required":false},{"name":"columns","headline":"columns: List of columns to operate on. Default is `[\"_value\"]`.","description":null,"required":false},{"name":"keepFirst","headline":"keepFirst: Keep the first row in each input table. Default is `false`.","description":null,"required":false},{"name":"initialZero","headline":"initialZero: Use zero (0) as the initial value in the difference calculation\n when the subsequent value is less than the previous value and `nonNegative` is\n `true`. Default is `false`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n ?columns: [string],\n ?initialZero: bool,\n ?keepFirst: bool,\n ?nonNegative: bool,\n) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":375,"column":1},"end":{"line":384,"column":14},"source":"builtin difference : (\n <-tables: stream[T],\n ?nonNegative: bool,\n ?columns: [string],\n ?keepFirst: bool,\n ?initialZero: bool,\n ) => stream[R]\n where\n T: Record,\n R: Record"},"examples":[],"metadata":{"introduced":"0.7.1","tags":"transformations"}},"display":{"kind":"Function","name":"display","headline":"display returns the Flux literal representation of any value as a string.","description":null,"parameters":[{"name":"v","headline":"v: Value to convert for display.","description":null,"required":true}],"flux_type":"(v: A) => string","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3538,"column":1},"end":{"line":3538,"column":35},"source":"builtin display : (v: A) => string"},"examples":[],"metadata":{"introduced":"0.154.0"}},"distinct":{"kind":"Function","name":"distinct","headline":"distinct returns all unique values in a specified column.","description":null,"parameters":[{"name":"column","headline":"column: Column to return unique values from. Default is `_value`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?column: string) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":425,"column":1},"end":{"line":425,"column":98},"source":"builtin distinct : (<-tables: stream[A], ?column: string) => stream[B] where A: Record, B: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, selectors"}},"doubleEMA":{"kind":"Function","name":"doubleEMA","headline":"doubleEMA returns the double exponential moving average (DEMA) of values in\nthe `_value` column grouped into `n` number of points, giving more weight to\nrecent data.","description":null,"parameters":[{"name":"n","headline":"n: Number of points to average.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}], n: int) => stream[C] where B: Numeric, C: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4468,"column":1},"end":{"line":4474,"column":36},"source":"doubleEMA = (n, tables=<-) =>\n tables\n |> exponentialMovingAverage(n: n)\n |> duplicate(column: \"_value\", as: \"__ema\")\n |> exponentialMovingAverage(n: n)\n |> map(fn: (r) => ({r with _value: 2.0 * r.__ema - r._value}))\n |> drop(columns: [\"__ema\"])"},"examples":[],"metadata":{"introduced":"0.38.0","tags":"transformations"}},"drop":{"kind":"Function","name":"drop","headline":"drop removes specified columns from a table.","description":null,"parameters":[{"name":"columns","headline":"columns: List of columns to remove from input tables. Mutually exclusive with `fn`.","description":null,"required":false},{"name":"fn","headline":"fn: Predicate function with a `column` parameter that returns a boolean\n value indicating whether or not the column should be removed from input tables.\n Mutually exclusive with `columns`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?columns: [string], ?fn: (column: string) => bool) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":462,"column":1},"end":{"line":465,"column":14},"source":"builtin drop : (<-tables: stream[A], ?fn: (column: string) => bool, ?columns: [string]) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations"}},"duplicate":{"kind":"Function","name":"duplicate","headline":"duplicate duplicates a specified column in a table.","description":null,"parameters":[{"name":"column","headline":"column: Column to duplicate.","description":null,"required":true},{"name":"as","headline":"as: Name to assign to the duplicate column.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], as: string, column: string) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":494,"column":1},"end":{"line":497,"column":14},"source":"builtin duplicate : (<-tables: stream[A], column: string, as: string) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations"}},"duration":{"kind":"Function","name":"duration","headline":"duration converts a value to a duration type.","description":null,"parameters":[{"name":"v","headline":"v: Value to convert.","description":null,"required":true}],"flux_type":"(v: A) => duration","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3210,"column":1},"end":{"line":3210,"column":38},"source":"builtin duration : (v: A) => duration"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"type-conversions"}},"elapsed":{"kind":"Function","name":"elapsed","headline":"elapsed returns the time between subsequent records.","description":null,"parameters":[{"name":"unit","headline":"unit: Unit of time used in the calculation. Default is `1s`.","description":null,"required":false},{"name":"timeColumn","headline":"timeColumn: Column to use to compute the elapsed time. Default is `_time`.","description":null,"required":false},{"name":"columnName","headline":"columnName: Column to store elapsed times in. Default is `elapsed`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?columnName: string, ?timeColumn: string, ?unit: duration) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":525,"column":1},"end":{"line":533,"column":14},"source":"builtin elapsed : (\n <-tables: stream[A],\n ?unit: duration,\n ?timeColumn: string,\n ?columnName: string,\n ) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.36.0","tags":"transformations"}},"exponentialMovingAverage":{"kind":"Function","name":"exponentialMovingAverage","headline":"exponentialMovingAverage calculates the exponential moving average of `n`\nnumber of values in the `_value` column giving more weight to more recent data.","description":null,"parameters":[{"name":"n","headline":"n: Number of values to average.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}], n: int) => stream[{A with _value: B}] where B: Numeric","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":574,"column":1},"end":{"line":579,"column":15},"source":"builtin exponentialMovingAverage : (\n <-tables: stream[{B with _value: A}],\n n: int,\n ) => stream[{B with _value: A}]\n where\n A: Numeric"},"examples":[],"metadata":{"introduced":"0.37.0","tags":"transformations"}},"fill":{"kind":"Function","name":"fill","headline":"fill replaces all null values in input tables with a non-null value.","description":null,"parameters":[{"name":"column","headline":"column: Column to replace null values in. Default is `_value`.","description":null,"required":false},{"name":"value","headline":"value: Constant value to replace null values with.","description":null,"required":false},{"name":"usePrevious","headline":"usePrevious: Replace null values with the previous non-null value.\n Default is `false`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[B], ?column: string, ?usePrevious: bool, ?value: A) => stream[C] where B: Record, C: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":619,"column":1},"end":{"line":622,"column":14},"source":"builtin fill : (<-tables: stream[A], ?column: string, ?value: B, ?usePrevious: bool) => stream[C]\n where\n A: Record,\n C: Record"},"examples":[],"metadata":{"introduced":"0.14.0","tags":"transformations"}},"filter":{"kind":"Function","name":"filter","headline":"filter filters data based on conditions defined in a predicate function (`fn`).","description":null,"parameters":[{"name":"fn","headline":"fn: Single argument predicate function that evaluates `true` or `false`.","description":null,"required":true},{"name":"onEmpty","headline":"onEmpty: Action to take with empty tables. Default is `drop`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], fn: (r: A) => bool, ?onEmpty: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":673,"column":1},"end":{"line":675,"column":14},"source":"builtin filter : (<-tables: stream[A], fn: (r: A) => bool, ?onEmpty: string) => stream[A]\n where\n A: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations,filters"}},"findColumn":{"kind":"Function","name":"findColumn","headline":"findColumn returns an array of values in a specified column from the first\ntable in a stream of tables that matches the specified predicate function.","description":null,"parameters":[{"name":"column","headline":"column: Column to extract.","description":null,"required":true},{"name":"fn","headline":"fn: Predicate function to evaluate input table group keys.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[B], column: string, fn: (key: A) => bool) => [C] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3057,"column":1},"end":{"line":3060,"column":14},"source":"builtin findColumn : (<-tables: stream[A], fn: (key: B) => bool, column: string) => [C]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.68.0","tags":"dynamic queries"}},"findRecord":{"kind":"Function","name":"findRecord","headline":"findRecord returns a row at a specified index as a record from the first\ntable in a stream of tables that matches the specified predicate function.","description":null,"parameters":[{"name":"idx","headline":"idx: Index of the record to extract.","description":null,"required":true},{"name":"fn","headline":"fn: Predicate function to evaluate input table group keys.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[B], fn: (key: A) => bool, idx: int) => B where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3094,"column":1},"end":{"line":3097,"column":14},"source":"builtin findRecord : (<-tables: stream[A], fn: (key: B) => bool, idx: int) => A\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.68.0","tags":"dynamic queries"}},"first":{"kind":"Function","name":"first","headline":"first returns the first non-null record from each input table.","description":null,"parameters":[{"name":"column","headline":"column: Column to operate on. Default is `_value`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?column: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":699,"column":1},"end":{"line":699,"column":84},"source":"builtin first : (<-tables: stream[A], ?column: string) => stream[A] where A: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations,selectors"}},"float":{"kind":"Function","name":"float","headline":"float converts a value to a float type.","description":null,"parameters":[{"name":"v","headline":"v: Value to convert.","description":null,"required":true}],"flux_type":"(v: A) => float","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3254,"column":1},"end":{"line":3254,"column":32},"source":"builtin float : (v: A) => float"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"type-conversions"}},"getColumn":{"kind":"Function","name":"getColumn","headline":"getColumn extracts a specified column from a table as an array.","description":null,"parameters":[{"name":"column","headline":"column: Column to extract.","description":null,"required":true},{"name":"table","headline":"table: Input table. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-table: stream[A], column: string) => [B] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2996,"column":1},"end":{"line":2996,"column":80},"source":"builtin getColumn : (<-table: stream[A], column: string) => [B] where A: Record"},"examples":[],"metadata":{"introduced":"0.29.0","tags":"dynamic queries"}},"getRecord":{"kind":"Function","name":"getRecord","headline":"getRecord extracts a row at a specified index from a table as a record.","description":null,"parameters":[{"name":"idx","headline":"idx: Index of the record to extract.","description":null,"required":true},{"name":"table","headline":"table: Input table. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-table: stream[A], idx: int) => A where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3023,"column":1},"end":{"line":3023,"column":72},"source":"builtin getRecord : (<-table: stream[A], idx: int) => A where A: Record"},"examples":[],"metadata":{"introduced":"0.29.0","tags":"dynamic queries"}},"group":{"kind":"Function","name":"group","headline":"group regroups input data by modifying group key of input tables.","description":null,"parameters":[{"name":"columns","headline":"columns: List of columns to use in the grouping operation. Default is `[]`.","description":null,"required":false},{"name":"mode","headline":"mode: Grouping mode. Default is `by`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?columns: [string], ?mode: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":752,"column":1},"end":{"line":754,"column":14},"source":"builtin group : (<-tables: stream[A], ?mode: string, ?columns: [string]) => stream[A]\n where\n A: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations"}},"highestAverage":{"kind":"Function","name":"highestAverage","headline":"highestAverage calculates the average of each input table and returns the\nhighest `n` averages.","description":null,"parameters":[{"name":"n","headline":"n: Number of records to return.","description":null,"required":true},{"name":"column","headline":"column: Column to evaluate. Default is `_value`.","description":null,"required":false},{"name":"groupColumns","headline":"groupColumns: List of columns to group by. Default is `[]`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], n: int, ?column: string, ?groupColumns: [string]) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4236,"column":1},"end":{"line":4244,"column":10},"source":"highestAverage = (n, column=\"_value\", groupColumns=[], tables=<-) =>\n tables\n |> _highestOrLowest(\n n: n,\n column: column,\n groupColumns: groupColumns,\n reducer: (tables=<-) => tables |> mean(column: column),\n _sortLimit: top,\n )"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, selectors"}},"highestCurrent":{"kind":"Function","name":"highestCurrent","headline":"highestCurrent selects the last record from each input table and returns the\nhighest `n` records.","description":null,"parameters":[{"name":"n","headline":"n: Number of records to return.","description":null,"required":true},{"name":"column","headline":"column: Column to evaluate. Default is `_value`.","description":null,"required":false},{"name":"groupColumns","headline":"groupColumns: List of columns to group by. Default is `[]`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], n: int, ?column: string, ?groupColumns: [string]) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4271,"column":1},"end":{"line":4279,"column":10},"source":"highestCurrent = (n, column=\"_value\", groupColumns=[], tables=<-) =>\n tables\n |> _highestOrLowest(\n n: n,\n column: column,\n groupColumns: groupColumns,\n reducer: (tables=<-) => tables |> last(column: column),\n _sortLimit: top,\n )"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, selectors"}},"highestMax":{"kind":"Function","name":"highestMax","headline":"highestMax selects the record with the highest value in the specified `column`\nfrom each input table and returns the highest `n` records.","description":null,"parameters":[{"name":"n","headline":"n: Number of records to return.","description":null,"required":true},{"name":"column","headline":"column: Column to evaluate. Default is `_value`.","description":null,"required":false},{"name":"groupColumns","headline":"groupColumns: List of columns to group by. Default is `[]`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], n: int, ?column: string, ?groupColumns: [string]) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4199,"column":1},"end":{"line":4209,"column":14},"source":"highestMax =\n (n, column=\"_value\", groupColumns=[], tables=<-) =>\n tables\n |> _highestOrLowest(\n n: n,\n column: column,\n groupColumns: groupColumns,\n // TODO(nathanielc): Once max/min support selecting based on multiple columns change this to pass all columns.\n reducer: (tables=<-) => tables |> max(column: column),\n _sortLimit: top,\n )"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, selectors"}},"histogram":{"kind":"Function","name":"histogram","headline":"histogram approximates the cumulative distribution of a dataset by counting\ndata frequencies for a list of bins.","description":null,"parameters":[{"name":"column","headline":"column: Column containing input values. Column must be of type float.\n Default is `_value`.","description":null,"required":false},{"name":"upperBoundColumn","headline":"upperBoundColumn: Column to store bin upper bounds in. Default is `le`.","description":null,"required":false},{"name":"countColumn","headline":"countColumn: Column to store bin counts in. Default is `_value`.","description":null,"required":false},{"name":"bins","headline":"bins: List of upper bounds to use when computing the histogram frequencies.","description":null,"required":true},{"name":"normalize","headline":"normalize: Convert counts into frequency values between 0 and 1.\n Default is `false`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n bins: [float],\n ?column: string,\n ?countColumn: string,\n ?normalize: bool,\n ?upperBoundColumn: string,\n) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":812,"column":1},"end":{"line":822,"column":14},"source":"builtin histogram : (\n <-tables: stream[A],\n ?column: string,\n ?upperBoundColumn: string,\n ?countColumn: string,\n bins: [float],\n ?normalize: bool,\n ) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations"}},"histogramQuantile":{"kind":"Function","name":"histogramQuantile","headline":"histogramQuantile approximates a quantile given a histogram that approximates\nthe cumulative distribution of the dataset.","description":null,"parameters":[{"name":"quantile","headline":"quantile: Quantile to compute. Value must be between 0 and 1.","description":null,"required":false},{"name":"countColumn","headline":"countColumn: Column containing histogram bin counts. Default is `_value`.","description":null,"required":false},{"name":"upperBoundColumn","headline":"upperBoundColumn: Column containing histogram bin upper bounds.\n Default is `le`.","description":null,"required":false},{"name":"valueColumn","headline":"valueColumn: Column to store the computed quantile in. Default is `_value.","description":null,"required":false},{"name":"minValue","headline":"minValue: Assumed minimum value of the dataset. Default is `0.0`.","description":null,"required":false},{"name":"onNonmonotonic","headline":"onNonmonotonic: Describes behavior when counts are not monotonically increasing\n when sorted by upper bound. Default is `error`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n ?countColumn: string,\n ?minValue: float,\n ?onNonmonotonic: string,\n ?quantile: float,\n ?upperBoundColumn: string,\n ?valueColumn: string,\n) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":884,"column":1},"end":{"line":895,"column":14},"source":"builtin histogramQuantile : (\n <-tables: stream[A],\n ?quantile: float,\n ?countColumn: string,\n ?upperBoundColumn: string,\n ?valueColumn: string,\n ?minValue: float,\n ?onNonmonotonic: string,\n ) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"tags":"transformations"}},"holtWinters":{"kind":"Function","name":"holtWinters","headline":"holtWinters applies the Holt-Winters forecasting method to input tables.","description":null,"parameters":[{"name":"n","headline":"n: Number of values to predict.","description":null,"required":true},{"name":"interval","headline":"interval: Interval between two data points.","description":null,"required":true},{"name":"withFit","headline":"withFit: Return fitted data in results. Default is `false`.","description":null,"required":false},{"name":"column","headline":"column: Column to operate on. Default is `_value`.","description":null,"required":false},{"name":"timeColumn","headline":"timeColumn: Column containing time values to use in the calculating.\n Default is `_time`.","description":null,"required":false},{"name":"seasonality","headline":"seasonality: Number of points in a season. Default is `0`.","description":null,"required":false},{"name":"withMinSSE","headline":"withMinSSE: Return minSSE data in results. Default is `false`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n interval: duration,\n n: int,\n ?column: string,\n ?seasonality: int,\n ?timeColumn: string,\n ?withFit: bool,\n ?withMinSSE: bool,\n) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":984,"column":1},"end":{"line":996,"column":14},"source":"builtin holtWinters : (\n <-tables: stream[A],\n n: int,\n interval: duration,\n ?withFit: bool,\n ?column: string,\n ?timeColumn: string,\n ?seasonality: int,\n ?withMinSSE: bool,\n ) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.38.0","tags":"transformations"}},"hourSelection":{"kind":"Function","name":"hourSelection","headline":"hourSelection filters rows by time values in a specified hour range.","description":null,"parameters":[{"name":"start","headline":"start: First hour of the hour range (inclusive). Hours range from `[0-23]`.","description":null,"required":true},{"name":"stop","headline":"stop: Last hour of the hour range (inclusive). Hours range from `[0-23]`.","description":null,"required":true},{"name":"location","headline":"location: Location used to determine timezone. Default is the `location` option.","description":null,"required":false},{"name":"timeColumn","headline":"timeColumn: Column that contains the time value. Default is `_time`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n start: int,\n stop: int,\n ?location: {zone: string, offset: duration},\n ?timeColumn: string,\n) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":1043,"column":1},"end":{"line":1051,"column":61},"source":"hourSelection = (\n tables=<-,\n start,\n stop,\n location=location,\n timeColumn=\"_time\",\n) =>\n tables\n |> _hourSelection(start, stop, location, timeColumn)"},"examples":[],"metadata":{"introduced":"0.39.0","tags":"transformations, date/time, filters"}},"increase":{"kind":"Function","name":"increase","headline":"increase returns the cumulative sum of non-negative differences between subsequent values.","description":null,"parameters":[{"name":"columns","headline":"columns: List of columns to operate on. Default is `[\"_value\"]`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?columns: [string]) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3931,"column":1},"end":{"line":3934,"column":43},"source":"increase = (tables=<-, columns=[\"_value\"]) =>\n tables\n |> difference(nonNegative: true, columns: columns, keepFirst: true, initialZero: true)\n |> cumulativeSum(columns: columns)"},"examples":[],"metadata":{"introduced":"0.71.0","tags":"transformations"}},"inf":{"kind":"Value","name":"inf","headline":"inf represents a floating point value of infinity.","description":null,"flux_type":"duration","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3568,"column":1},"end":{"line":3568,"column":23},"source":"builtin inf : duration"},"examples":[],"metadata":null},"int":{"kind":"Function","name":"int","headline":"int converts a value to an integer type.","description":null,"parameters":[{"name":"v","headline":"v: Value to convert.","description":null,"required":true}],"flux_type":"(v: A) => int","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3314,"column":1},"end":{"line":3314,"column":28},"source":"builtin int : (v: A) => int"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"type-conversions"}},"integral":{"kind":"Function","name":"integral","headline":"integral computes the area under the curve per unit of time of subsequent non-null records.","description":null,"parameters":[{"name":"unit","headline":"unit: Unit of time to use to compute the integral.","description":null,"required":false},{"name":"column","headline":"column: Column to operate on. Default is `_value`.","description":null,"required":false},{"name":"timeColumn","headline":"timeColumn: Column that contains time values to use in the operation.\n Default is `_time`.","description":null,"required":false},{"name":"interpolate","headline":"interpolate: Type of interpolation to use. Default is `\"\"`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n ?column: string,\n ?interpolate: string,\n ?timeColumn: string,\n ?unit: duration,\n) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":1101,"column":1},"end":{"line":1110,"column":14},"source":"builtin integral : (\n <-tables: stream[A],\n ?unit: duration,\n ?timeColumn: string,\n ?column: string,\n ?interpolate: string,\n ) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, aggregates"}},"join":{"kind":"Function","name":"join","headline":"join merges two streams of tables into a single output stream based on columns with equal values.\nNull values are not considered equal when comparing column values.\nThe resulting schema is the union of the input schemas.\nThe resulting group key is the union of the input group keys.","description":null,"parameters":[{"name":"tables","headline":"tables: Record containing two input streams to join.","description":null,"required":false},{"name":"on","headline":"on: List of columns to join on.","description":null,"required":false},{"name":"method","headline":"method: Join method. Default is `inner`.","description":null,"required":false}],"flux_type":"(<-tables: A, ?method: string, ?on: [string]) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":1184,"column":1},"end":{"line":1184,"column":101},"source":"builtin join : (<-tables: A, ?method: string, ?on: [string]) => stream[B] where A: Record, B: Record"},"examples":[],"metadata":{"deprecated":"0.172.0","introduced":"0.7.0","tags":"transformations"}},"kaufmansAMA":{"kind":"Function","name":"kaufmansAMA","headline":"kaufmansAMA calculates the Kaufman’s Adaptive Moving Average (KAMA) using\nvalues in input tables.","description":null,"parameters":[{"name":"n","headline":"n: Period or number of points to use in the calculation.","description":null,"required":true},{"name":"column","headline":"column: Column to operate on. Default is `_value`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], n: int, ?column: string) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":1211,"column":1},"end":{"line":1214,"column":14},"source":"builtin kaufmansAMA : (<-tables: stream[A], n: int, ?column: string) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.40.0","tags":"transformations"}},"kaufmansER":{"kind":"Function","name":"kaufmansER","headline":"kaufmansER computes the Kaufman's Efficiency Ratio (KER) of values in the\n`_value` column for each input table.","description":null,"parameters":[{"name":"n","headline":"n: Period or number of points to use in the calculation.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], n: int) => stream[{B with _value: float, _value: float}] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4501,"column":1},"end":{"line":4504,"column":76},"source":"kaufmansER = (n, tables=<-) =>\n tables\n |> chandeMomentumOscillator(n: n)\n |> map(fn: (r) => ({r with _value: math.abs(x: r._value) / 100.0}))"},"examples":[],"metadata":{"introduced":"0.40.0","tags":"transformations"}},"keep":{"kind":"Function","name":"keep","headline":"keep returns a stream of tables containing only the specified columns.","description":null,"parameters":[{"name":"columns","headline":"columns: Columns to keep in output tables. Cannot be used with `fn`.","description":null,"required":false},{"name":"fn","headline":"fn: Predicate function that takes a column name as a parameter (column) and\n returns a boolean indicating whether or not the column should be kept in\n output tables. Cannot be used with `columns`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?columns: [string], ?fn: (column: string) => bool) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":1251,"column":1},"end":{"line":1254,"column":14},"source":"builtin keep : (<-tables: stream[A], ?columns: [string], ?fn: (column: string) => bool) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations"}},"keyValues":{"kind":"Function","name":"keyValues","headline":"keyValues returns a stream of tables with each input tables' group key and\ntwo columns, _key and _value, that correspond to unique column label and value\npairs for each input table.","description":null,"parameters":[{"name":"keyColumns","headline":"keyColumns: List of columns from which values are extracted.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?keyColumns: [string]) => stream[{B with _value: C, _key: string}] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":1372,"column":1},"end":{"line":1378,"column":14},"source":"builtin keyValues : (\n <-tables: stream[A],\n ?keyColumns: [string],\n ) => stream[{C with _key: string, _value: B}]\n where\n A: Record,\n C: Record"},"examples":[],"metadata":{"introduced":"0.13.0","tags":"transformations"}},"keys":{"kind":"Function","name":"keys","headline":"keys returns the columns that are in the group key of each input table.","description":null,"parameters":[{"name":"column","headline":"column: Column to store group key labels in. Default is `_value`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?column: string) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":1610,"column":1},"end":{"line":1610,"column":94},"source":"builtin keys : (<-tables: stream[A], ?column: string) => stream[B] where A: Record, B: Record"},"examples":[],"metadata":{"introduced":"0.13.0","tags":"transformations"}},"last":{"kind":"Function","name":"last","headline":"last returns the last row with a non-null value from each input table.","description":null,"parameters":[{"name":"column","headline":"column: Column to use to verify the existence of a value.\n Default is `_value`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?column: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":1639,"column":1},"end":{"line":1639,"column":83},"source":"builtin last : (<-tables: stream[A], ?column: string) => stream[A] where A: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations,selectors"}},"length":{"kind":"Function","name":"length","headline":"length returns the number of elements in an array.","description":null,"parameters":[{"name":"arr","headline":"arr: Array to evaluate. Default is the piped-forward array (`<-`).","description":null,"required":false}],"flux_type":"(<-arr: [A]) => int","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3588,"column":1},"end":{"line":3588,"column":37},"source":"builtin length : (<-arr: [A]) => int"},"examples":[],"metadata":{"introduced":"0.7.0"}},"limit":{"kind":"Function","name":"limit","headline":"limit returns the first `n` rows after the specified `offset` from each input table.","description":null,"parameters":[{"name":"n","headline":"n: Maximum number of rows to return.","description":null,"required":true},{"name":"offset","headline":"offset: Number of rows to skip per table before limiting to `n`.\n Default is `0`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], n: int, ?offset: int) => stream[A]","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":1674,"column":1},"end":{"line":1674,"column":73},"source":"builtin limit : (<-tables: stream[A], n: int, ?offset: int) => stream[A]"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, selectors"}},"linearBins":{"kind":"Function","name":"linearBins","headline":"linearBins generates a list of linearly separated float values.","description":null,"parameters":[{"name":"start","headline":"start: First value to return in the list.","description":null,"required":true},{"name":"width","headline":"width: Distance between subsequent values.","description":null,"required":true},{"name":"count","headline":"count: Number of values to return.","description":null,"required":true},{"name":"infinity","headline":"infinity: Include an infinite value at the end of the list. Default is `true`.","description":null,"required":false}],"flux_type":"(count: int, start: float, width: float, ?infinity: bool) => [float]","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3611,"column":1},"end":{"line":3611,"column":90},"source":"builtin linearBins : (start: float, width: float, count: int, ?infinity: bool) => [float]"},"examples":[],"metadata":{"introduced":"0.19.0"}},"logarithmicBins":{"kind":"Function","name":"logarithmicBins","headline":"logarithmicBins generates a list of exponentially separated float values.","description":null,"parameters":[{"name":"start","headline":"start: First value to return in the list.","description":null,"required":true},{"name":"factor","headline":"factor: Multiplier to apply to subsequent values.","description":null,"required":true},{"name":"count","headline":"count: Number of values to return.","description":null,"required":true},{"name":"infinity","headline":"infinity: Include an infinite value at the end of the list. Default is `true`.","description":null,"required":false}],"flux_type":"(count: int, factor: float, start: float, ?infinity: bool) => [float]","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3634,"column":1},"end":{"line":3634,"column":96},"source":"builtin logarithmicBins : (start: float, factor: float, count: int, ?infinity: bool) => [float]"},"examples":[],"metadata":{"introduced":"0.19.0"}},"lowestAverage":{"kind":"Function","name":"lowestAverage","headline":"lowestAverage calculates the average of each input table and returns the lowest\n`n` averages.","description":null,"parameters":[{"name":"n","headline":"n: Number of records to return.","description":null,"required":true},{"name":"column","headline":"column: Column to evaluate. Default is `_value`.","description":null,"required":false},{"name":"groupColumns","headline":"groupColumns: List of columns to group by. Default is `[]`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], n: int, ?column: string, ?groupColumns: [string]) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4343,"column":1},"end":{"line":4351,"column":10},"source":"lowestAverage = (n, column=\"_value\", groupColumns=[], tables=<-) =>\n tables\n |> _highestOrLowest(\n n: n,\n column: column,\n groupColumns: groupColumns,\n reducer: (tables=<-) => tables |> mean(column: column),\n _sortLimit: bottom,\n )"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, selectors"}},"lowestCurrent":{"kind":"Function","name":"lowestCurrent","headline":"lowestCurrent selects the last record from each input table and returns the\nlowest `n` records.","description":null,"parameters":[{"name":"n","headline":"n: Number of records to return.","description":null,"required":true},{"name":"column","headline":"column: Column to evaluate. Default is `_value`.","description":null,"required":false},{"name":"groupColumns","headline":"groupColumns: List of columns to group by. Default is `[]`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], n: int, ?column: string, ?groupColumns: [string]) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4378,"column":1},"end":{"line":4386,"column":10},"source":"lowestCurrent = (n, column=\"_value\", groupColumns=[], tables=<-) =>\n tables\n |> _highestOrLowest(\n n: n,\n column: column,\n groupColumns: groupColumns,\n reducer: (tables=<-) => tables |> last(column: column),\n _sortLimit: bottom,\n )"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, selectors"}},"lowestMin":{"kind":"Function","name":"lowestMin","headline":"lowestMin selects the record with the lowest value in the specified `column`\nfrom each input table and returns the bottom `n` records.","description":null,"parameters":[{"name":"n","headline":"n: Number of records to return.","description":null,"required":true},{"name":"column","headline":"column: Column to evaluate. Default is `_value`.","description":null,"required":false},{"name":"groupColumns","headline":"groupColumns: List of columns to group by. Default is `[]`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], n: int, ?column: string, ?groupColumns: [string]) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4306,"column":1},"end":{"line":4316,"column":14},"source":"lowestMin =\n (n, column=\"_value\", groupColumns=[], tables=<-) =>\n tables\n |> _highestOrLowest(\n n: n,\n column: column,\n groupColumns: groupColumns,\n // TODO(nathanielc): Once max/min support selecting based on multiple columns change this to pass all columns.\n reducer: (tables=<-) => tables |> min(column: column),\n _sortLimit: bottom,\n )"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, selectors"}},"map":{"kind":"Function","name":"map","headline":"map iterates over and applies a function to input rows.","description":null,"parameters":[{"name":"fn","headline":"fn: Single argument function to apply to each record.\n The return value must be a record.","description":null,"required":true},{"name":"mergeKey","headline":"mergeKey: _(Deprecated)_ Merge group keys of mapped records. Default is `false`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], fn: (r: A) => B, ?mergeKey: bool) => stream[B]","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":1749,"column":1},"end":{"line":1749,"column":83},"source":"builtin map : (<-tables: stream[A], fn: (r: A) => B, ?mergeKey: bool) => stream[B]"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations"}},"max":{"kind":"Function","name":"max","headline":"max returns the row with the maximum value in a specified column from each\ninput table.","description":null,"parameters":[{"name":"column","headline":"column: Column to return maximum values from. Default is `_value`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?column: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":1774,"column":1},"end":{"line":1774,"column":82},"source":"builtin max : (<-tables: stream[A], ?column: string) => stream[A] where A: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, selectors"}},"mean":{"kind":"Function","name":"mean","headline":"mean returns the average of non-null values in a specified column from each\ninput table.","description":null,"parameters":[{"name":"column","headline":"column: Column to use to compute means. Default is `_value`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?column: string) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":1797,"column":1},"end":{"line":1797,"column":94},"source":"builtin mean : (<-tables: stream[A], ?column: string) => stream[B] where A: Record, B: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, aggregates"}},"median":{"kind":"Function","name":"median","headline":"median returns the median `_value` of an input table or all non-null records\nin the input table with values that fall within the 0.5 quantile (50th percentile).","description":null,"parameters":[{"name":"column","headline":"column: Column to use to compute the median. Default is `_value`.","description":null,"required":false},{"name":"method","headline":"method: Computation method. Default is `estimate_tdigest`.","description":null,"required":false},{"name":"compression","headline":"compression: Number of centroids to use when compressing the dataset.\n Default is `0.0`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?column: string, ?compression: float, ?method: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3994,"column":1},"end":{"line":3996,"column":86},"source":"median = (method=\"estimate_tdigest\", compression=0.0, column=\"_value\", tables=<-) =>\n tables\n |> quantile(q: 0.5, method: method, compression: compression, column: column)"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, aggregates, selectors"}},"min":{"kind":"Function","name":"min","headline":"min returns the row with the minimum value in a specified column from each\ninput table.","description":null,"parameters":[{"name":"column","headline":"column: Column to return minimum values from. Default is `_value`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?column: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":1822,"column":1},"end":{"line":1822,"column":82},"source":"builtin min : (<-tables: stream[A], ?column: string) => stream[A] where A: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, selectors"}},"mode":{"kind":"Function","name":"mode","headline":"mode returns the non-null value or values that occur most often in a\nspecified column in each input table.","description":null,"parameters":[{"name":"column","headline":"column: Column to return the mode from. Default is `_value`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?column: string) => stream[{B with _value: C}] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":1850,"column":1},"end":{"line":1853,"column":14},"source":"builtin mode : (<-tables: stream[A], ?column: string) => stream[{C with _value: B}]\n where\n A: Record,\n C: Record"},"examples":[],"metadata":{"introduced":"0.36.0","tags":"transformtions, aggregates"}},"movingAverage":{"kind":"Function","name":"movingAverage","headline":"movingAverage calculates the mean of non-null values using the current value\nand `n - 1` previous values in the `_values` column.","description":null,"parameters":[{"name":"n","headline":"n: Number of values to average.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}], n: int) => stream[{A with _value: float}] where B: Numeric","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":1891,"column":1},"end":{"line":1896,"column":15},"source":"builtin movingAverage : (\n <-tables: stream[{B with _value: A}],\n n: int,\n ) => stream[{B with _value: float}]\n where\n A: Numeric"},"examples":[],"metadata":{"introduced":"0.35.0","tags":"transformations"}},"now":{"kind":"Function","name":"now","headline":"now is a function option that, by default, returns the current system time.","description":null,"parameters":[],"flux_type":"() => time","is_option":true,"source_location":{"file":"universe/universe.flux","start":{"line":43,"column":1},"end":{"line":43,"column":25},"source":"option now = system.time"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"date/time"}},"pearsonr":{"kind":"Function","name":"pearsonr","headline":"pearsonr returns the covariance of two streams of tables normalized to the\nPearson R coefficient.","description":null,"parameters":[{"name":"x","headline":"x: First input stream.","description":null,"required":true},{"name":"y","headline":"y: Second input stream.","description":null,"required":true},{"name":"on","headline":"on: List of columns to join on.","description":null,"required":true}],"flux_type":"(on: [string], x: A, y: B) => stream[C] where C: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3734,"column":1},"end":{"line":3734,"column":65},"source":"pearsonr = (x, y, on) => cov(x: x, y: y, on: on, pearsonr: true)"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, aggregates"}},"pivot":{"kind":"Function","name":"pivot","headline":"pivot collects unique values stored vertically (column-wise) and aligns them\nhorizontally (row-wise) into logical sets.","description":null,"parameters":[{"name":"rowKey","headline":"rowKey: Columns to use to uniquely identify an output row.","description":null,"required":true},{"name":"columnKey","headline":"columnKey: Columns to use to identify new output columns.","description":null,"required":true},{"name":"valueColumn","headline":"valueColumn: Column to use to populate the value of pivoted `columnKey` columns.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], columnKey: [string], rowKey: [string], valueColumn: string) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2047,"column":1},"end":{"line":2055,"column":14},"source":"builtin pivot : (\n <-tables: stream[A],\n rowKey: [string],\n columnKey: [string],\n valueColumn: string,\n ) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations"}},"quantile":{"kind":"Function","name":"quantile","headline":"quantile returns rows from each input table with values that fall within a\nspecified quantile or returns the row with the value that represents the\nspecified quantile.","description":null,"parameters":[{"name":"column","headline":"column: Column to use to compute the quantile. Default is `_value`.","description":null,"required":false},{"name":"q","headline":"q: Quantile to compute. Must be between `0.0` and `1.0`.","description":null,"required":true},{"name":"method","headline":"method: Computation method. Default is `estimate_tdigest`.","description":null,"required":false},{"name":"compression","headline":"compression: Number of centroids to use when compressing the dataset.\n Default is `1000.0`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n q: float,\n ?column: string,\n ?compression: float,\n ?method: string,\n) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":1960,"column":1},"end":{"line":1968,"column":14},"source":"builtin quantile : (\n <-tables: stream[A],\n ?column: string,\n q: float,\n ?compression: float,\n ?method: string,\n ) => stream[A]\n where\n A: Record"},"examples":[],"metadata":{"introduced":"0.24.0","tags":"transformations, aggregates, selectors"}},"range":{"kind":"Function","name":"range","headline":"range filters rows based on time bounds.","description":null,"parameters":[{"name":"start","headline":"start: Earliest time to include in results.","description":null,"required":true},{"name":"stop","headline":"stop: Latest time to include in results. Default is `now()`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{C with _time: time}], start: A, ?stop: B) => stream[{C with _time: time, _stop: time, _start: time}]","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2108,"column":1},"end":{"line":2112,"column":65},"source":"builtin range : (\n <-tables: stream[{A with _time: time}],\n start: B,\n ?stop: C,\n ) => stream[{A with _time: time, _start: time, _stop: time}]"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, filters"}},"reduce":{"kind":"Function","name":"reduce","headline":"reduce aggregates rows in each input table using a reducer function (`fn`).","description":null,"parameters":[{"name":"fn","headline":"fn: Reducer function to apply to each row record (`r`).","description":null,"required":true},{"name":"identity","headline":"identity: Record that defines the reducer record and provides initial values\n for the reducer operation on the first row.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[B], fn: (accumulator: A, r: B) => A, identity: A) => stream[C] where A: Record, B: Record, C: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2196,"column":1},"end":{"line":2200,"column":14},"source":"builtin reduce : (<-tables: stream[A], fn: (r: A, accumulator: B) => B, identity: B) => stream[C]\n where\n A: Record,\n B: Record,\n C: Record"},"examples":[],"metadata":{"introduced":"0.23.0","tags":"transformations, aggregates"}},"relativeStrengthIndex":{"kind":"Function","name":"relativeStrengthIndex","headline":"relativeStrengthIndex measures the relative speed and change of values in input tables.","description":null,"parameters":[{"name":"n","headline":"n: Number of values to use to calculate the RSI.","description":null,"required":true},{"name":"columns","headline":"columns: Columns to operate on. Default is `[\"_value\"]`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], n: int, ?columns: [string]) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2236,"column":1},"end":{"line":2239,"column":14},"source":"builtin relativeStrengthIndex : (<-tables: stream[A], n: int, ?columns: [string]) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.38.0","tags":"transformations"}},"rename":{"kind":"Function","name":"rename","headline":"rename renames columns in a table.","description":null,"parameters":[{"name":"columns","headline":"columns: Record that maps old column names to new column names.","description":null,"required":false},{"name":"fn","headline":"fn: Function that takes the current column name (`column`) and returns a\n new column name.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[B], ?columns: A, ?fn: (column: string) => string) => stream[C] where A: Record, B: Record, C: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2287,"column":1},"end":{"line":2291,"column":14},"source":"builtin rename : (<-tables: stream[A], ?fn: (column: string) => string, ?columns: B) => stream[C]\n where\n A: Record,\n B: Record,\n C: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations"}},"sample":{"kind":"Function","name":"sample","headline":"sample selects a subset of the rows from each input table.","description":null,"parameters":[{"name":"n","headline":"n: Sample every Nth element.","description":null,"required":true},{"name":"pos","headline":"pos: Position offset from the start of results where sampling begins.\n Default is -1 (random offset).","description":null,"required":false},{"name":"column","headline":"column: Column to operate on.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], n: int, ?column: string, ?pos: int) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2321,"column":1},"end":{"line":2323,"column":14},"source":"builtin sample : (<-tables: stream[A], n: int, ?pos: int, ?column: string) => stream[A]\n where\n A: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, selectors"}},"set":{"kind":"Function","name":"set","headline":"set assigns a static column value to each row in the input tables.","description":null,"parameters":[{"name":"key","headline":"key: Label of the column to modify or set.","description":null,"required":true},{"name":"value","headline":"value: String value to set.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], key: string, value: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2350,"column":1},"end":{"line":2350,"column":93},"source":"builtin set : (<-tables: stream[A], key: string, value: string) => stream[A] where A: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations"}},"skew":{"kind":"Function","name":"skew","headline":"skew returns the skew of non-null records in each input table as a float.","description":null,"parameters":[{"name":"column","headline":"column: Column to operate on. Default is `_value`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?column: string) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2443,"column":1},"end":{"line":2443,"column":94},"source":"builtin skew : (<-tables: stream[A], ?column: string) => stream[B] where A: Record, B: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, aggregates"}},"sort":{"kind":"Function","name":"sort","headline":"sort orders rows in each intput table based on values in specified columns.","description":null,"parameters":[{"name":"columns","headline":"columns: List of columns to sort by. Default is `[\"_value\"]`.","description":null,"required":false},{"name":"desc","headline":"desc: Sort results in descending order. Default is `false`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?columns: [string], ?desc: bool) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2500,"column":1},"end":{"line":2500,"column":99},"source":"builtin sort : (<-tables: stream[A], ?columns: [string], ?desc: bool) => stream[A] where A: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations"}},"spread":{"kind":"Function","name":"spread","headline":"spread returns the difference between the minimum and maximum values in a\nspecified column.","description":null,"parameters":[{"name":"column","headline":"column: Column to operate on. Default is `_value`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?column: string) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2466,"column":1},"end":{"line":2466,"column":96},"source":"builtin spread : (<-tables: stream[A], ?column: string) => stream[B] where A: Record, B: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, aggregates"}},"stateCount":{"kind":"Function","name":"stateCount","headline":"stateCount returns the number of consecutive rows in a given state.","description":null,"parameters":[{"name":"fn","headline":"fn: Predicate function that identifies the state of a record.","description":null,"required":true},{"name":"column","headline":"column: Column to store the state count in. Default is `stateCount`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], fn: (r: A) => bool, ?column: string) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4026,"column":1},"end":{"line":4028,"column":54},"source":"stateCount = (fn, column=\"stateCount\", tables=<-) =>\n tables\n |> stateTracking(countColumn: column, fn: fn)"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations"}},"stateDuration":{"kind":"Function","name":"stateDuration","headline":"stateDuration returns the cumulative duration of a given state.","description":null,"parameters":[{"name":"fn","headline":"fn: Predicate function that identifies the state of a record.","description":null,"required":true},{"name":"column","headline":"column: Column to store the state duration in. Default is `stateDuration`.","description":null,"required":false},{"name":"timeColumn","headline":"timeColumn: Time column to use to calculate elapsed time between rows.\n Default is `_time`.","description":null,"required":false},{"name":"unit","headline":"unit: Unit of time to use to increment state duration. Default is `1s` (seconds).","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n fn: (r: A) => bool,\n ?column: string,\n ?timeColumn: string,\n ?unit: duration,\n) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4077,"column":1},"end":{"line":4085,"column":101},"source":"stateDuration = (\n fn,\n column=\"stateDuration\",\n timeColumn=\"_time\",\n unit=1s,\n tables=<-,\n) =>\n tables\n |> stateTracking(durationColumn: column, timeColumn: timeColumn, fn: fn, durationUnit: unit)"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations"}},"stateTracking":{"kind":"Function","name":"stateTracking","headline":"stateTracking returns the cumulative count and duration of consecutive\nrows that match a predicate function that defines a state.","description":null,"parameters":[{"name":"fn","headline":"fn: Predicate function to determine state.","description":null,"required":true},{"name":"countColumn","headline":"countColumn: Column to store state count in.","description":null,"required":false},{"name":"durationColumn","headline":"durationColumn: Column to store state duration in.","description":null,"required":false},{"name":"durationUnit","headline":"durationUnit: Unit of time to report state duration in. Default is `1s`.","description":null,"required":false},{"name":"timeColumn","headline":"timeColumn: Column with time values used to calculate state duration.\n Default is `_time`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n fn: (r: A) => bool,\n ?countColumn: string,\n ?durationColumn: string,\n ?durationUnit: duration,\n ?timeColumn: string,\n) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2569,"column":1},"end":{"line":2579,"column":14},"source":"builtin stateTracking : (\n <-tables: stream[A],\n fn: (r: A) => bool,\n ?countColumn: string,\n ?durationColumn: string,\n ?durationUnit: duration,\n ?timeColumn: string,\n ) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations"}},"stddev":{"kind":"Function","name":"stddev","headline":"stddev returns the standard deviation of non-null values in a specified column.","description":null,"parameters":[{"name":"column","headline":"column: Column to operate on. Default is `_value`.","description":null,"required":false},{"name":"mode","headline":"mode: Standard deviation mode or type of standard deviation to calculate.\n Default is `sample`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?column: string, ?mode: string) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2611,"column":1},"end":{"line":2614,"column":14},"source":"builtin stddev : (<-tables: stream[A], ?column: string, ?mode: string) => stream[B]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, aggregates"}},"string":{"kind":"Function","name":"string","headline":"string converts a value to a string type.","description":null,"parameters":[{"name":"v","headline":"v: Value to convert.","description":null,"required":true}],"flux_type":"(v: A) => string","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3351,"column":1},"end":{"line":3351,"column":34},"source":"builtin string : (v: A) => string"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"type-conversions"}},"sum":{"kind":"Function","name":"sum","headline":"sum returns the sum of non-null values in a specified column.","description":null,"parameters":[{"name":"column","headline":"column: Column to operate on. Default is `_value`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?column: string) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2636,"column":1},"end":{"line":2636,"column":93},"source":"builtin sum : (<-tables: stream[A], ?column: string) => stream[B] where A: Record, B: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, aggregates"}},"tableFind":{"kind":"Function","name":"tableFind","headline":"tableFind extracts the first table in a stream with group key values that\nmatch a specified predicate.","description":null,"parameters":[{"name":"fn","headline":"fn: Predicate function to evaluate input table group keys.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[B], fn: (key: A) => bool) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2953,"column":1},"end":{"line":2956,"column":14},"source":"builtin tableFind : (<-tables: stream[A], fn: (key: B) => bool) => stream[A]\n where\n A: Record,\n B: Record"},"examples":[],"metadata":{"introduced":"0.29.0","tags":"dynamic queries"}},"tail":{"kind":"Function","name":"tail","headline":"tail limits each output table to the last `n` rows.","description":null,"parameters":[{"name":"n","headline":"n: Maximum number of rows to output.","description":null,"required":true},{"name":"offset","headline":"offset: Number of records to skip at the end of a table table before\n limiting to `n`. Default is 0.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], n: int, ?offset: int) => stream[A]","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2387,"column":1},"end":{"line":2387,"column":72},"source":"builtin tail : (<-tables: stream[A], n: int, ?offset: int) => stream[A]"},"examples":[],"metadata":{"introduced":"0.39.0","tags":"transformations"}},"time":{"kind":"Function","name":"time","headline":"time converts a value to a time type.","description":null,"parameters":[{"name":"v","headline":"v: Value to convert.","description":null,"required":true}],"flux_type":"(v: A) => time","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3393,"column":1},"end":{"line":3393,"column":30},"source":"builtin time : (v: A) => time"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"type-conversions"}},"timeShift":{"kind":"Function","name":"timeShift","headline":"timeShift adds a fixed duration to time columns.","description":null,"parameters":[{"name":"duration","headline":"duration: Amount of time to add to each time value. May be a negative duration.","description":null,"required":true},{"name":"columns","headline":"columns: List of time columns to operate on. Default is `[\"_start\", \"_stop\", \"_time\"]`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], duration: duration, ?columns: [string]) => stream[A]","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2421,"column":1},"end":{"line":2421,"column":95},"source":"builtin timeShift : (<-tables: stream[A], duration: duration, ?columns: [string]) => stream[A]"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, date/time"}},"timeWeightedAvg":{"kind":"Function","name":"timeWeightedAvg","headline":"timeWeightedAvg returns the time-weighted average of non-null values in\n`_value` column as a float for each input table.","description":null,"parameters":[{"name":"unit","headline":"unit: Unit of time to use to compute the time-weighted average.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], unit: duration) => stream[{B with _value: float, _value: float, _stop: D, _start: C}] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3664,"column":1},"end":{"line":3674,"column":10},"source":"timeWeightedAvg = (tables=<-, unit) =>\n tables\n |> integral(unit: unit, interpolate: \"linear\")\n |> map(\n fn: (r) =>\n ({r with _value:\n r._value * float(v: uint(v: unit)) / float(\n v: int(v: r._stop) - int(v: r._start),\n ),\n }),\n )"},"examples":[],"metadata":{"introduced":"0.83.0","tags":"transformations, aggregates"}},"timedMovingAverage":{"kind":"Function","name":"timedMovingAverage","headline":"timedMovingAverage returns the mean of values in a defined time range at a\nspecified frequency.","description":null,"parameters":[{"name":"every","headline":"every: Frequency of time window.","description":null,"required":true},{"name":"period","headline":"period: Length of each averaged time window.","description":null,"required":true},{"name":"column","headline":"column: Column to operate on. Default is `_value`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], every: duration, period: duration, ?column: string) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4431,"column":1},"end":{"line":4436,"column":30},"source":"timedMovingAverage = (every, period, column=\"_value\", tables=<-) =>\n tables\n |> window(every: every, period: period)\n |> mean(column: column)\n |> duplicate(column: \"_stop\", as: \"_time\")\n |> window(every: inf)"},"examples":[],"metadata":{"introduced":"0.36.0","tags":"transformations"}},"toBool":{"kind":"Function","name":"toBool","headline":"toBool converts all values in the `_value` column to boolean types.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B, _value: bool}]","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4778,"column":1},"end":{"line":4778,"column":87},"source":"toBool = (tables=<-) => tables |> map(fn: (r) => ({r with _value: bool(v: r._value)}))"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, type-conversions"}},"toFloat":{"kind":"Function","name":"toFloat","headline":"toFloat converts all values in the `_value` column to float types.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B, _value: float}]","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4751,"column":1},"end":{"line":4751,"column":89},"source":"toFloat = (tables=<-) => tables |> map(fn: (r) => ({r with _value: float(v: r._value)}))"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, type-conversions"}},"toInt":{"kind":"Function","name":"toInt","headline":"toInt converts all values in the `_value` column to integer types.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B, _value: int}]","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4667,"column":1},"end":{"line":4667,"column":85},"source":"toInt = (tables=<-) => tables |> map(fn: (r) => ({r with _value: int(v: r._value)}))"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, type-conversions"}},"toString":{"kind":"Function","name":"toString","headline":"toString converts all values in the `_value` column to string types.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B, _value: string}]","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4618,"column":1},"end":{"line":4618,"column":91},"source":"toString = (tables=<-) => tables |> map(fn: (r) => ({r with _value: string(v: r._value)}))"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, type-conversions"}},"toTime":{"kind":"Function","name":"toTime","headline":"toTime converts all values in the `_value` column to time types.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B, _value: time}]","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4809,"column":1},"end":{"line":4809,"column":87},"source":"toTime = (tables=<-) => tables |> map(fn: (r) => ({r with _value: time(v: r._value)}))"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, type-conversions"}},"toUInt":{"kind":"Function","name":"toUInt","headline":"toUInt converts all values in the `_value` column to unsigned integer types.","description":null,"parameters":[{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B, _value: uint}]","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4716,"column":1},"end":{"line":4716,"column":87},"source":"toUInt = (tables=<-) => tables |> map(fn: (r) => ({r with _value: uint(v: r._value)}))"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, type-conversions"}},"today":{"kind":"Function","name":"today","headline":"today returns the now() timestamp truncated to the day unit.","description":null,"parameters":[],"flux_type":"() => time","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4833,"column":1},"end":{"line":4833,"column":48},"source":"today = () => date.truncate(t: now(), unit: 1d)"},"examples":[],"metadata":{"introduced":"0.116.0","tags":"date/time"}},"top":{"kind":"Function","name":"top","headline":"top sorts each input table by specified columns and keeps the top `n` records\nin each table.","description":null,"parameters":[{"name":"n","headline":"n: Number of rows to return from each input table.","description":null,"required":true},{"name":"columns","headline":"columns: List of columns to sort by. Default is `[\"_value\"]`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], n: int, ?columns: [string]) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4120,"column":1},"end":{"line":4122,"column":58},"source":"top = (n, columns=[\"_value\"], tables=<-) =>\n tables\n |> _sortLimit(n: n, columns: columns, desc: true)"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, selectors"}},"tripleEMA":{"kind":"Function","name":"tripleEMA","headline":"tripleEMA returns the triple exponential moving average (TEMA) of values in\nthe `_value` column.","description":null,"parameters":[{"name":"n","headline":"n: Number of points to use in the calculation.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}], n: int) => stream[C] where B: Numeric, C: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4541,"column":1},"end":{"line":4549,"column":47},"source":"tripleEMA = (n, tables=<-) =>\n tables\n |> exponentialMovingAverage(n: n)\n |> duplicate(column: \"_value\", as: \"__ema1\")\n |> exponentialMovingAverage(n: n)\n |> duplicate(column: \"_value\", as: \"__ema2\")\n |> exponentialMovingAverage(n: n)\n |> map(fn: (r) => ({r with _value: 3.0 * r.__ema1 - 3.0 * r.__ema2 + r._value}))\n |> drop(columns: [\"__ema1\", \"__ema2\"])"},"examples":[],"metadata":{"introduced":"0.38.0","tags":"transformations"}},"tripleExponentialDerivative":{"kind":"Function","name":"tripleExponentialDerivative","headline":"tripleExponentialDerivative returns the triple exponential derivative (TRIX)\nvalues using `n` points.","description":null,"parameters":[{"name":"n","headline":"n: Number of points to use in the calculation.","description":null,"required":true},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{A with _value: B}], n: int) => stream[{A with _value: float}] where A: Record, B: Numeric","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2684,"column":1},"end":{"line":2690,"column":14},"source":"builtin tripleExponentialDerivative : (\n <-tables: stream[{B with _value: A}],\n n: int,\n ) => stream[{B with _value: float}]\n where\n A: Numeric,\n B: Record"},"examples":[],"metadata":{"introduced":"0.40.0","tags":"transformations"}},"truncateTimeColumn":{"kind":"Function","name":"truncateTimeColumn","headline":"truncateTimeColumn truncates all input time values in the `_time` to a\nspecified unit.","description":null,"parameters":[{"name":"unit","headline":"unit: Unit of time to truncate to.","description":null,"required":true},{"name":"timeColumn","headline":"timeColumn: Time column to truncate. Default is `_time`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[{B with _time: C}], unit: duration, ?timeColumn: A) => stream[{B with _time: C, _time: time}] where C: Timeable","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":4595,"column":1},"end":{"line":4597,"column":83},"source":"truncateTimeColumn = (timeColumn=\"_time\", unit, tables=<-) =>\n tables\n |> map(fn: (r) => ({r with _time: date.truncate(t: r._time, unit: unit)}))"},"examples":[],"metadata":{"introduced":"0.37.0","tags":"transformations, date/time"}},"uint":{"kind":"Function","name":"uint","headline":"uint converts a value to an unsigned integer type.","description":null,"parameters":[{"name":"v","headline":"v: Value to convert.","description":null,"required":true}],"flux_type":"(v: A) => uint","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":3442,"column":1},"end":{"line":3442,"column":30},"source":"builtin uint : (v: A) => uint"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"type-conversions"}},"union":{"kind":"Function","name":"union","headline":"union merges two or more input streams into a single output stream.","description":null,"parameters":[{"name":"tables","headline":"tables: List of two or more streams of tables to union together.","description":null,"required":true}],"flux_type":"(tables: [stream[A]]) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2747,"column":1},"end":{"line":2747,"column":67},"source":"builtin union : (tables: [stream[A]]) => stream[A] where A: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations"}},"unique":{"kind":"Function","name":"unique","headline":"unique returns all records containing unique values in a specified column.","description":null,"parameters":[{"name":"column","headline":"column: Column to search for unique values. Default is `_value`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?column: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2772,"column":1},"end":{"line":2772,"column":85},"source":"builtin unique : (<-tables: stream[A], ?column: string) => stream[A] where A: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations, selectors"}},"window":{"kind":"Function","name":"window","headline":"window groups records using regular time intervals.","description":null,"parameters":[{"name":"every","headline":"every: Duration of time between windows.","description":null,"required":false},{"name":"period","headline":"period: Duration of windows. Default is the `every` value.","description":null,"required":false},{"name":"offset","headline":"offset: Duration to shift the window boundaries by. Default is `0s`.","description":null,"required":false},{"name":"location","headline":"location: Location used to determine timezone. Default is the `location` option.","description":null,"required":false},{"name":"timeColumn","headline":"timeColumn: Column that contains time values. Default is `_time`.","description":null,"required":false},{"name":"startColumn","headline":"startColumn: Column to store the window start time in. Default is `_start`.","description":null,"required":false},{"name":"stopColumn","headline":"stopColumn: Column to store the window stop time in. Default is `_stop`.","description":null,"required":false},{"name":"createEmpty","headline":"createEmpty: Create empty tables for empty window. Default is `false`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(\n <-tables: stream[A],\n ?createEmpty: bool,\n ?every: duration,\n ?location: {zone: string, offset: duration},\n ?offset: duration,\n ?period: duration,\n ?startColumn: string,\n ?stopColumn: string,\n ?timeColumn: string,\n) => stream[B] where A: Record, B: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2872,"column":1},"end":{"line":2893,"column":10},"source":"window = (\n tables=<-,\n every=0s,\n period=0s,\n offset=0s,\n location=location,\n timeColumn=\"_time\",\n startColumn=\"_start\",\n stopColumn=\"_stop\",\n createEmpty=false,\n) =>\n tables\n |> _window(\n every,\n period,\n offset,\n location,\n timeColumn,\n startColumn,\n stopColumn,\n createEmpty,\n )"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"transformations"}},"yield":{"kind":"Function","name":"yield","headline":"yield delivers input data as a result of the query.","description":null,"parameters":[{"name":"name","headline":"name: Unique name for the yielded results. Default is `_results`.","description":null,"required":false},{"name":"tables","headline":"tables: Input data. Default is piped-forward data (`<-`).","description":null,"required":false}],"flux_type":"(<-tables: stream[A], ?name: string) => stream[A] where A: Record","is_option":false,"source_location":{"file":"universe/universe.flux","start":{"line":2923,"column":1},"end":{"line":2923,"column":82},"source":"builtin yield : (<-tables: stream[A], ?name: string) => stream[A] where A: Record"},"examples":[],"metadata":{"introduced":"0.7.0","tags":"outputs"}}},"examples":[],"metadata":{"introduced":"0.14.0"}}]
\ No newline at end of file
diff --git a/docs/gendocs.js b/docs/gendocs.js
new file mode 100644
index 0000000..9c255f2
--- /dev/null
+++ b/docs/gendocs.js
@@ -0,0 +1,112 @@
+const fs = require('fs');
+const path = require('path');
+
+
+ // Import file generated by flux builds
+const jsonInput = require("./flux-docs-short.json")
+
+// Create directories recursively
+function createDirectoriesRecursive(filePath) {
+ const directory = path.dirname(filePath);
+ if (!fs.existsSync(directory)) {
+ fs.mkdirSync(directory, { recursive: true });
+ }
+}
+
+// Create Markdown documentation for a function
+function createFunctionMarkdown(func) {
+ const { name, headline, description, parameters, flux_type } = func;
+ let markdown = `### \`${name}()\`\n\n`;
+ markdown += `${headline}\n\n`;
+ markdown += '#### Function type signature\n\n';
+ markdown += '```flux\n';
+ markdown += `${flux_type || "No type signature provided"}\n`;
+ markdown += '```\n\n';
+ markdown += '#### Parameters\n\n';
+
+ if (parameters && parameters.length > 0) {
+ markdown += '| Parameter | Description | Required |\n';
+ markdown += '| --- | --- | --- |\n';
+ parameters.forEach(param => {
+ markdown += `| ${param.name || ""} | ${param.headline || ""} | ${param.required ? 'Yes' : 'No'} |\n`;
+ if (param.description) {
+ markdown += `| | ${param.description} | |\n`;
+ }
+ });
+ } else {
+ markdown += 'No parameters provided.\n\n';
+ }
+
+ return markdown;
+}
+
+// Create Markdown documentation for the entire package
+function createPackageMarkdown(packageInfo) {
+ const { name, headline, members } = packageInfo;
+ let markdown = `## \`${name}\` package\n\n`;
+ markdown += `${headline || "No package description provided"}\n\n`;
+ markdown += 'Import the `' + name + '` package:\n\n';
+ markdown += '```flux\n';
+ markdown += `import "${name}"\n`;
+ markdown += '```\n\n';
+ markdown += '### Functions\n\n';
+
+ if (members) {
+ Object.keys(members).forEach(memberName => {
+ const member = members[memberName];
+ markdown += createFunctionMarkdown(member);
+ });
+ } else {
+ markdown += 'No functions provided.\n\n';
+ }
+
+ return markdown;
+}
+
+// Generate documentation for all packages
+function generateDocumentation(jsonInput) {
+ jsonInput.forEach(packageInfo => {
+ const { path } = packageInfo;
+ const markdown = createPackageMarkdown(packageInfo);
+ const filename = `${path}.md`;
+
+ // Ensure directories exist before writing the file
+ createDirectoriesRecursive(filename);
+
+ fs.writeFileSync(filename, markdown);
+ console.log(`Generated documentation for ${path}`);
+ });
+}
+
+// Generate sidebar index with light nesting
+function generateSidebarIndex(jsonInput) {
+ let sidebarIndex = '## \n\n';
+
+ // Create a map to organize packages and functions by the first section of $path
+ const sidebarMap = {};
+
+ jsonInput.forEach(packageInfo => {
+ const { path, name } = packageInfo;
+ const pathSections = path.split('/');
+ const firstSection = pathSections[0];
+
+ sidebarMap[firstSection] = sidebarMap[firstSection] || [];
+ sidebarMap[firstSection].push({ name, path });
+ });
+
+ // Generate sidebar entries with light nesting
+ for (const section in sidebarMap) {
+ sidebarIndex += `- ${section}\n`;
+ sidebarMap[section].forEach(functionInfo => {
+ const { name, path } = functionInfo;
+ sidebarIndex += ` - [${name}](${path}.md)\n`;
+ });
+ }
+
+ fs.writeFileSync('_sidebar.md', sidebarIndex);
+ console.log('Generated sidebar index with light nesting');
+}
+
+// Generate documentation and sidebar index
+generateDocumentation(jsonInput);
+generateSidebarIndex(jsonInput);
diff --git a/docs/generate.md b/docs/generate.md
new file mode 100644
index 0000000..ac8801f
--- /dev/null
+++ b/docs/generate.md
@@ -0,0 +1,30 @@
+## `generate` package
+
+Package generate provides functions for generating data.
+
+Import the `generate` package:
+
+```flux
+import "generate"
+```
+
+### Functions
+
+### `from()`
+
+from generates data using the provided parameter values.
+
+#### Function type signature
+
+```flux
+(count: int, fn: (n: int) => int, start: A, stop: A) => stream[{_value: int, _time: time, _stop: time, _start: time}] where A: Timeable
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| count | count: Number of rows to generate. | Yes |
+| fn | fn: Function used to generate values. | Yes |
+| start | start: Beginning of the time range to generate values in. | Yes |
+| stop | stop: End of the time range to generate values in. | Yes |
diff --git a/docs/http.md b/docs/http.md
new file mode 100644
index 0000000..d657167
--- /dev/null
+++ b/docs/http.md
@@ -0,0 +1,81 @@
+## `http` package
+
+Package http provides functions for transferring data using the HTTP protocol.
+
+Import the `http` package:
+
+```flux
+import "http"
+```
+
+### Functions
+
+### `basicAuth()`
+
+basicAuth returns a Base64-encoded basic authentication header
+using a specified username and password combination.
+
+#### Function type signature
+
+```flux
+(p: string, u: string) => string
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| u | u: Username to use in the basic authentication header. | Yes |
+| p | p: Password to use in the basic authentication header. | Yes |
+### `endpoint()`
+
+endpoint iterates over input data and sends a single POST request per input row to
+a specficied URL.
+
+#### Function type signature
+
+```flux
+(
+ url: string,
+) => (mapFn: (r: A) => {B with headers: C, data: bytes}) => (<-tables: stream[A]) => stream[{A with _sent: string}] where C: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: URL to send the POST reqeust to. | Yes |
+### `pathEscape()`
+
+pathEscape escapes special characters in a string (including `/`)
+and replaces non-ASCII characters with hexadecimal representations (`%XX`).
+
+#### Function type signature
+
+```flux
+(inputString: string) => string
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| inputString | inputString: String to escape. | Yes |
+### `post()`
+
+post sends an HTTP POST request to the specified URL with headers and data
+and returns the HTTP status code.
+
+#### Function type signature
+
+```flux
+(url: string, ?data: bytes, ?headers: A) => int where A: Record
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: URL to send the POST request to. | Yes |
+| headers | headers: Headers to include with the POST request. | No |
+| data | data: Data body to include with the POST request. | No |
diff --git a/docs/http/requests.md b/docs/http/requests.md
new file mode 100644
index 0000000..d2c694c
--- /dev/null
+++ b/docs/http/requests.md
@@ -0,0 +1,129 @@
+## `requests` package
+
+Package requests provides functions for transferring data using the HTTP protocol.
+
+Import the `requests` package:
+
+```flux
+import "requests"
+```
+
+### Functions
+
+### `defaultConfig()`
+
+defaultConfig is the global default for all http requests using the requests package.
+Changing this config will affect all other packages using the requests package.
+To change the config for a single request, pass a new config directly into the corresponding function.
+
+#### Function type signature
+
+```flux
+{timeout: duration, insecureSkipVerify: bool}
+```
+
+#### Parameters
+
+No parameters provided.
+
+### `do()`
+
+do makes an http request.
+
+#### Function type signature
+
+```flux
+(
+ method: string,
+ url: string,
+ ?body: bytes,
+ ?config: {A with timeout: duration, insecureSkipVerify: bool},
+ ?headers: [string:string],
+ ?params: [string:[string]],
+) => {statusCode: int, headers: [string:string], duration: duration, body: bytes}
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| method | method: method of the http request.
+ Supported methods: DELETE, GET, HEAD, PATCH, POST, PUT. | Yes |
+| url | url: URL to request. This should not include any query parameters. | Yes |
+| params | params: Set of key value pairs to add to the URL as query parameters.
+ Query parameters will be URL encoded.
+ All values for a key will be appended to the query. | No |
+| headers | headers: Set of key values pairs to include on the request. | No |
+| body | body: Data to send with the request. | No |
+| config | config: Set of options to control how the request should be performed. | No |
+### `get()`
+
+get makes a http GET request. This identical to calling `request.do(method: "GET", ...)`.
+
+#### Function type signature
+
+```flux
+(
+ url: string,
+ ?body: bytes,
+ ?config: {A with timeout: duration, insecureSkipVerify: bool},
+ ?headers: [string:string],
+ ?params: [string:[string]],
+) => {statusCode: int, headers: [string:string], duration: duration, body: bytes}
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: URL to request. This should not include any query parameters. | Yes |
+| params | params: Set of key value pairs to add to the URL as query parameters.
+ Query parameters will be URL encoded.
+ All values for a key will be appended to the query. | No |
+| headers | headers: Set of key values pairs to include on the request. | No |
+| body | body: Data to send with the request. | No |
+| config | config: Set of options to control how the request should be performed. | No |
+### `peek()`
+
+peek converts an HTTP response into a table for easy inspection.
+
+#### Function type signature
+
+```flux
+(
+ response: {A with statusCode: E, headers: D, duration: C, body: B},
+) => stream[{statusCode: E, headers: string, duration: int, body: string}]
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| response | response: Response data from an HTTP request. | Yes |
+### `post()`
+
+post makes a http POST request. This identical to calling `request.do(method: "POST", ...)`.
+
+#### Function type signature
+
+```flux
+(
+ url: string,
+ ?body: bytes,
+ ?config: {A with timeout: duration, insecureSkipVerify: bool},
+ ?headers: [string:string],
+ ?params: [string:[string]],
+) => {statusCode: int, headers: [string:string], duration: duration, body: bytes}
+```
+
+#### Parameters
+
+| Parameter | Description | Required |
+| --- | --- | --- |
+| url | url: URL to request. This should not include any query parameters. | Yes |
+| params | params: Set of key value pairs to add to the URL as query parameters.
+ Query parameters will be URL encoded.
+ All values for a key will be appended to the query. | No |
+| headers | headers: Set of key values pairs to include on the request. | No |
+| body | body: Data to send with the request. | No |
+| config | config: Set of options to control how the request should be performed. | No |
diff --git a/docs/index.html b/docs/index.html
new file mode 100644
index 0000000..4e6a8c2
--- /dev/null
+++ b/docs/index.html
@@ -0,0 +1,52 @@
+
+
+