From ecbebe7a1c49ebaa087f1e8be83b4f0e6ba3bf8b Mon Sep 17 00:00:00 2001 From: Thanassis Tsiodras Date: Mon, 29 Jul 2019 10:09:20 +0200 Subject: [PATCH] Report the time it takes for each command to execute. --- orchestrator/taste-orchestrator.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/orchestrator/taste-orchestrator.py b/orchestrator/taste-orchestrator.py index 4e89be8..db44a48 100644 --- a/orchestrator/taste-orchestrator.py +++ b/orchestrator/taste-orchestrator.py @@ -148,9 +148,12 @@ def mysystem(x, outputDir=None): g_log = open(outputDir + os.sep + "log.txt", "w") return g_log.write("From: " + os.getcwd() + "\n") - g_log.write(x + "\n") - g_log.flush() + startTime = time.time() while os.system(x) != 0: + deltaTime = 'Took %4.1f sec: ' % (time.time() - startTime) + g_log.write(deltaTime + x + "\n") + g_log.flush() + startTime = time.time() # Save the environment that was used for the failed command under OUTPUT_FOLDER/env.txt if g_absOutputDir != "": os.system('env > "' + g_absOutputDir + os.sep + 'env.txt"') @@ -169,6 +172,9 @@ def mysystem(x, outputDir=None): panic("\nFailed to compile...") else: panic("Failed while executing:\n" + x + "\nFrom this directory:\n" + os.getcwd()) + deltaTime = 'Took %4.1f sec: ' % (time.time() - startTime) + g_log.write(deltaTime + x + "\n") + g_log.flush() def getSingleLineFromCmdOutput(cmd): -- GitLab