DaanHoogland commented on code in PR #10492:
URL: https://github.com/apache/cloudstack/pull/10492#discussion_r1979640472
##########
server/src/main/java/com/cloud/server/StatsCollector.java:
##########
@@ -718,7 +718,7 @@ protected void runInContext() {
getDynamicDataFromDB();
long interval = (Long) dbStats.get(uptime) - lastUptime;
long activity = (Long) dbStats.get(queries) - lastQueries;
- loadHistory.add(0, Double.valueOf(activity / interval));
+ loadHistory.add(0, interval == 0 ? 0 :
Double.valueOf(activity / interval));
Review Comment:
if activities == 5 we don't want the user to think 0 because af a possible
math error.
```suggestion
loadHistory.add(0, interval == 0 ? -1 :
Double.valueOf(activity / interval));
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]