Skip to content

Commit 2c2435e

Browse files
authored
fix(logging): ZMSA-58: add elapsed time to storing message for benchmarking (#99)
1 parent a26f964 commit 2c2435e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,7 @@ exports.hook_queue = function (next, connection) {
14121412
});
14131413

14141414
try {
1415+
const start = Date.now();
14151416
const { response, prepared: preparedResponse } = await plugin.filterHandler.storeMessage(userData, {
14161417
mimeTree: prepared && prepared.mimeTree,
14171418
maildata: prepared && prepared.maildata,
@@ -1440,7 +1441,8 @@ exports.hook_queue = function (next, connection) {
14401441
sendLogEntry({
14411442
short_message: '[MX FILTER-HANDLER] Finished storing message',
14421443
_user: userData._id.toString(),
1443-
_to: recipient
1444+
_to: recipient,
1445+
_elapsed: start - Date.now()
14441446
});
14451447

14461448
if (!prepared && preparedResponse) {

0 commit comments

Comments
 (0)