-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Only request metric collections for hosts connected to the MS #13561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.20
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1226,6 +1226,14 @@ protected void runInContext() { | |
|
|
||
| Map<Object, Object> metrics = new HashMap<>(); | ||
| for (HostVO host : hosts) { | ||
| if (host.getHypervisorType() == HypervisorType.KVM && ManagementServerNode.getManagementServerId() != host.getManagementServerId()) { | ||
| // When there are multiple Management Server nodes on the environment, all of them request stat collections for the same VM in different moments; with that, | ||
| // the interval from "vm.stats.interval" is not respected. Also, the stats commands are routed to the Management Server connected to the Agent where the VM is running. | ||
| // Furthermore, the number of stat entries on the DB scales with the number of Management Servers. Therefore, we only request the stat collections from | ||
| // hosts connected to the Management Server, honoring the interval, presenting the correct data, and reducing the necessary storage to store the VMs stats. | ||
|
Comment on lines
+1230
to
+1233
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @GaOrtiga , can you summarise this and move it to a javadoc?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can move it to the javadoc, I originally put it there because I believe its a little weird to have a javadoc that refers to a single if in the method, but I'm fine with changing it. As far as summarizing, would it still be necessary? if we are moving it to the javadocs it's no longer cluttering the code, and having the full information on why this if is usefull won't hurt
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well, I’d prefer to have no comment in a method unless there are some really nasty quirks needed. In this case I don’t think any comment is needed to be honest. I summary of the method is more useful in my opinion. (no hard demands) |
||
| logger.debug("Skipping VM stat collection for [{}] as it is connected to another Management Server node [{}].", host, host.getManagementServerId()); | ||
| continue; | ||
| } | ||
| Date timestamp = new Date(); | ||
| Pair<Map<Long, VMInstanceVO>, Map<String, Long>> vmsAndMap = getVmMapForStatsForHost(host); | ||
| Map<Long, VMInstanceVO> vmMap = vmsAndMap.first(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.