From 19e7a621ed601af896b8a3e00196b1690a5b4252 Mon Sep 17 00:00:00 2001 From: ayasayadi1 Date: Tue, 30 Apr 2024 09:56:43 +0000 Subject: [PATCH] set avg duration to 0 if smaller than 0.1s --- .../public/core/events/javascripts/countly.details.models.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/express/public/core/events/javascripts/countly.details.models.js b/frontend/express/public/core/events/javascripts/countly.details.models.js index 7ab10683e8b..6f193b854e3 100644 --- a/frontend/express/public/core/events/javascripts/countly.details.models.js +++ b/frontend/express/public/core/events/javascripts/countly.details.models.js @@ -11,7 +11,8 @@ for (var i = 0; i < chartData.length; i++) { graphData[0].push(chartData[i].c ? chartData[i].c : 0); graphData[1].push(chartData[i].s ? chartData[i].s : 0); - graphData[2].push(chartData[i].dur ? chartData[i].dur / (chartData[i].c || 1) : 0); + let avgDur = (chartData[i].dur || 0) / (chartData[i].c || 1); + graphData[2].push(avgDur < 0.1 ? 0 : avgDur); if (chartData[i].c) { count += chartData[i].c; }