From df67dfc9bd3fc91c5c0056ee3f5b7fd1678174f1 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 3 Aug 2017 11:24:55 +0200 Subject: bin/build-master-status: truncate statistics to fixed time periode instead of fixed number of lines --- bin/build-master-status | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/build-master-status b/bin/build-master-status index 4ff3ed3..6601260 100755 --- a/bin/build-master-status +++ b/bin/build-master-status @@ -158,6 +158,7 @@ fi if ${web}; then sed -i 's|$|
|' "${tmp_dir}/build-master-status.html" + end=$(($(date +%s)-7*24*60*60)) ( [ -f "${webserver_directory}/statistics" ] && \ cat "${webserver_directory}/statistics" @@ -174,8 +175,14 @@ if ${web}; then "${locked}" \ "${blocked}" | \ sed 's| $|\n|' + echo "${end}" ) | \ - tail -n 10080 > \ + sort -k1nr,1 | \ + sed -n " + /^${end}\$/q + p + " | \ + tac > \ "${tmp_dir}/statistics" printf '\n\nbuild logs
\n\n' >> \ -- cgit v1.2.3-70-g09d2