Skip to content

Commit

Permalink
Document cloud aggregation options. Resolve #194
Browse files Browse the repository at this point in the history
  • Loading branch information
Griatch authored and Pepe Cano committed Aug 20, 2021
1 parent cd4b7b5 commit a2dfa04
Showing 1 changed file with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,41 @@ behavior of k6:
| `K6_CLOUD_TOKEN` | An authentication token to use in API calls to the cloud service, when the --cloud results output option is specified. |
| `K6_NO_USAGE_REPORT` | Define this to disable [usage reports](/misc/usage-collection). |
| `K6_OUT` | Specify results output, same as --out command-line option. |

When streaming test data to [k6 cloud](/cloud) with `k6 -o cloud`, k6 will
collect all data and send it in batches.

| Name | Description |
| ---- | ----------- |
| `K6_CLOUD_METRIC_PUSH_INTERVAL` | How often to send data to the k6 cloud (default `'6s'`). |

k6 can also _aggregate_ the data it sends to the k6 cloud each batch.
Aggregation is disabled by default.

When using aggregation, k6 will collect incoming test data into time-buckets.
For each data-type collected in such a bucket, it will figure out the dispersion
(by default the [interquartile range](iqr)) around the median value. Data far
outside the lower and upper quartiles are not aggregated, but sent as-is in
order to not lose potentially important testing information.

Aggregation is controlled by a series of environment variables you don't need to
modify unless you have very specific statistical needs.

> When running a test entirely in the cloud with `k6 cloud`, `k6` will always
> aggregate. In this case the aggregation settings are set by the infrastructure
> in the cloud and are not controllable from the CLI.
| Name | Description |
|---------------------------------------------- |----------------------------------------------------------------------------------------------------------|
| `K6_CLOUD_AGGREGATION_PERIOD` | >0s to activate aggregation (default disabled, `'3s'` is a good example to try) |
| `K6_CLOUD_AGGREGATION_CALC_INTERVAL` | How often new data will be aggregated (default `'3s'`). |
| `K6_CLOUD_AGGREGATION_WAIT_PERIOD` | How long to wait for period samples to accumulate before aggregating them (default `'5s'`). |
| `K6_CLOUD_AGGREGATION_MIN_SAMPLES` | If fewer samples than this arrived in interval, skip aggregation (default `100`). |
| `K6_CLOUD_AGGREGATION_OUTLIER_IQR_RADIUS` | Outlier sampling from median to use for Q1 and Q3 quartiles (fraction) (default `0.25` (i.e. [IQR][iqr])). |
| `K6_CLOUD_AGGREGATION_OUTLIER_IQR_COEF_LOWER` | How many quartiles below the lower quartile are non-aggregatable outliers (default 1.5) |
| `K6_CLOUD_AGGREGATION_OUTLIER_IQR_COEF_UPPER` | How many quartiles above the upper quartile are non-aggregatable outliers (default 1.3) |



[iqr]: https://en.wikipedia.org/wiki/Interquartile_range

0 comments on commit a2dfa04

Please sign in to comment.