add calculations

This commit is contained in:
Qiuxia Fan 2022-03-30 11:24:40 +08:00
parent 61d182b986
commit 9b8a939e62
4 changed files with 13 additions and 3 deletions

View File

@ -26,6 +26,8 @@ export enum MetricQueryTypes {
export enum Calculations {
Percentage = "percentage",
ByteToKB = "byteToKB",
ByteToMB = "ByteToMB",
ByteToGB = "ByteToGB",
Apdex = "apdex",
Precision = "precision",
ConvertSeconds = "convertSeconds",

View File

@ -324,6 +324,12 @@ export function aggregation(val: number, config: any): number | string {
case Calculations.ByteToKB:
data = val / 1024;
break;
case Calculations.ByteToMB:
data = val / 1024 / 1024;
break;
case Calculations.ByteToGB:
data = val / 1024 / 1024 / 1024;
break;
case Calculations.Apdex:
data = val / 10000;
break;

View File

@ -38,8 +38,8 @@ const msg = {
health: "Health",
groupName: "Group Name",
topologies: "Topologies",
dataPanel: "Data Panel",
controlPanel: "Control Panel",
dataPanel: "Data Plane",
controlPanel: "Control Plane",
eventList: "Event List",
databasePanel: "Database Panel",
meshServicePanel: "Service Panel",

View File

@ -269,8 +269,10 @@ export const TextColors: { [key: string]: string } = {
export const CalculationOpts = [
{ label: "Percentage", value: "percentage" },
{ label: "Byte to KB", value: "byteToKB" },
{ label: "Apdex", value: "apdex" },
{ label: "Byte to KB", value: "byteToKB" },
{ label: "Byte to MB", value: "byteToMB" },
{ label: "Byte to GB", value: "byteToGB" },
{
label: "Convert milliseconds to YYYY-MM-DD HH:mm:ss",
value: "convertMilliseconds",