From 9c4816df36e043906fde46d1e5fca3427d3b59ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Krajcsovits?= Date: Mon, 7 Oct 2024 11:31:43 +0200 Subject: [PATCH] Rename bType to bName as Type returns the binary name and not the type name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See Parser.Type() function. Signed-off-by: György Krajcsovits --- model/textparse/nhcbparse.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/model/textparse/nhcbparse.go b/model/textparse/nhcbparse.go index 0a16fdf5d..1abbdd950 100644 --- a/model/textparse/nhcbparse.go +++ b/model/textparse/nhcbparse.go @@ -45,7 +45,7 @@ type NHCBParser struct { lset labels.Labels metricString string // For Type. - bType []byte + bName []byte typ model.MetricType // Caches the entry itself if we are inserting a converted NHCB @@ -99,7 +99,7 @@ func (p *NHCBParser) Help() ([]byte, []byte) { } func (p *NHCBParser) Type() ([]byte, model.MetricType) { - return p.bType, p.typ + return p.bName, p.typ } func (p *NHCBParser) Unit() ([]byte, []byte) { @@ -169,7 +169,7 @@ func (p *NHCBParser) Next() (Entry, error) { p.metricString = p.parser.Metric(&p.lset) p.lastNativeHistName = p.lset.Get(labels.MetricName) case EntryType: - p.bType, p.typ = p.parser.Type() + p.bName, p.typ = p.parser.Type() } if p.processNHCB() { p.entry = et @@ -187,7 +187,7 @@ func (p *NHCBParser) handleClassicHistogramSeries(lset labels.Labels) bool { return false } mName := lset.Get(labels.MetricName) - if convertnhcb.GetHistogramMetricBaseName(mName) != string(p.bType) { + if convertnhcb.GetHistogramMetricBaseName(mName) != string(p.bName) { return false } switch {