From a0a860b71759280286b90669d849bf381e2ee451 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 16 Sep 2024 00:22:17 +0200 Subject: [PATCH] bench: format duration --- code-pushup.config.ts | 4 +++- tooling/measures/nx-performance/audit/project-task.audit.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code-pushup.config.ts b/code-pushup.config.ts index f326110e..55b27687 100644 --- a/code-pushup.config.ts +++ b/code-pushup.config.ts @@ -1,7 +1,9 @@ import {CoreConfig} from "@code-pushup/models"; import nxPerformancePlugin from "./tooling/measures/nx-performance/nx-performance.plugin"; -const tasks = ['cli-e2e:e2e', 'cli-e2e-original:original-e2e']; +const tasks = [ + 'cli-e2e:e2e', 'cli-e2e-original:original-e2e' +]; export default { plugins: [ nxPerformancePlugin({ diff --git a/tooling/measures/nx-performance/audit/project-task.audit.ts b/tooling/measures/nx-performance/audit/project-task.audit.ts index 0a6d9993..c38e3c63 100644 --- a/tooling/measures/nx-performance/audit/project-task.audit.ts +++ b/tooling/measures/nx-performance/audit/project-task.audit.ts @@ -1,5 +1,5 @@ import {AuditOutput, Audit} from "@code-pushup/models"; -import {executeProcess, slugify} from "@code-pushup/utils"; +import {executeProcess, slugify, formatDuration} from "@code-pushup/utils"; import {logger, readJsonFile} from "@nx/devkit"; @@ -42,7 +42,7 @@ export async function projectTaskAudits(options?: ProjectTaskAuditOptions): Prom slug: getAuditSlug(task), // Unique slug for each task score: scoreProjectTaskDuration(duration, maxDuration), value: duration, - displayValue: `${duration.toFixed(2)} ms`, + displayValue: formatDuration(duration), details: {} })); }