mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-11-30 22:54:12 +00:00
19 lines
11 KiB
HTML
19 lines
11 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="Float range-vector functions as window kernels. Each kernel follows the Prometheus function of the same name, including its floating point operation order."><title>promql::range_eval::function - 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-1ed95124.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.98.1 (48a229cea 2026-09-01)" data-channel="1.98.1" data-search-js="search-9944d736.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-417ebf0a.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 function</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../promql/index.html">promql</a><span class="version">1.4.0-alpha.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module function</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In promql::<wbr>range_<wbr>eval</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>::<wbr><a href="../index.html">range_eval</a></div><h1>Module <span>function</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/range_eval/function.rs.html#15-951">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Float range-vector functions as window kernels. Each kernel follows the Prometheus function
|
||
of the same name, including its floating point operation order.</p>
|
||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.ExtrapolationSpan.html" title="struct promql::range_eval::function::ExtrapolationSpan">Extrapolation<wbr>Span</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>The span one window’s extrapolation factor is measured over. A float window starts both
|
||
intervals at its first sample; a native histogram counter with a <code>start_timestamp</code> inside the
|
||
window starts the sampled interval at that synthetic zero instead.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.RangeFunction.html" title="enum promql::range_eval::function::RangeFunction">Range<wbr>Function</a></dt><dd>A PromQL range-vector function over float and native histogram samples.</dd></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.anchored_values.html" title="fn promql::range_eval::function::anchored_values">anchored_<wbr>values</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Prometheus <code>pickFirstSampleIndices</code> for an <code>anchored</code> window of floats: the values from the
|
||
last sample at or before the window start on, or <code>None</code> when no sample lies after the start.</dd><dt><a class="fn" href="fn.avg.html" title="fn promql::range_eval::function::avg">avg</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Prometheus <code>funcAvgOverTime</code>: the Kahan sum divided by the count, switching to an
|
||
incremental mean once the sum would overflow.</dd><dt><a class="fn" href="fn.double_exponential_smoothing.html" title="fn promql::range_eval::function::double_exponential_smoothing">double_<wbr>exponential_<wbr>smoothing</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Prometheus <code>funcDoubleExponentialSmoothing</code>; <code>RangeEvaluator</code> checks the factors.</dd><dt><a class="fn" href="fn.extended_rate.html" title="fn promql::range_eval::function::extended_rate">extended_<wbr>rate</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Prometheus <code>extendedRate</code>: <code>rate</code>, <code>increase</code> or <code>delta</code> over an <code>anchored</code> or <code>smoothed</code>
|
||
window. The value at the window start is the last sample at or before it, or for <code>smoothed</code>
|
||
the interpolation between it and the next one; the end is picked or interpolated the same way.
|
||
Nothing is extrapolated.</dd><dt><a class="fn" href="fn.extrapolated_rate.html" title="fn promql::range_eval::function::extrapolated_rate">extrapolated_<wbr>rate</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Prometheus <code>extrapolatedRate</code> over floats.</dd><dt><a class="fn" href="fn.extrapolated_rate_batch.html" title="fn promql::range_eval::function::extrapolated_rate_batch">extrapolated_<wbr>rate_<wbr>batch</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>The batch form of <a href="fn.extrapolated_rate.html" title="fn promql::range_eval::function::extrapolated_rate"><code>extrapolated_rate</code></a> over consecutive windows of one field; bit-identical
|
||
to calling the per-window form once per point.</dd><dt><a class="fn" href="fn.extrapolated_rate_of.html" title="fn promql::range_eval::function::extrapolated_rate_of">extrapolated_<wbr>rate_<wbr>of</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>The arithmetic of <a href="fn.extrapolated_rate.html" title="fn promql::range_eval::function::extrapolated_rate"><code>extrapolated_rate</code></a>, over a window’s endpoints and the previous values of
|
||
its resets. Shared by the per-window and batch forms so their results stay equal.</dd><dt><a class="fn" href="fn.extrapolation_factor.html" title="fn promql::range_eval::function::extrapolation_factor">extrapolation_<wbr>factor</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>The factor <code>extrapolatedRate</code> scales the sampled increase by, for floats and native
|
||
histograms alike. <code>zero_point</code> is the first value over the increase, given only when a counter
|
||
is extrapolated to zero; <code>0</code> puts the zero point at <code>span.sampled_from</code>, as a synthetic zero
|
||
does. A zero sampled interval answers <code>1.0</code> (<code>1 / range</code> for a rate).</dd><dt><a class="fn" href="fn.interpolate.html" title="fn promql::range_eval::function::interpolate">interpolate</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Prometheus <code>interpolate</code> between the samples at <code>index</code> and <code>index + 1</code>, at <code>t</code>: a counter
|
||
that reset between them restarts from zero.</dd><dt><a class="fn" href="fn.last_two.html" title="fn promql::range_eval::function::last_two">last_<wbr>two</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="fn" href="fn.linear_regression.html" title="fn promql::range_eval::function::linear_regression">linear_<wbr>regression</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Prometheus <code>linearRegression</code>: <code>(slope, intercept)</code> with <code>x</code> in seconds from
|
||
<code>intercept_time</code>. Needs at least two samples.</dd><dt><a class="fn" href="fn.median_absolute_deviation.html" title="fn promql::range_eval::function::median_absolute_deviation">median_<wbr>absolute_<wbr>deviation</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Prometheus <code>funcMadOverTime</code>: the median of the absolute deviations from the median; NaN
|
||
when any sample is NaN.</dd><dt><a class="fn" href="fn.quantile.html" title="fn promql::range_eval::function::quantile">quantile</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Prometheus <code>quantile</code>, which sorts NaN before every number.</dd><dt><a class="fn" href="fn.search.html" title="fn promql::range_eval::function::search">search</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Go <code>sort.Search(n, predicate)</code>: the first index in <code>[0, n)</code> the predicate holds at, or <code>n</code>.</dd><dt><a class="fn" href="fn.seconds.html" title="fn promql::range_eval::function::seconds">seconds</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="fn" href="fn.sum.html" title="fn promql::range_eval::function::sum">sum</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Prometheus <code>funcSumOverTime</code>.</dd><dt><a class="fn" href="fn.timestamp_of_extremum.html" title="fn promql::range_eval::function::timestamp_of_extremum">timestamp_<wbr>of_<wbr>extremum</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Prometheus <code>compareOverTime</code> returning the timestamp: the last sample holding the maximum
|
||
(or minimum), where a NaN so far is replaced by any later sample.</dd><dt><a class="fn" href="fn.variance.html" title="fn promql::range_eval::function::variance">variance</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Prometheus <code>varianceOverTime</code>, the population variance.</dd></dl></section></div></main></body></html> |