aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgo2
-rw-r--r--scripts/steuermann_report.cgi17
-rw-r--r--steuermann/db.sql3
3 files changed, 17 insertions, 5 deletions
diff --git a/go b/go
index 1ae4382..328c5e1 100755
--- a/go
+++ b/go
@@ -1,6 +1,6 @@
#!/bin/sh
-n=15
+n=16
rm -rf build
diff --git a/scripts/steuermann_report.cgi b/scripts/steuermann_report.cgi
index e3bcf5e..c05b030 100644
--- a/scripts/steuermann_report.cgi
+++ b/scripts/steuermann_report.cgi
@@ -178,13 +178,24 @@ elif action == 'runs' :
elif x == 'time_desc' :
order ='create_time DESC'
- c.execute('SELECT DISTINCT run, create_time FROM sm_runs ORDER BY %s'%order)
+ c.execute('SELECT run, create_time, errors FROM sm_runs ORDER BY %s'%order)
print "<table>"
- for run, create_time in c :
+ for run, create_time, errors in c :
+ if errors is None :
+ c2 = db.cursor()
+ c2.execute("select count(*) from sm_status where run = ? and status > '0' and status < 'A'", (run,))
+ errors = c2.fetchone()
+ errors = errors[0]
+ # I was thinking of caching the computed value back into
+ # the sm_runs table and then invalidating it any time we add
+ # to the sm_status, but it is so fast that I don't need that
+ # optimization right now.
print "<tr>"
print "<td>"
print "<a href=%s?action=status&run=%s>%s</a>"%(cginame, run, run)
- print "</td><td>"
+ print "</td>"
+ print "<td>%s</td>"%errors
+ print "<td>"
if permission_modify :
print "<a href=%s?action=delete&run=%s>delete</a>"%(cginame, run)
print "</td>"
diff --git a/steuermann/db.sql b/steuermann/db.sql
index bc35f62..919ab6a 100644
--- a/steuermann/db.sql
+++ b/steuermann/db.sql
@@ -46,7 +46,8 @@ create unique index sm_status_idx1 on sm_status ( run, host, tablename, cmd );
-- table lists all run names in the system
CREATE TABLE sm_runs (
run VARCHAR(100),
- create_time VARCHAR(26)
+ create_time VARCHAR(26),
+ errors int
);
CREATE UNIQUE INDEX sm_runs_idx1 ON sm_runs(run);