1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00

add count to app state

This commit is contained in:
sveisvei 2016-11-13 21:25:37 +01:00
parent c7faf46d26
commit 7460326c5d
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;
}
}
}