mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-16 04:50:38 +00:00
20 lines
14 KiB
HTML
20 lines
14 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `functions` mod in crate `promql`."><title>promql::functions - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="promql" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (ac7f9ec7d 2026-03-20)" data-channel="nightly" data-search-js="search-63369b7b.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../static.files/storage-41dd4d93.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module functions</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../promql/index.html">promql</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module functions</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#constants" title="Constants">Constants</a></li><li><a href="#functions" title="Functions">Functions</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate promql</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">promql</a></div><h1>Module <span>functions</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/promql/functions.rs.html#15-336">Source</a> </span></div><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="aggr_over_time/index.html" title="mod promql::functions::aggr_over_time">aggr_<wbr>over_<wbr>time</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="mod" href="changes/index.html" title="mod promql::functions::changes">changes</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Implementation of <a href="https://prometheus.io/docs/prometheus/latest/querying/functions/#changes"><code>changes</code></a> in PromQL. Refer to the <a href="https://github.com/prometheus/prometheus/blob/main/promql/functions.go#L1023-L1040">original
|
||
implementation</a>.</dd><dt><a class="mod" href="deriv/index.html" title="mod promql::functions::deriv">deriv</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Implementation of <a href="https://prometheus.io/docs/prometheus/latest/querying/functions/#deriv"><code>deriv</code></a> in PromQL. Refer to the <a href="https://github.com/prometheus/prometheus/blob/90b2f7a540b8a70d8d81372e6692dcbb67ccbaaa/promql/functions.go#L839-L856">original
|
||
implementation</a>.</dd><dt><a class="mod" href="double_exponential_smoothing/index.html" title="mod promql::functions::double_exponential_smoothing">double_<wbr>exponential_<wbr>smoothing</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Implementation of <a href="https://prometheus.io/docs/prometheus/latest/querying/functions/#double_exponential_smoothing"><code>double_exponential_smoothing</code></a> in PromQL. Refer to the <a href="https://github.com/prometheus/prometheus/blob/8dba9163f1e923ec213f0f4d5c185d9648e387f0/promql/functions.go#L299">original
|
||
implementation</a>.</dd><dt><a class="mod" href="extrapolate_rate/index.html" title="mod promql::functions::extrapolate_rate">extrapolate_<wbr>rate</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Implementations of <code>rate</code>, <code>increase</code> and <code>delta</code> functions in PromQL.</dd><dt><a class="mod" href="idelta/index.html" title="mod promql::functions::idelta">idelta</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="mod" href="predict_linear/index.html" title="mod promql::functions::predict_linear">predict_<wbr>linear</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Implementation of <a href="https://prometheus.io/docs/prometheus/latest/querying/functions/#predict_linear"><code>predict_linear</code></a> in PromQL. Refer to the <a href="https://github.com/prometheus/prometheus/blob/90b2f7a540b8a70d8d81372e6692dcbb67ccbaaa/promql/functions.go#L859-L872">original
|
||
implementation</a>.</dd><dt><a class="mod" href="quantile/index.html" title="mod promql::functions::quantile">quantile</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="mod" href="quantile_aggr/index.html" title="mod promql::functions::quantile_aggr">quantile_<wbr>aggr</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="mod" href="resets/index.html" title="mod promql::functions::resets">resets</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Implementation of <a href="https://prometheus.io/docs/prometheus/latest/querying/functions/#resets"><code>reset</code></a> in PromQL. Refer to the <a href="https://github.com/prometheus/prometheus/blob/90b2f7a540b8a70d8d81372e6692dcbb67ccbaaa/promql/functions.go#L1004-L1021">original
|
||
implementation</a>.</dd><dt><a class="mod" href="round/index.html" title="mod promql::functions::round">round</a><span title="Restricted Visibility"> 🔒</span> </dt></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.AbsentOverTime.html" title="struct promql::functions::AbsentOverTime">Absent<wbr>Over<wbr>Time</a></dt><dd>absent_over_time returns an empty vector if the range vector passed to it has any
|
||
elements (floats or native histograms) and a 1-element vector with the value 1 if
|
||
the range vector passed to it has no elements.</dd><dt><a class="struct" href="struct.AvgOverTime.html" title="struct promql::functions::AvgOverTime">AvgOver<wbr>Time</a></dt><dd>The average value of all points in the specified interval.</dd><dt><a class="struct" href="struct.Changes.html" title="struct promql::functions::Changes">Changes</a></dt><dd>used to count the number of value changes that occur within a specific time range</dd><dt><a class="struct" href="struct.CountOverTime.html" title="struct promql::functions::CountOverTime">Count<wbr>Over<wbr>Time</a></dt><dd>The count of all values in the specified interval.</dd><dt><a class="struct" href="struct.Deriv.html" title="struct promql::functions::Deriv">Deriv</a></dt><dt><a class="struct" href="struct.DoubleExponentialSmoothing.html" title="struct promql::functions::DoubleExponentialSmoothing">Double<wbr>Exponential<wbr>Smoothing</a></dt><dd>There are 3 variants of smoothing functions:</dd><dt><a class="struct" href="struct.IDelta.html" title="struct promql::functions::IDelta">IDelta</a></dt><dd>The <code>funcIdelta</code> in Promql,
|
||
from <a href="https://github.com/prometheus/prometheus/blob/6bdecf377cea8e856509914f35234e948c4fcb80/promql/functions.go#L235">https://github.com/prometheus/prometheus/blob/6bdecf377cea8e856509914f35234e948c4fcb80/promql/functions.go#L235</a></dd><dt><a class="struct" href="struct.LastOverTime.html" title="struct promql::functions::LastOverTime">Last<wbr>Over<wbr>Time</a></dt><dd>The most recent point value in specified interval.</dd><dt><a class="struct" href="struct.MaxOverTime.html" title="struct promql::functions::MaxOverTime">MaxOver<wbr>Time</a></dt><dd>The maximum value of all points in the specified interval.</dd><dt><a class="struct" href="struct.MinOverTime.html" title="struct promql::functions::MinOverTime">MinOver<wbr>Time</a></dt><dd>The minimum value of all points in the specified interval.</dd><dt><a class="struct" href="struct.PredictLinear.html" title="struct promql::functions::PredictLinear">Predict<wbr>Linear</a></dt><dt><a class="struct" href="struct.PresentOverTime.html" title="struct promql::functions::PresentOverTime">Present<wbr>Over<wbr>Time</a></dt><dd>the value 1 for any series in the specified interval.</dd><dt><a class="struct" href="struct.QuantileOverTime.html" title="struct promql::functions::QuantileOverTime">Quantile<wbr>Over<wbr>Time</a></dt><dt><a class="struct" href="struct.Resets.html" title="struct promql::functions::Resets">Resets</a></dt><dd>used to count the number of times the time series starts over.</dd><dt><a class="struct" href="struct.Round.html" title="struct promql::functions::Round">Round</a></dt><dt><a class="struct" href="struct.StddevOverTime.html" title="struct promql::functions::StddevOverTime">Stddev<wbr>Over<wbr>Time</a></dt><dd>the population standard deviation of the values in the specified interval.
|
||
Prometheus’s implementation: <a href="https://github.com/prometheus/prometheus/blob/f55ab2217984770aa1eecd0f2d5f54580029b1c0/promql/functions.go#L556-L569">https://github.com/prometheus/prometheus/blob/f55ab2217984770aa1eecd0f2d5f54580029b1c0/promql/functions.go#L556-L569</a></dd><dt><a class="struct" href="struct.StdvarOverTime.html" title="struct promql::functions::StdvarOverTime">Stdvar<wbr>Over<wbr>Time</a></dt><dd>the population standard variance of the values in the specified interval.
|
||
DataFusion’s implementation:
|
||
<a href="https://github.com/apache/arrow-datafusion/blob/292eb954fc0bad3a1febc597233ba26cb60bda3e/datafusion/physical-expr/src/aggregate/variance.rs#L224-#L241">https://github.com/apache/arrow-datafusion/blob/292eb954fc0bad3a1febc597233ba26cb60bda3e/datafusion/physical-expr/src/aggregate/variance.rs#L224-#L241</a></dd><dt><a class="struct" href="struct.SumOverTime.html" title="struct promql::functions::SumOverTime">SumOver<wbr>Time</a></dt><dd>The sum of all values in the specified interval.</dd></dl><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.QUANTILE_NAME.html" title="constant promql::functions::QUANTILE_NAME">QUANTILE_<wbr>NAME</a></dt></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.compensated_sum_inc.html" title="fn promql::functions::compensated_sum_inc">compensated_<wbr>sum_<wbr>inc</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>compensation(Kahan) summation algorithm - a technique for reducing the numerical error
|
||
in floating-point arithmetic. The algorithm also includes the modification (“Neumaier improvement”)
|
||
that reduces the numerical error further in cases
|
||
where the numbers being summed have a large difference in magnitude
|
||
Prometheus’s implementation:
|
||
<a href="https://github.com/prometheus/prometheus/blob/f55ab2217984770aa1eecd0f2d5f54580029b1c0/promql/functions.go#L782">https://github.com/prometheus/prometheus/blob/f55ab2217984770aa1eecd0f2d5f54580029b1c0/promql/functions.go#L782</a></dd><dt><a class="fn" href="fn.extract_array.html" title="fn promql::functions::extract_array">extract_<wbr>array</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Extracts an array from a <code>ColumnarValue</code>.</dd><dt><a class="fn" href="fn.extract_range_array.html" title="fn promql::functions::extract_range_array">extract_<wbr>range_<wbr>array</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Extracts a validated <a href="../range_array/struct.RangeArray.html" title="struct promql::range_array::RangeArray">RangeArray</a> from a [ColumnarValue].</dd><dt><a class="fn" href="fn.linear_regression.html" title="fn promql::functions::linear_regression">linear_<wbr>regression</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>linear_regression performs a least-square linear regression analysis on the
|
||
times and values. It return the slope and intercept based on times and values.
|
||
Prometheus’s implementation: <a href="https://github.com/prometheus/prometheus/blob/90b2f7a540b8a70d8d81372e6692dcbb67ccbaaa/promql/functions.go#L793-L837">https://github.com/prometheus/prometheus/blob/90b2f7a540b8a70d8d81372e6692dcbb67ccbaaa/promql/functions.go#L793-L837</a></dd><dt><a class="fn" href="fn.linear_regression_slice.html" title="fn promql::functions::linear_regression_slice">linear_<wbr>regression_<wbr>slice</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="fn" href="fn.linear_regression_slices.html" title="fn promql::functions::linear_regression_slices">linear_<wbr>regression_<wbr>slices</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="fn" href="fn.quantile_udaf.html" title="fn promql::functions::quantile_udaf">quantile_<wbr>udaf</a></dt><dd>Create a quantile <code>AggregateUDF</code> for PromQL quantile operator,
|
||
which calculates φ-quantile (0 ≤ φ ≤ 1) over dimensions</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.Delta.html" title="type promql::functions::Delta">Delta</a></dt><dt><a class="type" href="type.Increase.html" title="type promql::functions::Increase">Increase</a></dt><dt><a class="type" href="type.Rate.html" title="type promql::functions::Rate">Rate</a></dt></dl></section></div></main></body></html> |