Skip to content

Commit

Permalink
Update packages/spacecat-shared-rum-api-client/src/functions/total-me…
Browse files Browse the repository at this point in the history
…trics.js

Co-authored-by: Ekrem Doğan <ekremney@users.noreply.github.com>
  • Loading branch information
alinarublea and ekremney authored Dec 20, 2024
1 parent d23e4a7 commit 3fc6dd6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function handler(bundles) {
dataChunks.addSeries('ctr', (bundle) => (bundle.events.some((e) => e.checkpoint === 'click')
? bundle.weight
: 0));
const totalPageViews = dataChunks?.totals?.traffic_domain?.sum;
const totalPageViews = dataChunks?.totals?.traffic_domain?.weight;
const totalCTR = dataChunks?.totals?.ctr?.sum / dataChunks?.totals?.ctr?.weight;

Check failure on line 24 in packages/spacecat-shared-rum-api-client/src/functions/total-metrics.js

View workflow job for this annotation

GitHub Actions / Test

Unsafe arithmetic operation on optional chaining. It can result in NaN

Check failure on line 24 in packages/spacecat-shared-rum-api-client/src/functions/total-metrics.js

View workflow job for this annotation

GitHub Actions / Test

Unsafe arithmetic operation on optional chaining. It can result in NaN
return {
totalPageViews,
Expand Down

0 comments on commit 3fc6dd6

Please sign in to comment.