Skip to content

Commit

Permalink
Fix waittime metric for rebuilds
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoWilken committed Nov 29, 2023
1 parent 679ff71 commit bc5acf2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ci/build-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,21 @@ function report_state () {
pr_processing_done) prtime=$((time_now - TIME_PR_STARTED));;
esac

# If this is a rebuild, the last push time is mostly meaningless -- the PR
# hasn't been waiting since then for a check.
local waittime=
if [ -n "$LAST_PUSH_TIME" ] && [ "$BUILD_TYPE" != untested ]; then
waittime=$((time_now - LAST_PUSH_TIME))
fi

# Push to InfluxDB if configured
influxdb_push prcheck "repo=$PR_REPO" "checkname=$CHECK_NAME" \
"worker=$CHECK_NAME/$WORKER_INDEX/$WORKERS_POOL_SIZE" \
${NUM_BASE_COMMITS:+"num_base_commits=$NUM_BASE_COMMITS"} \
"prev_build=$BUILD_TYPE" \
-- "host=\"$(hostname -s)\"" "state=\"$current_state\"" \
"prid=\"$PR_NUMBER\"" ${prtime:+prtime=$prtime} ${PR_OK:+prok=$PR_OK} \
${LAST_PUSH_TIME:+waittime=$((time_now - LAST_PUSH_TIME))} \
${waittime:+"waittime=$waittime"} \
${HAVE_JALIEN_TOKEN:+have_jalien_token=$HAVE_JALIEN_TOKEN}

# Push to Google Analytics if configured
Expand Down

0 comments on commit bc5acf2

Please sign in to comment.