File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ def run(args):
18
18
header = None
19
19
header_row = None
20
20
data_row = None
21
+ data_row_buffer = []
21
22
22
23
def show ():
23
24
if header_row :
@@ -27,6 +28,7 @@ def show():
27
28
assert header == header_row
28
29
if data_row is not None :
29
30
print ("," .join (data_row ))
31
+ data_row_buffer .append (data_row )
30
32
return header_row
31
33
32
34
for line in log_lines :
@@ -41,13 +43,24 @@ def show():
41
43
assert len (flds ) == 2
42
44
header_row .append ("calls" )
43
45
data_row .append (flds [0 ])
46
+ header_row .append ("up" )
47
+ data_row .append ("1.000" )
44
48
elif line [2 :].startswith (ratx ):
45
49
flds = line .split ()
46
50
assert len (flds ) == 4
47
51
header_row .append (line [:2 ])
48
52
data_row .append (flds [2 ])
49
53
show ()
50
54
55
+ print ("Scaled to last column:" )
56
+ print ("," .join (header_row ))
57
+ for data_row in data_row_buffer :
58
+ data_row_rescaled = data_row [:2 ]
59
+ unit = float (data_row [- 1 ])
60
+ for fld in data_row [2 :]:
61
+ data_row_rescaled .append ("%.3f" % (float (fld ) / unit ))
62
+ print ("," .join (data_row_rescaled ))
63
+
51
64
52
65
if __name__ == "__main__" :
53
66
run (args = sys .argv [1 :])
You can’t perform that action at this time.
0 commit comments