Script execution

This commit is contained in:
2019-04-02 10:02:45 +02:00
parent 2ddce7abde
commit 5785d46782

View File

@@ -34,11 +34,30 @@ results = stmt.executeQuery("SELECT Command,Result,Start FROM . WHERE Result = '
while results.next():
print("Command= " + results.getString("Command") + " Result= " + results.getString("Result"))
def _get_count(sql):
ret = 0
results = stmt.executeQuery("SELECT COUNT(*) AS count FROM . WHERE " + sql)
if results.first():
ret = results.getInt("count")
return ret
def get_count(command, result):
return _get_count("Command LIKE '"+ command +"' AND Result = '"+ result +"'")
command = "*test1.py"
s = get_count(command, "success")
a = get_count(command, "abort")
e = get_count(command, "error")
t=s+a+e
print s, a, e
print "Success: ", ("%1.2f%% of %d" % ((float(s)/t) * 100, t))
print "Error: ", ("%1.2f%% of %d" % ((float(e)/t) * 100, t))
print "Abort: ", ("%1.2f%% of %d" % ((float(a)/t) * 100, t))
results = stmt.executeQuery("SELECT COUNT(Command) FROM . WHERE Result = 'success'")
while results.next():
#x=results
print results
#conn.close()