Skip to content

test: add a dev-util script for looking at slow TAV jobs in CI #3267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions dev-utils/ci-tav-slow-jobs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
#
# List the jobs for the latest "TAV" workflow run in GH Actions, **sorted by
# slowest last**. This is used for finding very slow build steps as candidates
# for improvement.
#
# Usage:
# ./dev-utils/ci-tav-slow-jobs.sh
#
# The columns are:
# 1. duration in seconds
# 2. duration in "NNmNNs"
# 3. the job name

if [ "$TRACE" != "" ]; then
export PS4='${BASH_SOURCE}:${LINENO}: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
set -o xtrace
fi
set -o errexit
set -o pipefail

branch=main
branch=test/action-tav
latestTavRun=$(gh run list -R elastic/apm-agent-nodejs -b "$branch" -w TAV -L 1 --json databaseId --jq '.[].databaseId')
gh api --paginate repos/elastic/apm-agent-nodejs/actions/runs/$latestTavRun/jobs \
| json -ga jobs \
| json -ga -e '
this.s = (new Date(this.completed_at) - new Date(this.started_at)) / 1000;
this.minSec = Math.floor(this.s/60) + "m" + (this.s%60).toString().padStart(2,"0") + "s"
' s minSec name \
| sort -n
62 changes: 0 additions & 62 deletions dev-utils/jenkins-build-slow-steps.sh

This file was deleted.