diff --git a/lib/client-metrics/client-metrics.test.js b/lib/client-metrics/client-metrics.test.js index b8d738a7b0..7beef4c9e4 100644 --- a/lib/client-metrics/client-metrics.test.js +++ b/lib/client-metrics/client-metrics.test.js @@ -78,6 +78,7 @@ test('addPayload', t => { t.truthy(metrics.clients[instanceId].appName === appName); t.truthy(metrics.clients[instanceId].count === 123); + t.truthy(metrics.apps[appName].count === 123); t.truthy(metrics.globalCount === 123); t.deepEqual(metrics.getTogglesMetrics().lastHour.toggleX, { yes: 123, no: 0 }); diff --git a/lib/client-metrics/index.js b/lib/client-metrics/index.js index 2facdf45df..13a15ea50c 100644 --- a/lib/client-metrics/index.js +++ b/lib/client-metrics/index.js @@ -81,6 +81,9 @@ module.exports = class UnleashClientMetrics { if (this.clients[instanceId]) { this.clients[instanceId].count += count; } + if (this.apps[appName]) { + this.apps[appName].count += count; + } } }