Github user rafaelweingartner commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/780#discussion_r56509710
--- Diff:
plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
---
@@ -3332,7 +3332,14 @@ public PowerState getVmState(final Connection conn,
final String vmName) {
vmStatsAnswer.setDiskReadKBs(vmStatsAnswer.getDiskReadKBs() +
getDataAverage(dataNode, col, numRows) / 1000);
} else if (param.matches("vbd_.*_write")) {
vmStatsAnswer.setDiskWriteKBs(vmStatsAnswer.getDiskWriteKBs() +
getDataAverage(dataNode, col, numRows) / 1000);
+ } else if (param.contains("memory_internal_free")) {
--- End diff --
I know you just followed the way the code was written here before, but this
âif/else/if/elseâ¦â¦â structure is too big; I believe to introduce some
changes like this here; it would be much appreciated a refactoring. I do not
mean a huge refactoring, only the extraction of this if/else structure to a
method and then using some other clever way to do these checks and to retrieve
the values.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---