Functions for metrics
Aggregation
- Average
-
Average value for a specific metric across aggregated or grouped data points.
- Minimum
-
Smallest or lowest value observed among the aggregated data points.
- Maximum
-
Largest or highest value observed among the aggregated data points.
- Sum
-
Sum of values observed among the aggregated data points.
- Count
-
Count of values observed among the aggregated data points.
- Standard variance
-
Standard variance of values observed among the aggregated data points.
- Standard deviation
-
Standard deviation of values observed among the aggregated data points.
- Quantile
-
Specific value or point in a dataset that divides the data into ordered subsets with equal probabilities.
Arithmetic
- Absolute value
-
Absolute value of the metric.
- Exponential
-
Calculates the exponential function for all elements of the time series.
- Floor
-
Rounds down the sample values of all elements in the time series to the nearest integer.
- Histogram quantile
-
Calculates the φ-quantile (0 ≤ φ ≤ 1) from the buckets of the histogram.
- Log 2
-
Calculates Log 2, the binary logarithm, of the metric; log2.
- Log 10
-
Calculates Log 10, decimal or common logarithm, of the metric; log10.
- Scalar
-
Determines the sample value of a single-element input time series v,
scalar(v instant-vector)
, and converts it to a scalar value.,
- ln
-
Calculates the natural logarithm, of all values in a time series; loge.
- Round
-
Rounds the sample values of all elements in the time series to the nearest integer.
- SGN
-
Returns a vector with all sample values in the time series converted to their sign, + or -.
- Square root
-
Calculates the square root of all values in the time series, \$\sqrt(value)\$.
- Ceil
-
Rounds up the sample values of all elements in the time series to the nearest integer.
- Timestamp
-
Returns the timestamp of each value in the time series in epoch format, or the number of seconds after January 1, 1970 UTC.
Count
- Count non zero
-
Computes the count of all non-zero values.
- Count not null
-
Computes the count of all non-null values.
- Absent
-
Returns an empty vector if the time series has any elements, or a 1-element vector with value 1 if the time series has no elements.
- Absent over time
-
Returns an empty vector if the range time series has any elements, or a 1-element vector with value 1 if the range time series has no elements.
- Changes
-
Returns the count of instances when the time series value changed within the specified time range, as an instant vector.
- Resets
-
Returns the number of counter resets,
resets(v range-vector)
, within the specified time range, for each input time series, as an instant vector.
Time
- Day of week
-
Returns the day of the week for each element in the time series, in UTC. Valid values range from 0 to 6, where 0 is Sunday, 1 is Monday, and so on.
- Day of month
-
Returns the day of the month for each element in the time series, in UTC. Valid values range from 1 to 31.
- Day of year
-
Returns the day of the year for each element in the time series, in UTC. Valid values range from 1 to 365 for non-leap years, and from 1 to 366 for leap years.
- Days in month
-
Returns the number of days in the month for element in the time series, in UTC. Valid values range from 28 to 31.
- Hour
-
Returns the hour of the day for each element in the time series, in UTC. Valid values range from 0 to 23.
- Minute
-
Returns the minute of the hour for each element of the times series, in UTC. Valid values range from 0 to 59.
- Month
-
Returns the month of the year for each element of the time series, in UTC. Valid values range from 1 to 12.
- Year
-
Returns the year for each element of the time series, in UTC.
Rate
- Diff
-
Graphs the delta of the metric, \$Delta\$.
- Derivative
-
Graphs the time derivative of the metric, \$\frac{Delta}{dt}\$.
- Monotonic diff
-
Graphs the delta (\$Delta\$) of the metric, but only if it is positive.
- Irate
-
Calculates the per-second instant rate of increase of the time series in the range vector, based on the last two data points. Automatically adjusts for breaks in monotonicity, like counter resets due to target restarts.
- Per hour
-
Graphs the rate of metric change per hour.
- Per minute
-
Graphs the rate of metric change per minute.
- Per second
-
Graphs the rate of metric change per second.
- Increase
-
Calculates the increase in the time series across the range vector.
Exclusion
- Clamp max
-
Lowers all metric values greater than the threshold to that threshold value.
- Clamp min
-
Raises all metric values lower than the threshold to that threshold value.
- Cutoff max
-
Removes all metric values greater than the threshold value.
- Cutoff min
-
Removes all metric values less than the threshold value.
- Clamp
-
Clamps the values of all elements in the time series to min and max. This lowers values greater than and max to and max, and raises values lower than and min to and min.
Rank
- Top K
-
Graphs the top K elements.
- Sort
-
Sorts the time series by sample value, in ascending order.
- Sort desc
-
Sorts the time series by sample value, in descending order.
Rollup
- Average over time
-
Calculates the average value of all points in the specified interval.
- Min over time
-
Calculates the minimum value of all points in the specified interval.
- Max over time
-
Calculates the maximum value of all points in the specified interval.
- Sum over time
-
Calculates the sum of all values in the specified interval.
- Count over time
-
Counts of all values in the specified interval.
- Quantile over time
-
Calculates the φ-quantile (0 ≤ φ ≤ 1) of values in the specified interval.
- Deviation over time
-
Calculates the population standard deviation of values in the specified interval.
- Variance over time
-
Calculates the variance of values in the specified interval.
- Last over time
-
Returns the most recent point value in the specified interval.
Regression
- Predict linear
-
Predicts the value of time series t seconds from now using simple linear regression.
Smoothing
- Holt Winters
-
Produces a smoothed value for time series based on the range in the time series, accounting for seasonal adjustments. Implements the Holt-Winters method of exponentially-weighted averages as smoothing factors.
Trigonometric
- Acos
-
Calculates the arccosine of all elements in the time series.
- Acosh
-
Calculates the inverse hyperbolic cosine of all elements in the time series.
- Asin
-
Calculates the arcsine of all elements in the time series.
- Asinh
-
Calculates the inverse hyperbolic sine of all elements in the time series.
- Atan
-
Calculates the arctangent of all elements in the time series.
- Atanh
-
Calculates the inverse hyperbolic tangent of all elements in the time series.
- Cos
-
Calculates the cosine of all elements in the time series.
- Cosh
-
Calculates the hyperbolic cosine of all elements in the time series.
- Sin
-
Calculates the sine of all elements in the time series.
- Sinh
-
Calculates the hyperbolic sine of all elements in the time series.
- Tan
-
Calculates the tangent of all elements in the time series.
- Tanh
-
Calculates the hyperbolic tangent of all elements in the time series.