Spaceman1984 commented on a change in pull request #4900:
URL: https://github.com/apache/cloudstack/pull/4900#discussion_r609701444
##########
File path:
plugins/metrics/src/main/java/org/apache/cloudstack/response/HostMetricsResponse.java
##########
@@ -117,7 +117,7 @@ public void setCpuTotal(final Integer cpuNumber, final Long
cpuSpeed, final Doub
public void setCpuUsed(final String cpuUsed, final Integer cpuNumber,
final Long cpuSpeed) {
if (cpuUsed != null && cpuNumber != null && cpuSpeed != null) {
- this.cpuUsed = String.format("%.2f Ghz",
Double.valueOf(cpuUsed.replace("%", "")) * cpuNumber * cpuSpeed / (100.0 *
1000.0));
+ this.cpuUsed = String.format("%.2f Ghz",
Double.valueOf(cpuUsed.replace(",",".").replace("%", "")) * cpuNumber *
cpuSpeed / (100.0 * 1000.0));
Review comment:
Would there be a case where cpu usage is more than 1000% ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]