You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "toffentoffen (via GitHub)" <gi...@apache.org> on 2023/02/21 17:45:24 UTC

[GitHub] [skywalking-booster-ui] toffentoffen commented on a diff in pull request #239: feat: add a calculation for `cpm5d`

toffentoffen commented on code in PR #239:
URL: https://github.com/apache/skywalking-booster-ui/pull/239#discussion_r1113389501


##########
src/hooks/useMetricsProcessor.ts:
##########
@@ -398,15 +398,15 @@ export function aggregation(val: number, config: { calculation?: string }): numb
     case Calculations.Apdex:
       data = (val / 10000).toFixed(2);
       break;
+    case Calculations.CPM5D:
+      data = (val / 100000).toFixed(2);

Review Comment:
   I think it is better as @wu-sheng suggested. Good catch.
   My main reason is to allow converting it back. For instance if we have had only 1 call in a day:
   How it will be displayed:
   - `(69/100000).toFixed(2) == '0.00'`
   - `(69/100000).toFixed(5) ==  '0.00069'
   If the user, would like to know how many request they have had:
   - `(69/100000).toFixed(2) * 1440` == 0`
   - `(69/100000).toFixed(5) * 1440 == 0.9935999999999999` ~ 1 request



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org