-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial audit logging, for review. #1006
base: master
Are you sure you want to change the base?
Conversation
The following links are available: |
The following links are available:
build (macOS-latest, full) build (windows-latest, full) build (ubuntu-18.04, android) |
this is a threading issue: the problem in the above image is that the isProcessorRunning method is being called on an object that has been destroyed, likely triggered from a different thread. you can see in the log that a thread was stopped just before the crash |
Notes: I should fold the terse edit logging into this somehow as an extra option applied to this. |
Further notes: will not combine terse edit logging into this PR because terse may very well be useful for debugging purposes. Gotta fix the crash still. |
The following links are available:
build (macOS-latest, full) build (windows-latest, full) build (ubuntu-18.04, android) |
{ | ||
"name": "auditEditLoggingInterval", | ||
"label": "Audit Entity Edit Logging Interval", | ||
"help": "Milliseconds between the outputting and clearing of audit logs for entity edits/adds.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"help": "Milliseconds between the outputting and clearing of audit logs for entity edits/adds.", | |
"help": "Milliseconds between the outputting and clearing of audit logs for entity adds/edits.", |
if (_auditLogProcessorTimer && _auditLogProcessorTimer != NULL && _auditLogProcessorTimer->isActive()) { | ||
return true; | ||
} else { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (_auditLogProcessorTimer && _auditLogProcessorTimer != NULL && _auditLogProcessorTimer->isActive()) { | |
return true; | |
} else { | |
return false; | |
} | |
return _auditLogProcessorTimer && _auditLogProcessorTimer->isActive(); |
QJsonObject newEntry{ { entityID, 1 } }; | ||
auditLogEditBuffer.insert(sender, newEntry); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing CR at EOF.
entitiesAuditLogProcessor.startAuditLogProcessor(); | ||
} | ||
|
||
qDebug() << "PROCESSING" << wantAuditEditLogging() << " - " << entitiesAuditLogProcessor.isProcessorRunning(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qDebug() << "PROCESSING" << wantAuditEditLogging() << " - " << entitiesAuditLogProcessor.isProcessorRunning(); | |
qCDebug(entities) << "PROCESSING" << wantAuditEditLogging() << "-" << entitiesAuditLogProcessor.isProcessorRunning(); |
Spaces are automatically included between items.
entitiesAuditLogProcessor.processEditEntityPacket(senderNode->getPublicSocket().toString(), | ||
entityItemID.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indenting seems a bit arbitrary.
entitiesAuditLogProcessor.processAddEntityPacket(senderNode->getPublicSocket().toString(), | ||
entityItemID.toString(), | ||
EntityTypes::getEntityTypeName(properties.getType())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indenting seems a bit arbitrary.
@@ -14,6 +14,6 @@ | |||
|
|||
#include <QLoggingCategory> | |||
|
|||
Q_DECLARE_LOGGING_CATEGORY(entities) | |||
Q_DECLARE_LOGGING_CATEGORY(entities); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q_DECLARE_LOGGING_CATEGORY(entities); | |
Q_DECLARE_LOGGING_CATEGORY(entities) |
@@ -45,6 +46,7 @@ | |||
|
|||
static const quint64 DELETED_ENTITIES_EXTRA_USECS_TO_CONSIDER = USECS_PER_MSEC * 50; | |||
const float EntityTree::DEFAULT_MAX_TMP_ENTITY_LIFETIME = 60 * 60; // 1 hour | |||
const float EntityTree::DEFAULT_AUDIT_EDIT_INTERVAL = 10000; // 10 seconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const float EntityTree::DEFAULT_AUDIT_EDIT_INTERVAL = 10000; // 10 seconds | |
const float EntityTree::DEFAULT_AUDIT_EDIT_LOGGING_INTERVAL = 10000; // 10 seconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These names are unfortunately long.
Hello! Is this still an issue? |
Before I break it out into its own class and all that jazz (if I should even...), I'd like to know if this is relatively performant or would be, what better ways can I do this? I also wanted to do a push of changed properties each time. However that requires looping and that adds more overhead.
Now this can be good for general times when rapid edits aren't necessary, but would like to know if this is/can be performant enough for general use running in the background too.