mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
remove unused code of Cloud Monitoring distribution metrics type (#45702)
This commit is contained in:
parent
8ce59cb8a2
commit
7acb203b52
@ -166,11 +166,10 @@ func (timeSeriesFilter *cloudMonitoringTimeSeriesFilter) parseResponse(queryRes
|
|||||||
if len(point.Value.DistributionValue.BucketCounts) == 0 {
|
if len(point.Value.DistributionValue.BucketCounts) == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
maxKey := 0
|
|
||||||
for i := 0; i < len(point.Value.DistributionValue.BucketCounts); i++ {
|
for i := 0; i < len(point.Value.DistributionValue.BucketCounts); i++ {
|
||||||
value, err := strconv.ParseFloat(point.Value.DistributionValue.BucketCounts[i], 64)
|
value, err := strconv.ParseFloat(point.Value.DistributionValue.BucketCounts[i], 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
return err
|
||||||
}
|
}
|
||||||
if _, ok := buckets[i]; !ok {
|
if _, ok := buckets[i]; !ok {
|
||||||
// set lower bounds
|
// set lower bounds
|
||||||
@ -197,38 +196,9 @@ func (timeSeriesFilter *cloudMonitoringTimeSeriesFilter) parseResponse(queryRes
|
|||||||
ExecutedQueryString: executedQueryString,
|
ExecutedQueryString: executedQueryString,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if maxKey < i {
|
|
||||||
maxKey = i
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
buckets[i].AppendRow(point.Interval.EndTime, value)
|
buckets[i].AppendRow(point.Interval.EndTime, value)
|
||||||
}
|
}
|
||||||
for i := 0; i < maxKey; i++ {
|
|
||||||
if _, ok := buckets[i]; !ok {
|
|
||||||
bucketBound := calcBucketBound(point.Value.DistributionValue.BucketOptions, i)
|
|
||||||
additionalLabels := data.Labels{"bucket": bucketBound}
|
|
||||||
timeField := data.NewField(data.TimeSeriesTimeFieldName, nil, []time.Time{})
|
|
||||||
valueField := data.NewField(data.TimeSeriesValueFieldName, nil, []float64{})
|
|
||||||
frameName := formatLegendKeys(series.Metric.Type, defaultMetricName, seriesLabels,
|
|
||||||
additionalLabels, timeSeriesFilter)
|
|
||||||
valueField.Name = frameName
|
|
||||||
valueField.Labels = seriesLabels
|
|
||||||
setDisplayNameAsFieldName(valueField)
|
|
||||||
|
|
||||||
buckets[i] = &data.Frame{
|
|
||||||
Name: frameName,
|
|
||||||
RefID: timeSeriesFilter.RefID,
|
|
||||||
Fields: []*data.Field{
|
|
||||||
timeField,
|
|
||||||
valueField,
|
|
||||||
},
|
|
||||||
Meta: &data.FrameMeta{
|
|
||||||
ExecutedQueryString: executedQueryString,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for i := 0; i < len(buckets); i++ {
|
for i := 0; i < len(buckets); i++ {
|
||||||
buckets[i].Meta.Custom = customFrameMeta
|
buckets[i].Meta.Custom = customFrameMeta
|
||||||
|
Loading…
Reference in New Issue
Block a user