Arik Hadas has posted comments on this change.
Change subject: engine: Report when vm gets less the Guaranteed memory
......................................................................
Patch Set 3: (3 inline comments)
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmStatistics.java
Line 130: this.usage_mem_percentField = value;
Line 131: }
Line 132:
Line 133: // NOT PRESISTED
Line 134: private Integer currentMemory;
1. please move the field declaration to the beginning of the class (other
fields are declared that way in this class I know, but let's add new fields
properly)
2. consider to change the comment type to /** */ so that we'll be able to add
javadoc things if we'd like
Line 135:
Line 136: public Integer getCurrentMemory() {
Line 137: return currentMemory;
Line 138: }
....................................................
File
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java
Line 1309: VM savedVm =
_vmDict.get(vmInternalData.getVmDynamic().getId());
Line 1310: if (vmInternalData.getVmStatistics().getCurrentMemory()
!= null &&
Line 1311: savedVm.getMinAllocatedMem() >
vmInternalData.getVmStatistics().getCurrentMemory()) {
Line 1312: AuditLogableBase auditLogable = new
AuditLogableBase();
Line 1313: auditLogable.setVmId(savedVm.getId());
that way, the AuditLogableBase instance will have to query the DB for the VM in
order to get its name for the audit log message. if so, it is redundant since
you already have the VM instance, so it's better to set the name explicitly
"logable.addCustomValue("VmName", .getName());"
Line 1314: AuditLogDirector.log(auditLogable,
AuditLogType.VM_MEMORY_UNDER_GUARANTEED_VALUE);
Line 1315: }
Line 1316:
Line 1317: }
Line 1310: if (vmInternalData.getVmStatistics().getCurrentMemory()
!= null &&
Line 1311: savedVm.getMinAllocatedMem() >
vmInternalData.getVmStatistics().getCurrentMemory()) {
Line 1312: AuditLogableBase auditLogable = new
AuditLogableBase();
Line 1313: auditLogable.setVmId(savedVm.getId());
Line 1314: AuditLogDirector.log(auditLogable,
AuditLogType.VM_MEMORY_UNDER_GUARANTEED_VALUE);
1. please use #auditLog method
2. don't you want to include the difference in the audit log?
Line 1315: }
Line 1316:
Line 1317: }
Line 1318: }
--
To view, visit http://gerrit.ovirt.org/16949
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47d32f291f39f0ab51c4e5d20a34ab01b47db562
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Noam Slomianko <[email protected]>
Gerrit-Reviewer: Arik Hadas <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Noam Slomianko <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches