File tree 2 files changed +31
-62
lines changed
2 files changed +31
-62
lines changed Original file line number Diff line number Diff line change
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
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments