mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-11-30 22:54:12 +00:00
14 lines
12 KiB
HTML
14 lines
12 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="Arithmetic on owned native histograms, following Prometheus `FloatHistogram` (`model/histogram/float_histogram.go`): `Add`, `KahanAdd`, `Sub`, `Mul`, `Div`, `Compact`, `CopyToSchema`, `DetectReset` and `Equals`, including zero bucket reconciliation, resolution reduction and the intersection of mismatched custom bounds."><title>promql::histogram_eval::float_histogram - 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 float_histogram</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 float_<wbr>histogram</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><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In promql::<wbr>histogram_<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">histogram_eval</a></div><h1>Module <span>float_<wbr>histogram</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/histogram_eval/float_histogram.rs.html#15-1353">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Arithmetic on owned native histograms, following Prometheus <code>FloatHistogram</code>
|
||
(<code>model/histogram/float_histogram.go</code>): <code>Add</code>, <code>KahanAdd</code>, <code>Sub</code>, <code>Mul</code>, <code>Div</code>, <code>Compact</code>,
|
||
<code>CopyToSchema</code>, <code>DetectReset</code> and <code>Equals</code>, including zero bucket reconciliation, resolution
|
||
reduction and the intersection of mismatched custom bounds.</p>
|
||
<p>Each side is a list of <code>(bucket index, count)</code> sorted by index. Consecutive indices may share
|
||
a span. An explicitly represented zero can affect the order of compensated additions when
|
||
several indices map to one bucket.</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.AddOutcome.html" title="struct promql::histogram_eval::float_histogram::AddOutcome">AddOutcome</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>What an addition or subtraction reports besides its result.</dd><dt><a class="struct" href="struct.EmptyBuckets.html" title="struct promql::histogram_eval::float_histogram::EmptyBuckets">Empty<wbr>Buckets</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Explicit zero pairs omitted from a range accumulator while a later sample can still rebin it.</dd><dt><a class="struct" href="struct.FloatHistogram.html" title="struct promql::histogram_eval::float_histogram::FloatHistogram">Float<wbr>Histogram</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>A native histogram with absolute bucket counts.</dd><dt><a class="struct" href="struct.RollUp.html" title="struct promql::histogram_eval::float_histogram::RollUp">RollUp</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>The rolling sum of custom buckets up to a bound, as Go’s <code>rollupSumForBound</code> closure keeps
|
||
it across calls.</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.BucketLayout.html" title="enum promql::histogram_eval::float_histogram::BucketLayout">Bucket<wbr>Layout</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Whether a fold keeps explicitly represented empty buckets.</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.add_buckets.html" title="fn promql::histogram_eval::float_histogram::add_buckets">add_<wbr>buckets</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Go <code>addBuckets</code> and <code>kahanAddBuckets</code>: adds <code>sign * other</code> to one side of <code>h</code>, inserting the
|
||
buckets <code>h</code> lacks. Leading buckets of <code>other</code> inside the zero bucket are skipped.</dd><dt><a class="fn" href="fn.add_custom_buckets_with_mismatches.html" title="fn promql::histogram_eval::float_histogram::add_custom_buckets_with_mismatches">add_<wbr>custom_<wbr>buckets_<wbr>with_<wbr>mismatches</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Go <code>addCustomBucketsWithMismatches</code>: maps both sides onto the intersected bounds, adding
|
||
with Kahan summation, and drops buckets left empty. Returns the buckets and their
|
||
compensation.</dd><dt><a class="fn" href="fn.canonical_spans.html" title="fn promql::histogram_eval::float_histogram::canonical_spans">canonical_<wbr>spans</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Spans with one span per run of consecutive indices.</dd><dt><a class="fn" href="fn.check_schemas.html" title="fn promql::histogram_eval::float_histogram::check_schemas">check_<wbr>schemas</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="fn" href="fn.compact_range.html" title="fn promql::histogram_eval::float_histogram::compact_range">compact_<wbr>range</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="fn" href="fn.compact_with.html" title="fn promql::histogram_eval::float_histogram::compact_with">compact_<wbr>with</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Go <code>kahanCompact(0)</code>: drops the buckets whose count and compensation are both zero.</dd><dt><a class="fn" href="fn.incompatible_schema.html" title="fn promql::histogram_eval::float_histogram::incompatible_schema">incompatible_<wbr>schema</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="fn" href="fn.intersect_custom_bounds.html" title="fn promql::histogram_eval::float_histogram::intersect_custom_bounds">intersect_<wbr>custom_<wbr>bounds</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Go <code>intersectCustomBucketBounds</code>.</dd><dt><a class="fn" href="fn.iterate.html" title="fn promql::histogram_eval::float_histogram::iterate">iterate</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Go <code>floatBucketIterator</code>: the buckets of <code>side</code> merged down to <code>target</code>, without the leading
|
||
ones whose upper bound is at most <code>threshold</code>.</dd><dt><a class="fn" href="fn.kahan_reduce_resolution.html" title="fn promql::histogram_eval::float_histogram::kahan_reduce_resolution">kahan_<wbr>reduce_<wbr>resolution</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Go <code>kahanReduceResolution</code>.</dd><dt><a class="fn" href="fn.merge_empty_buckets.html" title="fn promql::histogram_eval::float_histogram::merge_empty_buckets">merge_<wbr>empty_<wbr>buckets</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="fn" href="fn.reduce_resolution.html" title="fn promql::histogram_eval::float_histogram::reduce_resolution">reduce_<wbr>resolution</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Go <code>reduceResolution</code> without delta encoding.</dd><dt><a class="fn" href="fn.side_from_view.html" title="fn promql::histogram_eval::float_histogram::side_from_view">side_<wbr>from_<wbr>view</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="fn" href="fn.side_reset.html" title="fn promql::histogram_eval::float_histogram::side_reset">side_<wbr>reset</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Go <code>detectReset</code> over two sides with matching indices.</dd><dt><a class="fn" href="fn.spans_match.html" title="fn promql::histogram_eval::float_histogram::spans_match">spans_<wbr>match</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Go <code>spansMatch</code>: equal layouts once zero-length spans are folded into the next span.</dd><dt><a class="fn" href="fn.take_touched_zeros.html" title="fn promql::histogram_eval::float_histogram::take_touched_zeros">take_<wbr>touched_<wbr>zeros</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Takes the deferred destinations needed for the add. Outside zero-bucket reconciliation, an
|
||
all-zero source group can be omitted when it preserves the signs of the count and correction.</dd><dt><a class="fn" href="fn.target_index.html" title="fn promql::histogram_eval::float_histogram::target_index">target_<wbr>index</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Go <code>targetIdx</code>.</dd><dt><a class="fn" href="fn.zero_compensation.html" title="fn promql::histogram_eval::float_histogram::zero_compensation">zero_<wbr>compensation</a><span title="Restricted Visibility"> 🔒</span> </dt></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.Buckets.html" title="type promql::histogram_eval::float_histogram::Buckets">Buckets</a><span title="Restricted Visibility"> 🔒</span> </dt><dt><a class="type" href="type.EmptySide.html" title="type promql::histogram_eval::float_histogram::EmptySide">Empty<wbr>Side</a><span title="Restricted Visibility"> 🔒</span> </dt></dl></section></div></main></body></html> |