Gilad Chaplik has posted comments on this change. Change subject: core: Add 5 new Events to AuditLog ......................................................................
Patch Set 3: (7 inline comments) .................................................... File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java Line 22: VDS_ALREADY_IN_REQUESTED_STATUS(493), Line 23: VDS_MANUAL_FENCE_STATUS(494), Line 24: VDS_MANUAL_FENCE_STATUS_FAILED(495), Line 25: VDS_MANUAL_FENCE_FAILED_CALL_FENCE_SPM(530), Line 26: VDS_LOW_MEM(531, AuditLogTimeInterval.HOUR.getValue() * 5), change 5hr to 30min, or the other way around. Line 27: VDS_HIGH_MEM_USE(532, AuditLogTimeInterval.MINUTE.getValue() * 30), Line 28: VDS_HIGH_NETWORK_USE(533, AuditLogTimeInterval.MINUTE.getValue() * 30), Line 29: VDS_HIGH_CPU_USE(534, AuditLogTimeInterval.MINUTE.getValue() * 30), Line 30: VDS_HIGH_SWAP_USE(535, AuditLogTimeInterval.MINUTE.getValue() * 30), .................................................... File backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties Line 521: CONNECT_STORAGE_SERVERS_FAILED=Failed to connect Host ${VdsName} to Storage Servers Line 522: CONNECT_STORAGE_POOL_FAILED=Failed to connect Host ${VdsName} to Storage Pool ${StoragePoolName} Line 523: STORAGE_DOMAIN_ERROR=The error message for connection ${Connection} returned by VDSM was: ${ErrorMessage} Line 524: VDS_LOW_MEM=Available memory of host ${HostName} [${AvailableMemory} MB] is under defined threshold [${Threshold} MB]. Line 525: VDS_HIGH_MEM_USE=Used memory of host ${HostName} [${UsedMemory}%] is over defined threshold [${Threshold}%]. over defined=exceeding? Line 526: VDS_HIGH_NETWORK_USE=Used Network resources of host ${HostName} [${UsedNetwork}%] is over defined threshold [${Threshold}%]. Line 527: VDS_HIGH_CPU_USE=Used CPU of host ${HostName} [${UsedCpu}%] is over defined threshold [${Threshold}%]. Line 528: VDS_HIGH_SWAP_USE=Used swap memory of host ${HostName} [${UsedSwap}%] is over defined threshold [${Threshold}%]. Line 529: VDS_LOW_SWAP=Available swap memory of host ${HostName} [${AvailableSwapMemory} MB] is under defined threshold [${Threshold} MB]. .................................................... File backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java Line 263: Line 264: Integer minAvailableThreshold = Config.GetValue(ConfigValues.LogPhysicalMemoryThresholdInMB); Line 265: Integer maxUsedPercentageThreshold = Config.GetValue(ConfigValues.LogMaxPhysicalMemoryUsedThresholdInPercentage); Line 266: Line 267: AuditLogType valueToLog = stat.getmem_available() < minAvailableThreshold ? stat.getXXX returns wrapped primitive values, and can be null. please add null checks all over. Line 268: AuditLogType.VDS_LOW_MEM : Line 269: AuditLogType.VDS_HIGH_MEM_USE; Line 270: Line 271: if (stat.getmem_available() < minAvailableThreshold Line 265: Integer maxUsedPercentageThreshold = Config.GetValue(ConfigValues.LogMaxPhysicalMemoryUsedThresholdInPercentage); Line 266: Line 267: AuditLogType valueToLog = stat.getmem_available() < minAvailableThreshold ? Line 268: AuditLogType.VDS_LOW_MEM : Line 269: AuditLogType.VDS_HIGH_MEM_USE; can memory exceed both available and used? I guess so... separate to methods. Line 270: Line 271: if (stat.getmem_available() < minAvailableThreshold Line 272: || stat.getusage_mem_percent() > maxUsedPercentageThreshold) { Line 273: AuditLogableBase logable = new AuditLogableBase(stat.getId()); Line 321: * @param stat Line 322: */ Line 323: private void checkVdsSwapThreshold(VdsStatistics stat) { Line 324: Line 325: Integer minAvailableThreshold = Config.GetValue(ConfigValues.LogPhysicalMemoryThresholdInMB); please add a comment here. Line 326: Integer maxUsedPercentageThreshold = Line 327: Config.GetValue(ConfigValues.LogMaxPhysicalMemoryUsedThresholdInPercentage); Line 328: Long swapUsedPercent = (stat.getswap_total() - stat.getswap_free()) / stat.getswap_total(); Line 329: Line 328: Long swapUsedPercent = (stat.getswap_total() - stat.getswap_free()) / stat.getswap_total(); Line 329: Line 330: AuditLogType valueToLog = stat.getswap_free() < minAvailableThreshold ? Line 331: AuditLogType.VDS_LOW_SWAP : Line 332: AuditLogType.VDS_HIGH_SWAP_USE; add a comment here, that a host can't be low and high simultaneously ... Line 333: Line 334: if (stat.getswap_free() < minAvailableThreshold || swapUsedPercent > maxUsedPercentageThreshold) { Line 335: AuditLogableBase logable = new AuditLogableBase(stat.getId()); Line 336: logable.AddCustomValue("HostName", _vds.getvds_name()); Line 330: AuditLogType valueToLog = stat.getswap_free() < minAvailableThreshold ? Line 331: AuditLogType.VDS_LOW_SWAP : Line 332: AuditLogType.VDS_HIGH_SWAP_USE; Line 333: Line 334: if (stat.getswap_free() < minAvailableThreshold || swapUsedPercent > maxUsedPercentageThreshold) { comment... Line 335: AuditLogableBase logable = new AuditLogableBase(stat.getId()); Line 336: logable.AddCustomValue("HostName", _vds.getvds_name()); Line 337: logable.AddCustomValue("UsedSwap", swapUsedPercent.toString()); Line 338: logable.AddCustomValue("AvailableSwapMemory", stat.getswap_free().toString()); -- To view, visit http://gerrit.ovirt.org/10865 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id382c4688bdcf46f7b343ff0661893a97b5dc726 Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: ofri masad <oma...@redhat.com> Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com> Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: ofri masad <oma...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches