adding performance measure
This commit is contained in:
@@ -4,6 +4,7 @@ import { safeLoad } from "js-yaml";
|
|||||||
import { basename, extname, join } from "path";
|
import { basename, extname, join } from "path";
|
||||||
import { Validator as validator } from "jsonschema";
|
import { Validator as validator } from "jsonschema";
|
||||||
import { endGroup, error, info, setFailed, startGroup } from '@actions/core';
|
import { endGroup, error, info, setFailed, startGroup } from '@actions/core';
|
||||||
|
import { performance } from 'perf_hooks';
|
||||||
|
|
||||||
interface WorkflowWithErrors {
|
interface WorkflowWithErrors {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -98,9 +99,12 @@ async function checkWorkflow(workflowPath: string, propertiesPath: string): Prom
|
|||||||
(async function main() {
|
(async function main() {
|
||||||
try {
|
try {
|
||||||
const settings = require("./settings.json");
|
const settings = require("./settings.json");
|
||||||
|
var t0 = performance.now()
|
||||||
const erroredWorkflows = await checkWorkflows(
|
const erroredWorkflows = await checkWorkflows(
|
||||||
settings.folders
|
settings.folders
|
||||||
)
|
)
|
||||||
|
var t1 = performance.now()
|
||||||
|
info("Call to checkWorkflows took " + (t1 - t0) + " milliseconds.")
|
||||||
|
|
||||||
if (erroredWorkflows.length > 0) {
|
if (erroredWorkflows.length > 0) {
|
||||||
startGroup(`😟 - Found ${erroredWorkflows.length} workflows with errors:`);
|
startGroup(`😟 - Found ${erroredWorkflows.length} workflows with errors:`);
|
||||||
|
|||||||
Reference in New Issue
Block a user