Commit e48ce2e2 authored by Adrien Di Mascio's avatar Adrien Di Mascio
Browse files

[exlog] print clocktime in addition to cputime

branch : stable
parent a7ea618e5478
......@@ -572,22 +572,25 @@ class ExamineLogCommand(Command):
req = requests.setdefault(rql, [])
chunks = time.split()
clocktime = float(chunks[0][1:])
cputime = float(chunks[-3])
req.append( cputime )
req.append( (clocktime, cputime) )
except Exception, exc:
sys.stderr.write('Line %s: %s (%s)\n' % (lineno, exc, line))
stat = []
for rql, times in requests.items():
stat.append( (sum(times), len(times), rql) )
stat.append( (sum(time[0] for time in times),
sum(time[1] for time in times),
len(times), rql) )
total_time = sum(time for time, occ, rql in stat)*0.01
print 'Percentage;Cumulative Time;Occurences;Query'
for time, occ, rql in stat:
print '%.2f;%.2f;%s;%s' % (time/total_time, time, occ, rql)
total_time = sum(clocktime for clocktime, cputime, occ, rql in stat)*0.01
print 'Percentage;Cumulative Time (clock);Cumulative Time (CPU);Occurences;Query'
for clocktime, cputime, occ, rql in stat:
print '%.2f;%.2f;%.2f;%s;%s' % (clocktime/total_time, clocktime, cputime, occ, rql)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment