]> git.apps.os.sepia.ceph.com Git - autobuild-ceph.git/commitdiff
build-ceph.sh: track and report total runtime
authorDan Mick <dan.mick@redhat.com>
Sat, 16 Jan 2016 05:29:25 +0000 (21:29 -0800)
committerDan Mick <dan.mick@redhat.com>
Sat, 16 Jan 2016 05:29:25 +0000 (21:29 -0800)
Signed-off-by: Dan Mick <dan.mick@redhat.com>
build-ceph.sh

index 1345b0f1e3c21bb192a07658a2c34be2b057a390..9bad6fe4485a0e1b50da22860834d7adb8e9d880 100755 (executable)
@@ -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 .