You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/aggregations/bucket/random-sampler-aggregation.asciidoc
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,6 +94,17 @@ higher sampling rates, the relative error is still low.
94
94
95
95
NOTE: This represents the result of aggregations against a typical positively skewed APM data set which also has outliers in the upper tail. The linear dependence of the relative error on the sample size is found to hold widely, but the slope depends on the variation in the quantity being aggregated. As such, the variance in your own data may
96
96
cause relative error rates to increase or decrease at a different rate.
97
+
[[random-sampler-consistency]]
98
+
==== Random sampler consistency
99
+
100
+
For a given `probability` and `seed`, the random sampler aggregation is consistent when sampling unchanged data from the same shard.
101
+
However, this is background random sampling if a particular document is included in the sampled set or not is dependent on current number of segments.
102
+
103
+
Meaning, replica vs. primary shards could return different values as different particular documents are sampled.
104
+
105
+
If the shard changes in via doc addition, update, deletion, or segment merging, the particular documents sampled could change, and thus the resulting statistics could change.
106
+
107
+
The resulting statistics used from the random sampler aggregation are approximate and should be treated as such.
97
108
98
109
[[random-sampler-special-cases]]
99
110
==== Random sampling special cases
@@ -105,6 +116,6 @@ for a bucket is `10,000` with `probability: 0.1`, the actual number of documents
105
116
106
117
An exception to this is <<search-aggregations-metrics-cardinality-aggregation, cardinality aggregation>>. Unique item
107
118
counts are not suitable for automatic scaling. When interpreting the cardinality count, compare it
108
-
to the number of sampled docs provided in the top level `doc_count` within the random_sampler aggregation. It gives
119
+
to the number of sampled docs provided in the top level `doc_count` within the random_sampler aggregation. It gives
109
120
you an idea of unique values as a percentage of total values. It may not reflect, however, the exact number of unique values
0 commit comments