From 5e10403531530d480cc2327704b1b217765e8823 Mon Sep 17 00:00:00 2001 From: Alexandre Gobbo Date: Tue, 2 Apr 2019 13:47:24 +0200 Subject: [PATCH] Script execution --- script/statistics.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/script/statistics.py b/script/statistics.py index 8dfc4eb..ce294c5 100644 --- a/script/statistics.py +++ b/script/statistics.py @@ -92,15 +92,13 @@ def get_commands(commands =None, start = None, end = None): def print_cmd_stats(command = "%", start = None, end = None): print "-----------------------------------------------------------" print "Statistics from ", start , " to ", end - print "Command: " , command (s,a,e) = get_cmd_stats(command, start, end) t=s+a+e #get_count(command, start, end, "%") - if t==0: - print "No records" - else: - 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)) + print "Command: " , command , " Records: ", t + if t>0: + print "%-10s %7.2f%% - %d" % ("Success", (float(s)/t) * 100, s) + print "%-10s %7.2f%% - %d" % ("Abort", (float(a)/t) * 100, a) + print "%-10s %7.2f%% - %d" % ("Error", (float(e)/t) * 100, e) print "\nErrors:" print "%5s %s" % ("Count", "Error")