michaeljmarshall commented on a change in pull request #13609:
URL: https://github.com/apache/pulsar/pull/13609#discussion_r779152660
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LinuxBrokerHostUsageImpl.java
##########
@@ -110,6 +110,10 @@ public void calculateBrokerHostUsage() {
double elapsedSeconds = (now - lastCollection) / 1000d;
double cpuUsage = getTotalCpuUsage(elapsedSeconds);
Review comment:
Nit: it looks like this `getTotalCpuUsage` method updates state for
`lastCpuUsage` and `lastCpuTotalTime`. I don't think we want to update those
unless we're going to completely update the cpu stats. I think we should move
the early return conditional block to before this line 111.
--
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]