Change in ovirt-engine[master]: engine: Super audit log improvement

Michael Kublin has submitted this change and it was merged. Change subject: engine: Super audit log improvement ...................................................................... engine: Super audit log improvement So what is current (before patch) behaviour inorder to make some audit log message: 1. Pass class that extends AuditLogableBase 2. Pass a message with keys that should be replaces based on properties from passed class 3. Go over all properties in passed class, collect them and create a HashMap with key as property name and value as property value 4. Replace keys in message using a created HashMap. Now, lets take a look on 3, how we retrieve a properties - we invoke all getXXX methods in our class. How many getXXX methods has simple AuditLogableBase class? How big will be our HashMap? How many queries/calculations will run during invoking some of the getXXX messages, because our class not simple bean? The only answer is a lot, only in simple run I saw a HashMap with 150 values (sic!). I fix this, if I have a message I know all keys that I need, I don't need to go throught all getXXX methods. Intresting fact: optimized solution required less code. Another intresting fact - adding of additional getter to AuditLogableBase, before a fix, was like adding a small brake to the system. Change-Id: Id68a098be36fcfc47c23c57fce3abea50e6273e3 Signed-off-by: Michael Kublin <mkublin@redhat.com> --- M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java M backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirectorTest.java 2 files changed, 23 insertions(+), 23 deletions(-) Approvals: Michael Kublin: Verified; Looks good to me, approved -- To view, visit http://gerrit.ovirt.org/13425 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id68a098be36fcfc47c23c57fce3abea50e6273e3 Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Michael Kublin <mkublin@redhat.com> Gerrit-Reviewer: Barak Azulay <bazulay@redhat.com> Gerrit-Reviewer: Eli Mesika <emesika@redhat.com> Gerrit-Reviewer: Michael Kublin <mkublin@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzaslavs@redhat.com>
participants (1)
-
mkublin@redhat.com