feat: add a calculation to convert seconds to days (#135)

This commit is contained in:
Fine0830 2022-08-08 10:26:36 +08:00 committed by GitHub
parent 732b834749
commit f5bcd5da2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View File

@ -36,6 +36,7 @@ export enum Calculations {
Average = "average",
PercentageAvg = "percentageAvg",
ApdexAvg = "apdexAvg",
SecondToDay = "secondToDay",
}
export enum sizeEnum {
XS = "XS",

View File

@ -398,6 +398,9 @@ export function aggregation(
case Calculations.MsTos:
data = (val / 1000).toFixed(2);
break;
case Calculations.SecondToDay:
data = (val / 86400).toFixed(2);
break;
default:
data;
break;

View File

@ -284,4 +284,5 @@ export const CalculationOpts = [
{ label: "Seconds to YYYY-MM-DD HH:mm:ss", value: "convertSeconds" },
{ label: "Precision is 2", value: "precision" },
{ label: "Milliseconds to seconds", value: "msTos" },
{ label: "Seconds to days", value: "secondToDay" },
];