Skip to content

Commit 33410e6

Browse files
authored
test: add a dev-util script for looking at slow TAV jobs in CI (#3267)
This replaces a similar script used for when CI was in Jenkins. Refs: #3227
1 parent e9ef99e commit 33410e6

File tree

2 files changed

+31
-62
lines changed

2 files changed

+31
-62
lines changed

dev-utils/ci-tav-slow-jobs.sh

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
#
3+
# List the jobs for the latest "TAV" workflow run in GH Actions, **sorted by
4+
# slowest last**. This is used for finding very slow build steps as candidates
5+
# for improvement.
6+
#
7+
# Usage:
8+
# ./dev-utils/ci-tav-slow-jobs.sh
9+
#
10+
# The columns are:
11+
# 1. duration in seconds
12+
# 2. duration in "NNmNNs"
13+
# 3. the job name
14+
15+
if [ "$TRACE" != "" ]; then
16+
export PS4='${BASH_SOURCE}:${LINENO}: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
17+
set -o xtrace
18+
fi
19+
set -o errexit
20+
set -o pipefail
21+
22+
branch=main
23+
branch=test/action-tav
24+
latestTavRun=$(gh run list -R elastic/apm-agent-nodejs -b "$branch" -w TAV -L 1 --json databaseId --jq '.[].databaseId')
25+
gh api --paginate repos/elastic/apm-agent-nodejs/actions/runs/$latestTavRun/jobs \
26+
| json -ga jobs \
27+
| json -ga -e '
28+
this.s = (new Date(this.completed_at) - new Date(this.started_at)) / 1000;
29+
this.minSec = Math.floor(this.s/60) + "m" + (this.s%60).toString().padStart(2,"0") + "s"
30+
' s minSec name \
31+
| sort -n

dev-utils/jenkins-build-slow-steps.sh

-62
This file was deleted.

0 commit comments

Comments
 (0)