From eb8a9a12daf6b64054a153ffcc99e64d8e690708 Mon Sep 17 00:00:00 2001 From: BodoBolero Date: Fri, 8 Nov 2024 15:46:21 +0100 Subject: [PATCH] better detection of duration --- .github/workflows/benchmarking.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/benchmarking.yml b/.github/workflows/benchmarking.yml index 5552f43548..c3798843fb 100644 --- a/.github/workflows/benchmarking.yml +++ b/.github/workflows/benchmarking.yml @@ -330,7 +330,8 @@ jobs: # If a metric was matched, insert it into the performance database if [ ! -z "$METRIC_NAME" ]; then - METRIC_VALUE=$(convert_to_seconds "$(echo $line | awk '{print $3}')") + DURATION=$(echo "$line" | grep -oP '\d+h\d+m|\d+s|\d+ms|\d{1,2}h\d{1,2}m|\d+\.\d+s' | head -n 1) + METRIC_VALUE=$(convert_to_seconds "$DURATION") PSQL_CMD="${PSQL} \"${PERF_TEST_RESULT_CONNSTR}\" -c \" INSERT INTO public.perf_test_results (suit, revision, platform, metric_name, metric_value, metric_unit, metric_report_type, recorded_at_timestamp) VALUES ('${SUIT}', '${COMMIT_HASH}', '${PLATFORM}', '${METRIC_NAME}', ${METRIC_VALUE}, 'seconds', 'lower_is_better', now());