Skip to content

Commit

Permalink
Merge pull request #1060 from ioito/hotfix/qx-aws-metric-value
Browse files Browse the repository at this point in the history
fix(aws): metric value
  • Loading branch information
ioito authored Sep 13, 2024
2 parents 81a4213 + c9605c0 commit ec4262b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/multicloud/aws/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ type Datapoint struct {
}

func (self Datapoint) GetValue() float64 {
return self.Average + self.Average + self.Minimum + self.Sum
return self.Average + self.Minimum + self.Sum
}

type Datapoints struct {
Expand Down
3 changes: 3 additions & 0 deletions pkg/multicloud/google/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ func (self *SGoogleClient) GetEcsMetrics(opts *cloudprovider.MetricListOptions)
metricValue := cloudprovider.MetricValue{}
metricValue.Timestamp = data[i].Points[j].Interval.StartTime
metricValue.Value = data[i].Points[j].Value.GetValue()
if opts.MetricType == cloudprovider.VM_METRIC_TYPE_CPU_USAGE {
metricValue.Value *= 100
}
value.Values = append(value.Values, metricValue)
}
ret = append(ret, value)
Expand Down

0 comments on commit ec4262b

Please sign in to comment.