Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
docs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
docs
Commits
9b602d3c
Commit
9b602d3c
authored
Jul 08, 2016
by
Brian Brazil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document count_values aggregator.
parent
15e27dba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
operators.md
content/docs/querying/operators.md
+17
-6
No files found.
content/docs/querying/operators.md
View file @
9b602d3c
...
...
@@ -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)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment