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 36c0ed4 commit d23e4a7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function handler(bundles) {
? bundle.weight
: 0));
const totalPageViews = dataChunks?.totals?.traffic_domain?.sum;
const totalCTR = dataChunks?.totals?.ctr?.sum;
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,
totalCTR,
Expand Down

0 comments on commit d23e4a7

Please sign in to comment.