Skip to content

Commit

Permalink
fixing ger range issue (#840)
Browse files Browse the repository at this point in the history
  • Loading branch information
NajmudheenCT authored and leonwanghui committed Jun 11, 2019
1 parent c4b46d2 commit 0c411d6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pkg/controller/metrics/metrics_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ func (c *controller) GetRangeMetrics(opt *pb.GetMetricsOpts) ([]*model.MetricSpe
for _, res := range fv.Data.Result {

metricValues := make([]*model.Metric, 0)
metricValue := &model.Metric{}
for j := 0; j < len(res.Values); j++ {
metricValue := &model.Metric{}
for _, v := range res.Values[j] {
switch v.(type) {
case string:
Expand All @@ -251,13 +251,14 @@ func (c *controller) GetRangeMetrics(opt *pb.GetMetricsOpts) ([]*model.MetricSpe

}
metricValues = append(metricValues, metricValue)
metric := &model.MetricSpec{}
metric.InstanceID = res.Metric.Instance
metric.Name = res.Metric.Name
metric.InstanceName = res.Metric.Device
metric.MetricValues = metricValues
metrics = append(metrics, metric)

}
metric := &model.MetricSpec{}
metric.InstanceID = res.Metric.Instance
metric.Name = res.Metric.Name
metric.InstanceName = res.Metric.Device
metric.MetricValues = metricValues
metrics = append(metrics, metric)
}

bArr, _ := json.Marshal(metrics)
Expand Down

0 comments on commit 0c411d6

Please sign in to comment.