Skip to content

Commit

Permalink
add count to app state
Browse files Browse the repository at this point in the history
  • Loading branch information
sveisvei committed Nov 13, 2016
1 parent c7faf46 commit 7460326
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/client-metrics/client-metrics.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
3 changes: 3 additions & 0 deletions lib/client-metrics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit 7460326

Please sign in to comment.