better detection of duration

This commit is contained in:
BodoBolero
2024-11-08 15:46:21 +01:00
parent 9710169ed4
commit eb8a9a12da

View File

@@ -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());