From 910694b8772682c1c559c53f36a73a461ac85c8f Mon Sep 17 00:00:00 2001 From: Peter Alfonsi Date: Fri, 17 Oct 2025 12:38:29 -0700 Subject: [PATCH 1/3] change default to 200 Signed-off-by: Peter Alfonsi --- _aggregations/metric/percentile-ranks.md | 8 ++++---- _aggregations/metric/percentile.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/_aggregations/metric/percentile-ranks.md b/_aggregations/metric/percentile-ranks.md index 124192ecddf..3a12e85d1ff 100644 --- a/_aggregations/metric/percentile-ranks.md +++ b/_aggregations/metric/percentile-ranks.md @@ -22,7 +22,7 @@ The `percentile_ranks` aggregation takes the following parameters. | `field` | String | Required | The numeric field used to compute percentile ranks. | | `values` | Array of doubles | Required | The values used to calculate percentile ranks. | | `keyed` | Boolean | Optional | If set to `false`, returns results as an array. Otherwise returns results as a JSON object. Default is `true`. | -| `tdigest.compression` | Double | Optional | Controls accuracy and memory usage of the `tdigest` algorithm. See [Precision tuning with tdigest](#precision-tuning-with-tdigest). | +| `tdigest.compression` | Double | Optional | Controls accuracy and memory usage of the `tdigest` algorithm. See [Precision tuning with tdigest](#precision-tuning-with-tdigest). Default value is `200`. | | `hdr.number_of_significant_value_digits` | Integer | Optional | The precision setting for the HDR histogram. See [HDR histogram](#hdr-histogram). | | `missing` | Number | Optional | The default value used when the target field is missing in a document. | | `script` | Object | Optional | The script used to compute custom values instead of using a field. Supports inline and stored scripts. | @@ -165,9 +165,9 @@ The response includes an array instead of an object: ## Precision tuning with tdigest -By default, percentile ranks are calculated using the `tdigest` algorithm. You can control the trade-off between accuracy and memory usage by specifying the `tdigest.compression` parameter. Higher values provide better accuracy but require more memory. For more information about how tdigest works, see [Precision tuning with tdigest]({{site.url}}{{site.baseurl}}/aggregations/metric/percentile/#precision-tuning-with-tdigest). +By default, percentile ranks are calculated using the `tdigest` algorithm. You can control the trade-off between accuracy and memory usage by specifying the `tdigest.compression` parameter. Higher values provide better accuracy but require more memory. The default value is `200`. For more information about how tdigest works, see [Precision tuning with tdigest]({{site.url}}{{site.baseurl}}/aggregations/metric/percentile/#precision-tuning-with-tdigest). -The following example is configured with `tdigest.compression` set to `200`: +The following example is configured with `tdigest.compression` set to `300`: ```json GET /transaction_data/_search @@ -179,7 +179,7 @@ GET /transaction_data/_search "field": "amount", "values": [25, 55], "tdigest": { - "compression": 200 + "compression": 300 } } } diff --git a/_aggregations/metric/percentile.md b/_aggregations/metric/percentile.md index e9d0d0b3cbc..31396ce9a08 100644 --- a/_aggregations/metric/percentile.md +++ b/_aggregations/metric/percentile.md @@ -24,7 +24,7 @@ The `percentiles` aggregation takes the following parameters. | `field` | String | Required | The numeric field used to compute percentiles. | | `percents` | Array of doubles | Optional | The list of percentiles returned in the response. Default is `[1, 5, 25, 50, 75, 95, 99]`. | | `keyed` | Boolean | Optional | If set to `false`, returns results as an array. Otherwise, returns results as a JSON object. Default is `true`. | -| `tdigest.compression` | Double | Optional | Controls accuracy and memory usage of the `tdigest` algorithm. See [Precision tuning with tdigest](#precision-tuning-with-tdigest). | +| `tdigest.compression` | Double | Optional | Controls accuracy and memory usage of the `tdigest` algorithm. See [Precision tuning with tdigest](#precision-tuning-with-tdigest). Default value is 200. | | `hdr.number_of_significant_value_digits` | Integer | Optional | The precision setting for the HDR histogram. See [HDR histogram](#hdr-histogram). | | `missing` | Number | Optional | The default value used when the target field is missing in a document. | | `script` | Object | Optional | The script used to compute custom values instead of using a field. Supports inline and stored scripts. | @@ -218,7 +218,7 @@ Unlike exact percentile calculations, `tdigest` uses a probabilistic approach th The algorithm is designed to be highly accurate near the tails of the distribution---the low percentiles (such as 1st) and high percentiles (such as 99th)---which are often the most important for performance analysis. You can control the precision of the results using the `compression` parameter. -A higher `compression` value means that more centroids are used, which increases accuracy (especially in the tails) but requires more memory and CPU. A lower `compression` value reduces memory usage and speeds up execution, but the results may be less accurate. +A higher `compression` value means that more centroids are used, which increases accuracy (especially in the tails) but requires more memory and CPU. A lower `compression` value reduces memory usage and speeds up execution, but the results may be less accurate. The default value is `200`. Lower `compression` values such as `100` may perform especially poorly on low-cardinality data, such as HTTP status codes. Use `tdigest` when: @@ -231,7 +231,7 @@ Avoid `tdigest` when: * You are working only with integer data and want maximum speed. * You care less about accuracy in the distribution tails and prefer faster aggregation (consider using [`hdr`](#hdr-histogram) instead). - The following example sets `tdigest.compression` to `200`: + The following example sets `tdigest.compression` to `300`: ```json GET /latency_data/_search @@ -242,7 +242,7 @@ GET /latency_data/_search "percentiles": { "field": "load_time", "tdigest": { - "compression": 200 + "compression": 300 } } } From cec49e93e3287bb3ab20b8c1f625ca0f613224cc Mon Sep 17 00:00:00 2001 From: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Date: Fri, 17 Oct 2025 16:04:12 -0400 Subject: [PATCH 2/3] Apply suggestions from code review Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> --- _aggregations/metric/percentile-ranks.md | 4 ++-- _aggregations/metric/percentile.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_aggregations/metric/percentile-ranks.md b/_aggregations/metric/percentile-ranks.md index 3a12e85d1ff..f20767f20af 100644 --- a/_aggregations/metric/percentile-ranks.md +++ b/_aggregations/metric/percentile-ranks.md @@ -22,7 +22,7 @@ The `percentile_ranks` aggregation takes the following parameters. | `field` | String | Required | The numeric field used to compute percentile ranks. | | `values` | Array of doubles | Required | The values used to calculate percentile ranks. | | `keyed` | Boolean | Optional | If set to `false`, returns results as an array. Otherwise returns results as a JSON object. Default is `true`. | -| `tdigest.compression` | Double | Optional | Controls accuracy and memory usage of the `tdigest` algorithm. See [Precision tuning with tdigest](#precision-tuning-with-tdigest). Default value is `200`. | +| `tdigest.compression` | Double | Optional | Controls accuracy and memory usage of the `tdigest` algorithm. See [Precision tuning with tdigest](#precision-tuning-with-tdigest). Default is `200`. | | `hdr.number_of_significant_value_digits` | Integer | Optional | The precision setting for the HDR histogram. See [HDR histogram](#hdr-histogram). | | `missing` | Number | Optional | The default value used when the target field is missing in a document. | | `script` | Object | Optional | The script used to compute custom values instead of using a field. Supports inline and stored scripts. | @@ -165,7 +165,7 @@ The response includes an array instead of an object: ## Precision tuning with tdigest -By default, percentile ranks are calculated using the `tdigest` algorithm. You can control the trade-off between accuracy and memory usage by specifying the `tdigest.compression` parameter. Higher values provide better accuracy but require more memory. The default value is `200`. For more information about how tdigest works, see [Precision tuning with tdigest]({{site.url}}{{site.baseurl}}/aggregations/metric/percentile/#precision-tuning-with-tdigest). +By default, percentile ranks are calculated using the `tdigest` algorithm. You can control the trade-off between accuracy and memory usage by specifying the `tdigest.compression` parameter. Higher values provide better accuracy but require more memory. Default is `200`. For more information about how tdigest works, see [Precision tuning with tdigest]({{site.url}}{{site.baseurl}}/aggregations/metric/percentile/#precision-tuning-with-tdigest). The following example is configured with `tdigest.compression` set to `300`: diff --git a/_aggregations/metric/percentile.md b/_aggregations/metric/percentile.md index 31396ce9a08..d70b0b849a1 100644 --- a/_aggregations/metric/percentile.md +++ b/_aggregations/metric/percentile.md @@ -24,7 +24,7 @@ The `percentiles` aggregation takes the following parameters. | `field` | String | Required | The numeric field used to compute percentiles. | | `percents` | Array of doubles | Optional | The list of percentiles returned in the response. Default is `[1, 5, 25, 50, 75, 95, 99]`. | | `keyed` | Boolean | Optional | If set to `false`, returns results as an array. Otherwise, returns results as a JSON object. Default is `true`. | -| `tdigest.compression` | Double | Optional | Controls accuracy and memory usage of the `tdigest` algorithm. See [Precision tuning with tdigest](#precision-tuning-with-tdigest). Default value is 200. | +| `tdigest.compression` | Double | Optional | Controls accuracy and memory usage of the `tdigest` algorithm. See [Precision tuning with tdigest](#precision-tuning-with-tdigest). Default is 200. | | `hdr.number_of_significant_value_digits` | Integer | Optional | The precision setting for the HDR histogram. See [HDR histogram](#hdr-histogram). | | `missing` | Number | Optional | The default value used when the target field is missing in a document. | | `script` | Object | Optional | The script used to compute custom values instead of using a field. Supports inline and stored scripts. | @@ -218,7 +218,7 @@ Unlike exact percentile calculations, `tdigest` uses a probabilistic approach th The algorithm is designed to be highly accurate near the tails of the distribution---the low percentiles (such as 1st) and high percentiles (such as 99th)---which are often the most important for performance analysis. You can control the precision of the results using the `compression` parameter. -A higher `compression` value means that more centroids are used, which increases accuracy (especially in the tails) but requires more memory and CPU. A lower `compression` value reduces memory usage and speeds up execution, but the results may be less accurate. The default value is `200`. Lower `compression` values such as `100` may perform especially poorly on low-cardinality data, such as HTTP status codes. +A higher `compression` value means that more centroids are used, which increases accuracy (especially in the tails) but requires more memory and CPU. A lower `compression` value reduces memory usage and speeds up execution, but the results may be less accurate. Default is `200`. Lower `compression` values such as `100` may perform especially poorly on low-cardinality data, such as HTTP status codes. Use `tdigest` when: From dfcdb2e2bbdc1be7a3d75021de2365fe4bf997ce Mon Sep 17 00:00:00 2001 From: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Date: Fri, 17 Oct 2025 16:04:35 -0400 Subject: [PATCH 3/3] Update _aggregations/metric/percentile.md Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> --- _aggregations/metric/percentile.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_aggregations/metric/percentile.md b/_aggregations/metric/percentile.md index d70b0b849a1..bba225b9f76 100644 --- a/_aggregations/metric/percentile.md +++ b/_aggregations/metric/percentile.md @@ -24,7 +24,7 @@ The `percentiles` aggregation takes the following parameters. | `field` | String | Required | The numeric field used to compute percentiles. | | `percents` | Array of doubles | Optional | The list of percentiles returned in the response. Default is `[1, 5, 25, 50, 75, 95, 99]`. | | `keyed` | Boolean | Optional | If set to `false`, returns results as an array. Otherwise, returns results as a JSON object. Default is `true`. | -| `tdigest.compression` | Double | Optional | Controls accuracy and memory usage of the `tdigest` algorithm. See [Precision tuning with tdigest](#precision-tuning-with-tdigest). Default is 200. | +| `tdigest.compression` | Double | Optional | Controls accuracy and memory usage of the `tdigest` algorithm. See [Precision tuning with tdigest](#precision-tuning-with-tdigest). Default is `200`. | | `hdr.number_of_significant_value_digits` | Integer | Optional | The precision setting for the HDR histogram. See [HDR histogram](#hdr-histogram). | | `missing` | Number | Optional | The default value used when the target field is missing in a document. | | `script` | Object | Optional | The script used to compute custom values instead of using a field. Supports inline and stored scripts. |