You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2023/03/21 01:27:08 UTC
[skywalking-booster-ui] branch main updated: revert: cpm5d (#245)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-booster-ui.git
The following commit(s) were added to refs/heads/main by this push:
new 8031c1b revert: cpm5d (#245)
8031c1b is described below
commit 8031c1b463cc98a2e1785c6e20867e0a91efe5c0
Author: Fine0830 <fa...@gmail.com>
AuthorDate: Tue Mar 21 09:27:02 2023 +0800
revert: cpm5d (#245)
---
src/hooks/data.ts | 2 --
src/hooks/useListConfig.ts | 2 +-
src/hooks/useMetricsProcessor.ts | 25 ++-----------------------
src/views/dashboard/data.ts | 2 --
4 files changed, 3 insertions(+), 28 deletions(-)
diff --git a/src/hooks/data.ts b/src/hooks/data.ts
index d51271c..a6955f5 100644
--- a/src/hooks/data.ts
+++ b/src/hooks/data.ts
@@ -38,8 +38,6 @@ export enum Calculations {
ApdexAvg = "apdexAvg",
SecondToDay = "secondToDay",
NanosecondToMillisecond = "nanosecondToMillisecond",
- CPM5D = "cpm5d",
- CPM5DAvg = "cpm5dAvg",
}
export enum sizeEnum {
XS = "XS",
diff --git a/src/hooks/useListConfig.ts b/src/hooks/useListConfig.ts
index 0e2e57d..61b0924 100644
--- a/src/hooks/useListConfig.ts
+++ b/src/hooks/useListConfig.ts
@@ -17,7 +17,7 @@
import { MetricQueryTypes, Calculations } from "./data";
export function useListConfig(config: any, index: string) {
const i = Number(index);
- const types = [Calculations.Average, Calculations.ApdexAvg, Calculations.PercentageAvg, Calculations.CPM5DAvg];
+ const types = [Calculations.Average, Calculations.ApdexAvg, Calculations.PercentageAvg];
const calculation = config.metricConfig && config.metricConfig[i] && config.metricConfig[i].calculation;
const isLinear =
[MetricQueryTypes.ReadMetricsValues, MetricQueryTypes.ReadLabeledMetricsValues].includes(config.metricTypes[i]) &&
diff --git a/src/hooks/useMetricsProcessor.ts b/src/hooks/useMetricsProcessor.ts
index d401ebe..7519086 100644
--- a/src/hooks/useMetricsProcessor.ts
+++ b/src/hooks/useMetricsProcessor.ts
@@ -290,11 +290,7 @@ export function usePodsSource(
}
if (config.metricTypes[index] === MetricQueryTypes.ReadMetricsValues) {
d[name] = {};
- if (
- [Calculations.Average, Calculations.ApdexAvg, Calculations.PercentageAvg, Calculations.CPM5DAvg].includes(
- c.calculation,
- )
- ) {
+ if ([Calculations.Average, Calculations.ApdexAvg, Calculations.PercentageAvg].includes(c.calculation)) {
d[name]["avg"] = calculateExp(resp.data[key].values.values, c);
}
d[name]["values"] = resp.data[key].values.values.map((val: { value: number }) => aggregation(val.value, c));
@@ -319,11 +315,7 @@ export function usePodsSource(
if (!d[key]) {
d[key] = {};
}
- if (
- [Calculations.Average, Calculations.ApdexAvg, Calculations.PercentageAvg, Calculations.CPM5DAvg].includes(
- c.calculation,
- )
- ) {
+ if ([Calculations.Average, Calculations.ApdexAvg, Calculations.PercentageAvg].includes(c.calculation)) {
d[key]["avg"] = calculateExp(item.values.values, c);
}
d[key]["values"] = values;
@@ -377,13 +369,6 @@ function calculateExp(arr: { value: number }[], config: { calculation?: string }
case Calculations.ApdexAvg:
data = [(sum / arr.length / 10000).toFixed(2)];
break;
- case Calculations.CPM5DAvg:
- data = [
- sum / arr.length / 100000 < 1 && sum / arr.length / 100000 !== 0
- ? (sum / arr.length / 100000).toFixed(5)
- : (sum / arr.length / 100000).toFixed(2),
- ];
- break;
default:
data = arr.map((d) => aggregation(d.value, config));
break;
@@ -413,9 +398,6 @@ export function aggregation(val: number, config: { calculation?: string }): numb
case Calculations.Apdex:
data = (val / 10000).toFixed(2);
break;
- case Calculations.CPM5D:
- data = val / 100000 < 1 && val / 100000 !== 0 ? (val / 100000).toFixed(5) : (val / 100000).toFixed(2);
- break;
case Calculations.ConvertSeconds:
data = dayjs(val * 1000).format("YYYY-MM-DD HH:mm:ss");
break;
@@ -434,9 +416,6 @@ export function aggregation(val: number, config: { calculation?: string }): numb
case Calculations.ApdexAvg:
data = (val / 10000).toFixed(2);
break;
- case Calculations.CPM5DAvg:
- data = val / 100000 < 1 && val / 100000 !== 0 ? (val / 100000).toFixed(5) : (val / 100000).toFixed(2);
- break;
default:
data;
break;
diff --git a/src/views/dashboard/data.ts b/src/views/dashboard/data.ts
index ad1a706..2ab85dc 100644
--- a/src/views/dashboard/data.ts
+++ b/src/views/dashboard/data.ts
@@ -300,7 +300,6 @@ export const CalculationOpts = [
{ label: "Apdex", value: "apdex" },
{ label: "Avg-preview", value: "average" },
{ label: "Percentage + Avg-preview", value: "percentageAvg" },
- { label: "CPM5D + Avg-preview", value: "cpm5dAvg" },
{ label: "Apdex + Avg-preview", value: "apdexAvg" },
{ label: "Byte to KB", value: "byteToKB" },
{ label: "Byte to MB", value: "byteToMB" },
@@ -310,7 +309,6 @@ export const CalculationOpts = [
value: "convertMilliseconds",
},
{ label: "Seconds to YYYY-MM-DD HH:mm:ss", value: "convertSeconds" },
- { label: "CPM5D", value: "cpm5d" },
{ label: "Milliseconds to seconds", value: "msTos" },
{ label: "Seconds to days", value: "secondToDay" },
{ label: "Nanoseconds to milliseconds", value: "nanosecondToMillisecond" },