From 39bac6624a66fadbc2ad17862cf56fa19423db2c Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 6 Jan 2016 21:09:39 +0100 Subject: reproducible: include node performance stats in job output --- bin/reproducible_nodes_info.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'bin/reproducible_nodes_info.sh') diff --git a/bin/reproducible_nodes_info.sh b/bin/reproducible_nodes_info.sh index 4015b6e2..3e419a00 100755 --- a/bin/reproducible_nodes_info.sh +++ b/bin/reproducible_nodes_info.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright © 2015 Holger Levsen +# Copyright © 2015-2016 Holger Levsen # released under the GPLv=2 DEBUG=false @@ -15,6 +15,7 @@ mkdir -p $TARGET_DIR TMPFILE_SRC=$(mktemp) TMPFILE_NODE=$(mktemp) +echo "$(date -u) - Collecting information from nodes" for NODE in $BUILD_NODES jenkins.debian.net ; do if [ "$NODE" = "jenkins.debian.net" ] ; then echo "$(date -u) - Trying to update $TARGET_DIR/$NODE." @@ -42,4 +43,21 @@ for NODE in $BUILD_NODES jenkins.debian.net ; do fi rm -f $TMPFILE_SRC $TMPFILE_NODE done +echo + +echo "$(date -u) - Showing nodes performances:" +TMPFILE1=$(mktemp) +TMPFILE2=$(mktemp) +for i in $BUILD_NODES ; do + sqlite3 -init $INIT ${PACKAGES_DB} \ + "SELECT build_date FROM stats_build AS r WHERE r.node1=\"$i\" or r.node2=\"$i\"" > $TMPFILE1 2>/dev/null + j=$(wc -l $TMPFILE1|cut -d " " -f1) + k=$(cat $TMPFILE1|cut -d " " -f1|sort -u|wc -l) + l=$(echo "scale=1 ; ($j/$k)" | bc) + echo "$l builds/day ($j/$k) on $i" >> $TMPFILE2 +done +rm $TMPFILE1 >/dev/null +sort -g -r $TMPFILE2 +rm $TMPFILE2 >/dev/null +echo -- cgit v1.2.3-70-g09d2