summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_html_dashboard.sh
diff options
context:
space:
mode:
authorValerie R Young <spectranaut@riseup.net>2016-11-08 15:54:54 -0500
committerHolger Levsen <holger@layer-acht.org>2016-11-08 22:03:24 +0100
commit8a8db27fafce64c38ba916931fceca7921e9d322 (patch)
treeb87b55b59d77d5a0abdd44c101b473843af11218 /bin/reproducible_html_dashboard.sh
parent484af0d4fca2889e3e790e8e6cac53520a79463f (diff)
downloadjenkins.debian.net-8a8db27fafce64c38ba916931fceca7921e9d322.tar.xz
reproducible Debian: fix index_performance page error
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin/reproducible_html_dashboard.sh')
-rwxr-xr-xbin/reproducible_html_dashboard.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/reproducible_html_dashboard.sh b/bin/reproducible_html_dashboard.sh
index dcabec14..7132aa64 100755
--- a/bin/reproducible_html_dashboard.sh
+++ b/bin/reproducible_html_dashboard.sh
@@ -301,7 +301,7 @@ write_build_performance_stats() {
done
write_page "</tr><tr><td class=\"left\">average test duration (on $DATE)</td>"
for ARCH in ${ARCHS} ; do
- RESULT=$(query_db "SELECT CAST(AVG(r.build_duration) AS INTEGER) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE r.build_duration!='' AND r.build_duration!='0' AND r.build_date LIKE '%$DATE%' AND s.architecture='$ARCH'")
+ RESULT=$(query_db "SELECT COALESCE(CAST(AVG(r.build_duration) AS INTEGER), 0) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE r.build_duration!='' AND r.build_duration!='0' AND r.build_date LIKE '%$DATE%' AND s.architecture='$ARCH'")
MIN=$(echo $RESULT/60|bc)
SEC=$(echo "$RESULT-($MIN*60)"|bc)
write_page "<td>$MIN minutes, $SEC seconds</td>"
@@ -309,15 +309,18 @@ write_build_performance_stats() {
local TIMESPAN_VERBOSE="4 weeks"
local TIMESPAN_RAW="28"
# Find stats for 28 days since yesterday, no stats exist for today
+
local TIMESPAN="$(echo $TIMESPAN_RAW-1|bc)"
- local TIMESPAN_DATE=$(date '+%Y-%m-%d %H:%M' -d "$TIMESPAN days")
+ local TIMESPAN_DATE=$(date '+%Y-%m-%d %H:%M' -d "- $TIMESPAN days")
+
write_page "</tr><tr><td class=\"left\">average test duration (in the last $TIMESPAN_VERBOSE)</td>"
for ARCH in ${ARCHS} ; do
- RESULT=$(query_db "SELECT CAST(AVG(r.build_duration) AS INTEGER) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE r.build_duration!='' AND r.build_duration!='0' AND r.build_date > '$TIMESPAN_DATE' AND s.architecture='$ARCH'")
+ RESULT=$(query_db "SELECT COALESCE(CAST(AVG(r.build_duration) AS INTEGER), 0) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE r.build_duration!='' AND r.build_duration!='0' AND r.build_date > '$TIMESPAN_DATE' AND s.architecture='$ARCH'")
MIN=$(echo $RESULT/60|bc)
SEC=$(echo "$RESULT-($MIN*60)"|bc)
write_page "<td>$MIN minutes, $SEC seconds</td>"
done
+
write_page "</tr><tr><td class=\"left\">packages tested on $DATE</td>"
for ARCH in ${ARCHS} ; do
RESULT=$(query_db "SELECT COUNT(r.build_date) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE r.build_date LIKE '%$DATE%' AND s.architecture='$ARCH'")
@@ -338,7 +341,7 @@ write_build_performance_stats() {
local TIMESPAN_RAW="91"
# Find stats for 91 days since yesterday, no stats exist for today
local TIMESPAN="$(echo $TIMESPAN_RAW-1|bc)"
- local TIMESPAN_DATE=$(date '+%Y-%m-%d %H:%M' -d "$TIMESPAN days")
+ local TIMESPAN_DATE=$(date '+%Y-%m-%d %H:%M' -d "- $TIMESPAN days")
write_page "</tr><tr><td class=\"left\">packages tested on average per day in the last $TIMESPAN_VERBOSE</td>"
for ARCH in ${ARCHS} ; do
RESULT=$(query_db "SELECT COUNT(r.build_date) FROM stats_build AS r WHERE r.build_date > '$TIMESPAN_DATE' AND r.architecture='$ARCH'")