From e0af3d35bdabdf00311ae277dbd3cacf87454c9f Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Fri, 15 Jan 2016 21:29:25 -0800 Subject: [PATCH] build-ceph.sh: track and report total runtime Signed-off-by: Dan Mick --- build-ceph.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build-ceph.sh b/build-ceph.sh index 1345b0f..9bad6fe 100755 --- a/build-ceph.sh +++ b/build-ceph.sh @@ -1,6 +1,12 @@ #!/bin/bash -x set -e +SECONDS=0 + +function print_runtime() { + printf "Total run time: %d:%02d\n" $((SECONDS / 60 )) $((SECONDS % 60)) +} + git submodule foreach 'git clean -fdx && git reset --hard' rm -rf ceph-object-corpus rm -rf ceph-erasure-code-corpus @@ -89,7 +95,7 @@ make -j$(get_processors) "$@" || exit 4 # run "make check", but give it a time limit in case a test gets stuck -trap "pkill -9 ceph-osd || true ; pkill -9 ceph-mon || true" EXIT +trap "pkill -9 ceph-osd || true ; pkill -9 ceph-mon || true; print_runtime" EXIT if ! ../maxtime 5400 make $(maybe_parallel_make_check) check "$@" ; then display_failures . -- 2.39.5