From fbca1279e2e56e71b7aa9a15a285e26375ed400a Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Fri, 17 May 2013 16:29:26 +0200 Subject: [PATCH] Adding exit code stats --- paralleljobs.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/paralleljobs.py b/paralleljobs.py index 890ff35..5c309cd 100755 --- a/paralleljobs.py +++ b/paralleljobs.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ A simple tool to run jobs from a database in parallel.""" __author__ = "Stefan Huber" @@ -34,7 +34,6 @@ def printStatusInfo(conn): c.execute("SELECT sum(workloadestm) FROM jobs;") wltotal, = c.fetchone() - c.close() perdone = 0 perwl = 0 @@ -46,6 +45,13 @@ def printStatusInfo(conn): print("%d (%.1f%%) of %d jobs and %.1f%% of the workload done. %d jobs are running." % \ (nodone, perdone, nototal, perwl, nostarted-nodone)) + print("Exit code stats:") + c.execute("SELECT exitcode, count(exitcode) AS cnt FROM jobs GROUP BY exitcode ORDER BY exitcode ASC;") + for code, cnt in c.fetchall(): + print(" %3s: %6s (%5.1f%%)" % (code, cnt, 100.0*float(cnt)/nodone)) + + c.close() + def createPropertiesTable(conn, propdef): conn.execute("BEGIN EXCLUSIVE") -- 2.30.2