From d930648afb3a7e2aaafed925fff2dc80aa48f5c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Krajcsovits?= Date: Mon, 14 Oct 2024 14:35:11 +0200 Subject: [PATCH] Add doc string for NHCBParser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Very high level since we'll do a lot of optimizations so not worth going into details at this time. Signed-off-by: György Krajcsovits --- model/textparse/nhcbparse.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/model/textparse/nhcbparse.go b/model/textparse/nhcbparse.go index 283fb8b73..a63d0d93e 100644 --- a/model/textparse/nhcbparse.go +++ b/model/textparse/nhcbparse.go @@ -28,6 +28,17 @@ import ( "github.com/prometheus/prometheus/util/convertnhcb" ) +// The NHCBParser wraps a Parser and converts classic histograms to native +// histograms with custom buckets. +// +// Since Parser interface is line based, this parser needs to keep track +// of the last classic histogram series it saw to collate them into a +// single native histogram. +// +// Note: +// - Only series that have the histogram metadata type are considered for +// conversion. +// - The classic series are also returned if keepClassicHistograms is true. type NHCBParser struct { // The parser we're wrapping. parser Parser