From 702c908ae82c337cb689ec30cdddd0398acb05f7 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 31 May 2023 09:42:44 +0100 Subject: [PATCH 1/3] remove logging --- packages/server/src/threads/automation.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts index 563af93303..ed16b27197 100644 --- a/packages/server/src/threads/automation.ts +++ b/packages/server/src/threads/automation.ts @@ -252,7 +252,6 @@ class Orchestrator { return } } - const start = performance.now() for (let step of automation.definition.steps) { if (timeoutFlag) { break @@ -474,11 +473,6 @@ class Orchestrator { } } - const end = performance.now() - const executionTime = end - start - - console.log(`Execution time: ${executionTime} milliseconds`) - // store the logs for the automation run try { await storeLog(this._automation, this.executionOutput) From 162ea5d969ef48585fdfa07125a2cba687fbd404 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 31 May 2023 10:51:54 +0100 Subject: [PATCH 2/3] update log formatting --- packages/server/src/threads/automation.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts index ed16b27197..17afa3d54e 100644 --- a/packages/server/src/threads/automation.ts +++ b/packages/server/src/threads/automation.ts @@ -252,6 +252,7 @@ class Orchestrator { return } } + const start = performance.now() for (let step of automation.definition.steps) { if (timeoutFlag) { break @@ -473,6 +474,14 @@ class Orchestrator { } } + const end = performance.now() + const executionTime = end - start + + console.info(`Execution time: ${executionTime} milliseconds`, { + _logKey: "automation", + executionTime, + }) + // store the logs for the automation run try { await storeLog(this._automation, this.executionOutput) From c6d0da33f49058f2943c370abf7da61b2a264c54 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 31 May 2023 11:33:52 +0100 Subject: [PATCH 3/3] add import for performance lib --- packages/server/src/threads/automation.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts index 17afa3d54e..6ed8506b85 100644 --- a/packages/server/src/threads/automation.ts +++ b/packages/server/src/threads/automation.ts @@ -31,6 +31,7 @@ import { WorkerCallback } from "./definitions" import { context, logging } from "@budibase/backend-core" import { processObject } from "@budibase/string-templates" import { cloneDeep } from "lodash/fp" +import { performance } from "perf_hooks" import * as sdkUtils from "../sdk/utils" import env from "../environment" const FILTER_STEP_ID = actions.BUILTIN_ACTION_DEFINITIONS.FILTER.stepId