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
e59c6cd9
Commit
e59c6cd9
authored
Feb 05, 2015
by
Julius Volz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document rounding functions.
parent
8cbb219e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
functions.md
content/docs/querying/functions.md
+17
-0
No files found.
content/docs/querying/functions.md
View file @
e59c6cd9
...
@@ -28,6 +28,11 @@ the 1-element output vector from the input vector:
...
@@ -28,6 +28,11 @@ the 1-element output vector from the input vector:
This is useful for alerting on when no time series
This is useful for alerting on when no time series
exist for a given metric name and label combination.
exist for a given metric name and label combination.
## `ceil()`
`ceil(v instant-vector)`
rounds the sample values of all elements in
`v`
up to
the nearest integer.
## `count_scalar()`
## `count_scalar()`
`count_scalar(v instant-vector)`
returns the number of elements in a time series
`count_scalar(v instant-vector)`
returns the number of elements in a time series
...
@@ -70,6 +75,11 @@ cpu_temp_celsius{host="zeus"} + deriv(cpu_temp_celsius{host="zeus"}[1h]) * 5 * 6
...
@@ -70,6 +75,11 @@ cpu_temp_celsius{host="zeus"} + deriv(cpu_temp_celsius{host="zeus"}[1h]) * 5 * 6
`drop_common_labels(instant-vector)`
drops all labels that have the same name
`drop_common_labels(instant-vector)`
drops all labels that have the same name
and value across all series in the input vector.
and value across all series in the input vector.
## `floor()`
`floor(v instant-vector)`
rounds the sample values of all elements in
`v`
down
to the nearest integer.
## `rate()`
## `rate()`
`rate(v range-vector)`
calculate the per-second average rate of increase of the
`rate(v range-vector)`
calculate the per-second average rate of increase of the
...
@@ -85,6 +95,13 @@ rate(http_requests_total{job="api-server"}[5m])
...
@@ -85,6 +95,13 @@ rate(http_requests_total{job="api-server"}[5m])
`rate`
should only be used with counters.
`rate`
should only be used with counters.
## `round()`
`round(v instant-vector, to_nearest=1 scalar)`
rounds the sample values of all
elements in
`v`
to the nearest integer. Ties are resolved by rounding up. The
optional
`to_nearest`
argument allows specifying the nearest multiple to which
the sample values should be rounded.
## `scalar()`
## `scalar()`
Given a single-element input vector,
`scalar(v instant-vector)`
returns the
Given a single-element input vector,
`scalar(v instant-vector)`
returns the
...
...
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