Rename bType to bName as Type returns the binary name and not the type name

See Parser.Type() function.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
pull/14978/head
György Krajcsovits 2024-10-07 11:31:43 +02:00
parent ed2e7dc258
commit 9c4816df36
1 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ type NHCBParser struct {
lset labels.Labels lset labels.Labels
metricString string metricString string
// For Type. // For Type.
bType []byte bName []byte
typ model.MetricType typ model.MetricType
// Caches the entry itself if we are inserting a converted NHCB // 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) { func (p *NHCBParser) Type() ([]byte, model.MetricType) {
return p.bType, p.typ return p.bName, p.typ
} }
func (p *NHCBParser) Unit() ([]byte, []byte) { func (p *NHCBParser) Unit() ([]byte, []byte) {
@ -169,7 +169,7 @@ func (p *NHCBParser) Next() (Entry, error) {
p.metricString = p.parser.Metric(&p.lset) p.metricString = p.parser.Metric(&p.lset)
p.lastNativeHistName = p.lset.Get(labels.MetricName) p.lastNativeHistName = p.lset.Get(labels.MetricName)
case EntryType: case EntryType:
p.bType, p.typ = p.parser.Type() p.bName, p.typ = p.parser.Type()
} }
if p.processNHCB() { if p.processNHCB() {
p.entry = et p.entry = et
@ -187,7 +187,7 @@ func (p *NHCBParser) handleClassicHistogramSeries(lset labels.Labels) bool {
return false return false
} }
mName := lset.Get(labels.MetricName) mName := lset.Get(labels.MetricName)
if convertnhcb.GetHistogramMetricBaseName(mName) != string(p.bType) { if convertnhcb.GetHistogramMetricBaseName(mName) != string(p.bName) {
return false return false
} }
switch { switch {