Skip to content

Commit

Permalink
use awk to parse text columns instead of cut (paritytech#905)
Browse files Browse the repository at this point in the history
  • Loading branch information
radupopa2010 authored Oct 18, 2022
1 parent 708fded commit b9773cc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/ci/push_bench_results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ INPUT="output_redacted.txt"

while IFS= read -r line
do
BENCH_NAME=$(echo "${line}" | cut -f 2 -d ' ')
BENCH_RESULT=$(echo "${line}" | cut -f 5 -d ' ')
BENCH_NAME=$(awk '{ print $2 }' <<< "${line}")
BENCH_RESULT=$(awk '{ print $5 }' <<< "${line}")

# send metric with common results
echo 'parity_benchmark_common_result_ns{project="'${CI_PROJECT_NAME}'",benchmark="'${BENCH_NAME}'"} '${BENCH_RESULT}''
echo 'parity_benchmark_common_result_ns{project="'${CI_PROJECT_NAME}'",benchmark="'${BENCH_NAME}'"} '${BENCH_RESULT}'' \
| curl --data-binary @- "https://pushgateway.parity-build.parity.io/metrics/job/${BENCH_NAME}"

# send metric with detailed results
echo 'parity_benchmark_specific_result_ns{project="'${CI_PROJECT_NAME}'",benchmark="'${BENCH_NAME}'",commit="'${CI_COMMIT_SHORT_SHA}'",cirunner="'${RUNNER_NAME}'"} '${BENCH_RESULT}''
echo 'parity_benchmark_specific_result_ns{project="'${CI_PROJECT_NAME}'",benchmark="'${BENCH_NAME}'",commit="'${CI_COMMIT_SHORT_SHA}'",cirunner="'${RUNNER_NAME}'"} '${BENCH_RESULT}'' \
| curl --data-binary @- "https://pushgateway.parity-build.parity.io/metrics/job/${BENCH_NAME}"

Expand Down

0 comments on commit b9773cc

Please sign in to comment.