Commit be6a4e80 by Peter Holmberg Committed by GitHub

Metrics: Add metric for each package build time (#20566)

* add loop to get invdividual packages build time

* run only on master
parent d9abf01c
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck source=./scripts/helpers/exit-if-fail.sh
source "$(dirname "$0")/helpers/exit-if-fail.sh"
function parse_git_hash() { function parse_git_hash() {
git rev-parse --short HEAD 2> /dev/null | sed "s/\(.*\)/\1/" git rev-parse --short HEAD 2> /dev/null | sed "s/\(.*\)/\1/"
} }
...@@ -48,7 +51,16 @@ else ...@@ -48,7 +51,16 @@ else
echo $'\nBuilding packages' echo $'\nBuilding packages'
yarn packages:build
for PACKAGE in ui data toolkit runtime
do
start=$(date +%s%N)
yarn workspace @grafana/$PACKAGE run build
runtime=$((($(date +%s%N) - start)/1000000))
if [ "${CIRCLE_BRANCH}" == "master" ]; then
exit_if_fail ./ci-metrics-publisher.sh "grafana.ci-buildtimes.$CIRCLE_JOB.$PACKAGE=$runtime"
fi
done
exit_status=$? exit_status=$?
if [ $exit_status -eq 1 ]; then if [ $exit_status -eq 1 ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment