From b8fcb265b2f2f5dbd6f915ff510635a7b6c531ff Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Tue, 13 Jul 2021 12:40:46 +0100 Subject: [PATCH] [misc] EventLogger: drop explicit metrics.inc amount The module has a hard-coded increment of 1, which is the only value the prometheus backend supports. --- services/real-time/app/js/EventLogger.js | 2 +- services/real-time/test/unit/js/EventLoggerTests.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/real-time/app/js/EventLogger.js b/services/real-time/app/js/EventLogger.js index 21c3460865..91f63e143c 100644 --- a/services/real-time/app/js/EventLogger.js +++ b/services/real-time/app/js/EventLogger.js @@ -43,7 +43,7 @@ module.exports = EventLogger = { // store the last count in a hash for each host const previous = EventLogger._storeEventCount(key, count) if (!previous || count === previous + 1) { - metrics.inc(`event.${channel}.valid`, 0.001) // downsample high rate docupdater events + metrics.inc(`event.${channel}.valid`) return // order is ok } if (count === previous) { diff --git a/services/real-time/test/unit/js/EventLoggerTests.js b/services/real-time/test/unit/js/EventLoggerTests.js index fd759c8b42..037f2e214a 100644 --- a/services/real-time/test/unit/js/EventLoggerTests.js +++ b/services/real-time/test/unit/js/EventLoggerTests.js @@ -55,7 +55,7 @@ describe('EventLogger', function () { return it('should increment the valid event metric', function () { return this.metrics.inc - .calledWith(`event.${this.channel}.valid`, 1) + .calledWith(`event.${this.channel}.valid`) .should.equals(true) }) }) @@ -80,7 +80,7 @@ describe('EventLogger', function () { return it('should increment the duplicate event metric', function () { return this.metrics.inc - .calledWith(`event.${this.channel}.duplicate`, 1) + .calledWith(`event.${this.channel}.duplicate`) .should.equals(true) }) }) @@ -110,7 +110,7 @@ describe('EventLogger', function () { return it('should increment the out-of-order event metric', function () { return this.metrics.inc - .calledWith(`event.${this.channel}.out-of-order`, 1) + .calledWith(`event.${this.channel}.out-of-order`) .should.equals(true) }) })