From e02c6fb241207dd30fef8f344a2df7574ee3db6a Mon Sep 17 00:00:00 2001 From: Aparna Ravindra <82894348+aparna-ravindra@users.noreply.github.com> Date: Wed, 28 Jul 2021 07:46:24 +0530 Subject: [PATCH] adding performance measure --- script/validate-data/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/validate-data/index.ts b/script/validate-data/index.ts index 81048f8..cecaf6b 100755 --- a/script/validate-data/index.ts +++ b/script/validate-data/index.ts @@ -4,6 +4,7 @@ import { safeLoad } from "js-yaml"; import { basename, extname, join } from "path"; import { Validator as validator } from "jsonschema"; import { endGroup, error, info, setFailed, startGroup } from '@actions/core'; +import { performance } from 'perf_hooks'; interface WorkflowWithErrors { id: string; @@ -98,9 +99,12 @@ async function checkWorkflow(workflowPath: string, propertiesPath: string): Prom (async function main() { try { const settings = require("./settings.json"); + var t0 = performance.now() const erroredWorkflows = await checkWorkflows( settings.folders ) + var t1 = performance.now() + info("Call to checkWorkflows took " + (t1 - t0) + " milliseconds.") if (erroredWorkflows.length > 0) { startGroup(`😟 - Found ${erroredWorkflows.length} workflows with errors:`);