Skip to content

Commit 8a5f1d9

Browse files
authored
Merge pull request #6598 from Countly/stats-event
[server-stats] Fix breakdown event calculation
2 parents 812564c + c3b624a commit 8a5f1d9

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
## Version 25.03.XX
2+
Fixes:
3+
- [server-stats] Fix breakdown event calculation
4+
25
Enterprise Fixes:
36
- [journeys] Update skip threshold when journeys are paused
47

8+
59
## Version 25.03.17
610
Enterprise Fixes:
711
- [ldap] Recursive user search in ldap added
812
- [license] Update metric endpoint permission
9-
13+
1014
Dependencies:
1115
- Bump puppeteer from 24.16.2 to 24.17.0
1216

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)