9 for line
in open (sys
.argv
[1]):
10 match
= re
.match ('^\[.+\] (.+) service started \((\w+), ([0-9\.]+)s\)',
13 type = match
.group (1)
16 times
[type].append ((match
.group (2), float (match
.group (3))))
18 for k
, v
in times
.iteritems ():
20 print '%s Services:\n' % k
21 v
.sort (lambda a
, b
: -cmp (a
[1], b
[1]))
22 for service
, time
in v
:
23 set_total
= set_total
+ time
24 print '\t%.8f\t%s' % (time
, service
)
25 print '\t----------\t-----'
26 print '\t%.8f\tTotal\n' % set_total
27 grand_total
= grand_total
+ set_total
29 print '\n\t%.8f\tGrand Total' % grand_total