Laszlo Hornyak has uploaded a new change for review. Change subject: engine: some more quota logging fix (WIP) ......................................................................
engine: some more quota logging fix (WIP) Adds the quota_id to the auditlog records so that the generated search queries will find them Change-Id: I6444570c1f63c401cff4f39c5722e9c12cc20a4e Signed-off-by: Laszlo Hornyak <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManager.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManagerAuditLogger.java 2 files changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/59/13359/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManager.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManager.java index 07cca0e..022787b 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManager.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManager.java @@ -273,6 +273,7 @@ log.setFirst(AuditLogType.USER_EXCEEDED_QUOTA_STORAGE_THRESHOLD); quotaManagerAuditLogger.addCustomValuesStorage(log.getSecond(), quota.getQuotaName(), + quota.getId(), storageUsagePercentage + storageRequestPercentage, storageRequestPercentage); requestIsApproved = true; @@ -280,6 +281,7 @@ log.setFirst(AuditLogType.USER_EXCEEDED_QUOTA_STORAGE_LIMIT); quotaManagerAuditLogger.addCustomValuesStorage(log.getSecond(), quota.getQuotaName(), + quota.getId(), storageUsagePercentage + storageRequestPercentage, storageRequestPercentage); requestIsApproved = true; @@ -287,6 +289,7 @@ log.setFirst(AuditLogType.USER_EXCEEDED_QUOTA_STORAGE_GRACE_LIMIT); quotaManagerAuditLogger.addCustomValuesStorage(log.getSecond(), quota.getQuotaName(), + quota.getId(), storageUsagePercentage, storageRequestPercentage); if (QuotaEnforcementTypeEnum.HARD_ENFORCEMENT == quotaEnforcementTypeEnum) { @@ -341,6 +344,7 @@ auditLogPair.setFirst(AuditLogType.USER_EXCEEDED_QUOTA_VDS_GROUP_THRESHOLD); quotaManagerAuditLogger.addCustomValuesVdsGroup(auditLogPair.getSecond(), quota.getQuotaName(), + quota.getId(), vcpuCurrentPercentage + vcpuToAddPercentage, vcpuToAddPercentage, memCurrentPercentage + memToAddPercentage, @@ -354,6 +358,7 @@ auditLogPair.setFirst(AuditLogType.USER_EXCEEDED_QUOTA_VDS_GROUP_LIMIT); quotaManagerAuditLogger.addCustomValuesVdsGroup(auditLogPair.getSecond(), quota.getQuotaName(), + quota.getId(), vcpuCurrentPercentage + vcpuToAddPercentage, vcpuToAddPercentage, memCurrentPercentage + memToAddPercentage, @@ -365,6 +370,7 @@ auditLogPair.setFirst(AuditLogType.USER_EXCEEDED_QUOTA_VDS_GROUP_GRACE_LIMIT); // passed the grace quotaManagerAuditLogger.addCustomValuesVdsGroup(auditLogPair.getSecond(), quota.getQuotaName(), + quota.getId(), vcpuCurrentPercentage, vcpuToAddPercentage, memCurrentPercentage, diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManagerAuditLogger.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManagerAuditLogger.java index e6cfaeb..96664e6 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManagerAuditLogger.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManagerAuditLogger.java @@ -2,6 +2,7 @@ import org.ovirt.engine.core.common.AuditLogType; +import org.ovirt.engine.core.compat.Guid; import org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector; import org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase; @@ -12,16 +13,19 @@ protected void addCustomValuesStorage(AuditLogableBase auditLogableBase, String quotaName, + Guid quotaId, double storageUsagePercentage, double storageRequestedPercentage) { auditLogableBase.addCustomValue("QuotaName", quotaName); auditLogableBase.addCustomValue("CurrentStorage", percentageFormatter.format(storageUsagePercentage)); auditLogableBase.addCustomValue("Requested", percentageFormatter.format(storageRequestedPercentage)); auditLogableBase.setQuotaNameForLog(quotaName); + auditLogableBase.setQuotaIdForLog(quotaId); } protected void addCustomValuesVdsGroup(AuditLogableBase auditLogableBase, String quotaName, + Guid quotaId, double cpuCurrentPercentage, double cpuRequestPercentage, double memCurrentPercentage, @@ -50,6 +54,7 @@ auditLogableBase.addCustomValue("Utilization", currentUtilization.toString()); auditLogableBase.addCustomValue("Requested", request.toString()); auditLogableBase.setQuotaNameForLog(quotaName); + auditLogableBase.setQuotaIdForLog(quotaId); } public void auditLog(AuditLogType auditLogType, AuditLogableBase auditLogable) { -- To view, visit http://gerrit.ovirt.org/13359 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6444570c1f63c401cff4f39c5722e9c12cc20a4e Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Laszlo Hornyak <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
