Merge pull request #1959 from influxdata/operator-profiler
Add the Flux 'operator' profilerpull/1963/head
commit
ff8ded2cc4
|
@ -9,61 +9,9 @@ menu:
|
||||||
name: Profiler
|
name: Profiler
|
||||||
parent: Flux standard library
|
parent: Flux standard library
|
||||||
weight: 202
|
weight: 202
|
||||||
influxdb/v2.0/tags: [functions, optimize, package]
|
influxdb/cloud/tags: [functions, optimize, package]
|
||||||
related:
|
related:
|
||||||
- /influxdb/cloud/query-data/optimize-queries/
|
- /influxdb/cloud/query-data/optimize-queries/
|
||||||
---
|
---
|
||||||
|
|
||||||
The Flux Profiler package provides performance profiling tools for Flux queries and operations.
|
{{< duplicate-oss >}}
|
||||||
Import the `profiler` package:
|
|
||||||
|
|
||||||
```js
|
|
||||||
import "profiler"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Options
|
|
||||||
The Profiler package includes the following options:
|
|
||||||
|
|
||||||
### enabledProfilers
|
|
||||||
Enable Flux profilers.
|
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
|
||||||
|
|
||||||
```js
|
|
||||||
import "profiler"
|
|
||||||
|
|
||||||
option profiler.enabledProfilers = [""]
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Available profilers
|
|
||||||
|
|
||||||
##### query
|
|
||||||
The `query` profiler provides statistics about the execution of an entire Flux script.
|
|
||||||
When enabled, results returned by [`yield()`](/influxdb/cloud/reference/flux/stdlib/built-in/outputs/yield/)
|
|
||||||
include a table with the following columns:
|
|
||||||
|
|
||||||
- **TotalDuration**: total query duration in nanoseconds.
|
|
||||||
- **CompileDuration**: number of nanoseconds spent compiling the query.
|
|
||||||
- **QueueDuration**: number of nanoseconds spent queueing.
|
|
||||||
- **RequeueDuration**: number fo nanoseconds spent requeueing.
|
|
||||||
- **PlanDuration**: number of nanoseconds spent planning the query.
|
|
||||||
- **ExecuteDuration**: number of nanoseconds spent executing the query.
|
|
||||||
- **Concurrency**: number of goroutines allocated to process the query.
|
|
||||||
- **MaxAllocated**: maximum number of bytes the query allocated.
|
|
||||||
- **TotalAllocated**: total number of bytes the query allocated (includes memory that was freed and then used again).
|
|
||||||
- **RuntimeErrors**: error messages returned during query execution.
|
|
||||||
- **flux/query-plan**: Flux query plan.
|
|
||||||
- **influxdb/scanned-values**: value scanned by InfluxDB.
|
|
||||||
- **influxdb/scanned-bytes**: number of bytes scanned by InfluxDB.
|
|
||||||
|
|
||||||
#### Use the query profiler
|
|
||||||
|
|
||||||
Use the query profiler to output statistics about query execution.
|
|
||||||
|
|
||||||
```js
|
|
||||||
import "profiler"
|
|
||||||
|
|
||||||
option profiler.enabledProfilers = ["query"]
|
|
||||||
|
|
||||||
// ... Query to profile
|
|
||||||
```
|
|
|
@ -32,12 +32,16 @@ _**Data type:** Array of strings_
|
||||||
```js
|
```js
|
||||||
import "profiler"
|
import "profiler"
|
||||||
|
|
||||||
option profiler.enabledProfilers = [""]
|
option profiler.enabledProfilers = ["query", "operator"]
|
||||||
|
|
||||||
|
// Query to profile
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Available profilers
|
## Available profilers
|
||||||
|
- [query](#query)
|
||||||
|
- [operator](#operator)
|
||||||
|
|
||||||
##### query
|
### query
|
||||||
The `query` profiler provides statistics about the execution of an entire Flux script.
|
The `query` profiler provides statistics about the execution of an entire Flux script.
|
||||||
When enabled, results returned by [`yield()`](/influxdb/v2.0/reference/flux/stdlib/built-in/outputs/yield/)
|
When enabled, results returned by [`yield()`](/influxdb/v2.0/reference/flux/stdlib/built-in/outputs/yield/)
|
||||||
include a table with the following columns:
|
include a table with the following columns:
|
||||||
|
@ -56,14 +60,17 @@ include a table with the following columns:
|
||||||
- **influxdb/scanned-values**: value scanned by InfluxDB.
|
- **influxdb/scanned-values**: value scanned by InfluxDB.
|
||||||
- **influxdb/scanned-bytes**: number of bytes scanned by InfluxDB.
|
- **influxdb/scanned-bytes**: number of bytes scanned by InfluxDB.
|
||||||
|
|
||||||
#### Use the query profiler
|
### operator
|
||||||
|
The `operator` profiler output statistics about each operation in a query.
|
||||||
|
[Operations executed in the storage tier](/influxdb/v2.0/query-data/optimize-queries/#start-queries-with-pushdown-functions)
|
||||||
|
return as a single operation.
|
||||||
|
When the `operator` profile is enabled, results returned by [`yield()`](/influxdb/v2.0/reference/flux/stdlib/built-in/outputs/yield/)
|
||||||
|
include a table with a row for each operation and the following columns:
|
||||||
|
|
||||||
Use the query profiler to output statistics about query execution.
|
- **Type:** operation type
|
||||||
|
- **Label:** operation name
|
||||||
```js
|
- **Count:** total number of times the operation executed
|
||||||
import "profiler"
|
- **MinDuration:** minimum duration of the operation in nanoseconds
|
||||||
|
- **MaxDuration:** maximum duration of the operation in nanoseconds
|
||||||
option profiler.enabledProfilers = ["query"]
|
- **DurationSum:** total duration of all operation executions in nanoseconds
|
||||||
|
- **MeanDuration:** average duration of all operation executions in nanoseconds
|
||||||
// ... Query to profile
|
|
||||||
```
|
|
||||||
|
|
Loading…
Reference in New Issue