code refactor

This commit is contained in:
Ulric Qin 2022-04-28 22:34:38 +08:00
parent 7c9d2ac04c
commit dcb909f971
1 changed files with 1 additions and 0 deletions

View File

@ -99,6 +99,7 @@ func (p *Parser) handleSummary(m *dto.Metric, tags map[string]string, metricName
func (p *Parser) handleHistogram(m *dto.Metric, tags map[string]string, metricName string, slist *list.SafeList) {
slist.PushFront(inputs.NewSample(metricName+"_count", float64(m.GetHistogram().GetSampleCount()), tags))
slist.PushFront(inputs.NewSample(metricName+"_sum", m.GetHistogram().GetSampleSum(), tags))
slist.PushFront(inputs.NewSample(metricName+"_bucket", float64(m.GetHistogram().GetSampleCount()), tags, map[string]string{"le": "+Inf"}))
for _, b := range m.GetHistogram().Bucket {
le := fmt.Sprint(b.GetUpperBound())