added the operator profiler, closes #1944

pull/1959/head
Scott Anderson 2020-12-08 11:46:03 -07:00
parent 471c6efaf1
commit 0600d450f9
1 changed files with 19 additions and 13 deletions

View File

@ -32,12 +32,14 @@ _**Data type:** Array of strings_
```js
import "profiler"
option profiler.enabledProfilers = [""]
option profiler.enabledProfilers = ["query", "operator"]
```
#### Available profilers
## Available profilers
- [query](#query)
- [operator](#operator)
##### query
### query
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/)
include a table with the following columns:
@ -56,14 +58,18 @@ include a table with the following columns:
- **influxdb/scanned-values**: value 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.
[Pushdown operations](/influxdb/v2.0/query-data/optimize-queries/#start-queries-with-pushdown-functions)
that execute in the data source storage engine are returned as a single operation.
Operations executed in memory are returned as individual operations.
When 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.
```js
import "profiler"
option profiler.enabledProfilers = ["query"]
// ... Query to profile
```
- **Type:** operation type
- **Label:** operation name
- **Count:** total number of times the operation executed
- **MinDuration:** minimum duration of the operation in nanoseconds
- **MaxDuration:** maximum duration of the operation in nanoseconds
- **DurationSum:** total duration of all operation executions in nanoseconds
- **MeanDuration:** average duration of all operation executions in nanoseconds