Commit 9b602d3c authored by Brian Brazil's avatar Brian Brazil

Document count_values aggregator.

parent 15e27dba
......@@ -185,6 +185,7 @@ vector of fewer elements with aggregated values:
* `stddev` (calculate population standard deviation over dimensions)
* `stdvar` (calculate population standard variance over dimensions)
* `count` (count number of elements in the vector)
* `count_values` (count number of elements with the same value)
* `bottomk` (smallest k elements by sample value)
* `topk` (largest k elements by sample value)
......@@ -193,12 +194,18 @@ or preserve distinct dimensions by including a `without` or `by` clause.
<aggr-op>([parameter,] <vector expression>) [without|by (<label list>)] [keep_common]
`parameter` is only required for `topk` and `bottomk`. `without` removes the
listed labels from the result vector, while all other labels are preserved the
output. `by` does the opposite and drops labels that are not listed in the `by`
clause, even if their label values are identical between all elements of the
vector. The `keep_common` clause allows keeping those extra labels (labels that
are identical between elements, but not in the `by` clause).
`parameter` is only required for `count_values`,`topk` and `bottomk`. `without`
removes the listed labels from the result vector, while all other labels are
preserved the output. `by` does the opposite and drops labels that are not
listed in the `by` clause, even if their label values are identical between all
elements of the vector. The `keep_common` clause allows keeping those extra
labels (labels that are identical between elements, but not in the `by`
clause).
`count_values` outputs one time series per unique sample value. Each series has
an additional label. The name of that label is given by the aggregation
parameter, and the label value is the unique sample value. The value of each
time series is the number of times that sample value was present.
`topk` and `bottomk` are different from other aggregators in that a subset of
the input samples, including the original labels, are returned in the result
......@@ -217,6 +224,10 @@ applications, we could simply write:
sum(http_requests_total)
To count the number of binaries running each build version we could write:
count_values("version", build_version)
To get the 5 largest HTTP requests counts across all instances we could write:
topk(5, http_requests_total)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment