You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/05/13 12:09:50 UTC
[GitHub] [cloudstack] ravening commented on a diff in pull request #6358: Fix memory stats for KVM
ravening commented on code in PR #6358:
URL: https://github.com/apache/cloudstack/pull/6358#discussion_r872331359
##########
agent/src/main/java/com/cloud/agent/Agent.java:
##########
@@ -700,6 +728,62 @@ protected void processRequest(final Request request, final Link link) {
}
}
+ /**
+ * Performs tasks after Agent startup. The tasks performed here should not interfere with the Agent's operation.
+ */
+ protected void runTasksAfterAgentStartup() {
+ setupMemoryBalloonStatsPeriod();
+ }
+
+ /**
+ * Sets the balloon driver of each VM to get the memory stats at the time interval defined in the agent.properties file.
+ */
+ protected void setupMemoryBalloonStatsPeriod() {
+ String listAllVmsResult = Script.runSimpleBashScript(COMMAND_LIST_ALL_VMS);
+ if (StringUtils.isBlank(listAllVmsResult)) {
+ s_logger.debug("Skipping the memory balloon stats period setting, since there are no guest VMs.");
Review Comment:
if period is set to 30 seconds, dont you think this line will populate the log file if there are no vm's?
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org