1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

add count to app state

This commit is contained in:
sveisvei 2016-11-13 21:25:37 +01:00 committed by Ivar Conradi Østhus
parent 68ac0c71c9
commit a34ee105fe
2 changed files with 4 additions and 0 deletions

View File

@ -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 });

View File

@ -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;
}
}
}