projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
zbd: Fix partition block device handling
[fio.git]
/
tools
/
fiologparser.py
diff --git
a/tools/fiologparser.py
b/tools/fiologparser.py
index 685f4194aadfe85b65210055a4e446c436997d38..cc29f1c7bcbf5dea4bc73a0ce8ab7cb95a00c6ae 100755
(executable)
--- a/
tools/fiologparser.py
+++ b/
tools/fiologparser.py
@@
-1,4
+1,5
@@
-#!/usr/bin/python
+#!/usr/bin/python2.7
+# Note: this script is python2 and python 3 compatible.
#
# fiologparser.py
#
#
# fiologparser.py
#
@@
-13,6
+14,8
@@
#
# to see per-interval average completion latency.
#
# to see per-interval average completion latency.
+from __future__ import absolute_import
+from __future__ import print_function
import argparse
import math
import argparse
import math
@@
-45,7
+48,7
@@
def print_full(ctx, series):
while (start < ftime):
end = ftime if ftime < end else end
results = [ts.get_value(start, end) for ts in series]
while (start < ftime):
end = ftime if ftime < end else end
results = [ts.get_value(start, end) for ts in series]
- print
"%s, %s" % (end, ', '.join(["%0.3f" % i for i in results]
))
+ print
("%s, %s" % (end, ', '.join(["%0.3f" % i for i in results])
))
start += ctx.interval
end += ctx.interval
start += ctx.interval
end += ctx.interval
@@
-57,7
+60,7
@@
def print_sums(ctx, series):
while (start < ftime):
end = ftime if ftime < end else end
results = [ts.get_value(start, end) for ts in series]
while (start < ftime):
end = ftime if ftime < end else end
results = [ts.get_value(start, end) for ts in series]
- print
"%s, %0.3f" % (end, sum(results
))
+ print
("%s, %0.3f" % (end, sum(results)
))
start += ctx.interval
end += ctx.interval
start += ctx.interval
end += ctx.interval
@@
-69,7
+72,7
@@
def print_averages(ctx, series):
while (start < ftime):
end = ftime if ftime < end else end
results = [ts.get_value(start, end) for ts in series]
while (start < ftime):
end = ftime if ftime < end else end
results = [ts.get_value(start, end) for ts in series]
- print
"%s, %0.3f" % (end, float(sum(results))/len(results
))
+ print
("%s, %0.3f" % (end, float(sum(results))/len(results)
))
start += ctx.interval
end += ctx.interval
start += ctx.interval
end += ctx.interval
@@
-147,11
+150,11
@@
def print_default(ctx, series):
end += ctx.interval
total = 0
end += ctx.interval
total = 0
- for i in
x
range(0, len(averages)):
+ for i in range(0, len(averages)):
total += averages[i]*weights[i]
total += averages[i]*weights[i]
- print
'%0.3f' % (total/sum(weights
))
+ print
('%0.3f' % (total/sum(weights)
))
-class TimeSeries():
+class TimeSeries(
object
):
def __init__(self, ctx, fn):
self.ctx = ctx
self.last = None
def __init__(self, ctx, fn):
self.ctx = ctx
self.last = None
@@
-185,7
+188,7
@@
class TimeSeries():
value += sample.get_contribution(start, end)
return value
value += sample.get_contribution(start, end)
return value
-class Sample():
+class Sample(
object
):
def __init__(self, ctx, start, end, value):
self.ctx = ctx
self.start = start
def __init__(self, ctx, start, end, value):
self.ctx = ctx
self.start = start
@@
-218,4
+221,3
@@
if __name__ == '__main__':
print_all_stats(ctx, series)
else:
print_default(ctx, series)
print_all_stats(ctx, series)
else:
print_default(ctx, series)
-