Skip to content

Commit 6221877

Browse files
committed
[server-stats] Fix breakdown event calculation
1 parent bd907c4 commit 6221877

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugins/server-stats/api/parts/stats.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ function increaseDataPoints(object, data) {
128128
object.ratings += (data.str || 0);
129129
object.apm += (data.apm || 0);
130130
object.custom += (data.ce || 0);
131-
object.cs = (data.cs || 0);
132-
object.ps = (data.ps || 0);
131+
object.cs += (data.cs || 0);
132+
object.ps += (data.ps || 0);
133133
if (data.dp) {
134134
object.dp += data.dp;
135135
}
@@ -241,7 +241,7 @@ function fetchDatapoints(db, filter, options, callback) {
241241
options.dateObjPrev = options.dateObjPrev || {};
242242
db.collection("server_stats_data_points").find(filter, {}).toArray(function(err, result) {
243243
var toReturn = {
244-
"all-apps": {"events": 0, "sessions": 0, "push": 0, "dp": 0, "change": 0, "crash": 0, "views": 0, "actions": 0, "nps": 0, "surveys": 0, "ratings": 0, "apm": 0, "custom": 0},
244+
"all-apps": {"events": 0, "sessions": 0, "push": 0, "dp": 0, "change": 0, "crash": 0, "views": 0, "actions": 0, "nps": 0, "surveys": 0, "ratings": 0, "apm": 0, "custom": 0, cs: 0, ps: 0},
245245
};
246246

247247
if (err || !result) {
@@ -280,7 +280,7 @@ function fetchDatapoints(db, filter, options, callback) {
280280

281281
for (let i = 0; i < result.length; i++) {
282282
if (!toReturn[result[i].a]) {
283-
toReturn[result[i].a] = {"events": 0, "sessions": 0, "push": 0, "dp": 0, "change": 0, "crash": 0, "views": 0, "actions": 0, "nps": 0, "surveys": 0, "ratings": 0, "apm": 0, "custom": 0};
283+
toReturn[result[i].a] = {"events": 0, "sessions": 0, "push": 0, "dp": 0, "change": 0, "crash": 0, "views": 0, "actions": 0, "nps": 0, "surveys": 0, "ratings": 0, "apm": 0, "custom": 0, cs: 0, ps: 0};
284284
}
285285
const dates = result[i].d;
286286
if (options.dateObj[result[i].m]) {

0 commit comments

Comments
 (0)