Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a summarize script for quickly analyzing the speed_test results
- Loading branch information
1 parent
e265aca
commit 6808c35
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,38 @@ | |||
#!/usr/bin/env python | |||
|
|||
import os, sys | |||
|
|||
names = set() | |||
for fname in os.listdir('dat/'): | |||
if fname.endswith('.dat'): | |||
names.add(fname.split('.')[0].split('-')[1]) | |||
|
|||
if len(sys.argv) > 1: | |||
names = set(sys.argv[1:]) | |||
|
|||
final = {} | |||
for name in names: | |||
data = {} | |||
with open('dat/128-%s.dat' % name) as f: | |||
lines = f.readlines() | |||
for line in lines: | |||
if line[0] == '#': | |||
continue | |||
line = line.split() | |||
if len(line) < 5: | |||
continue | |||
data[int(line[0])] = float(line[4]) | |||
if not data: | |||
continue | |||
final[name] = sum(data.values())/len(data) | |||
|
|||
items = [(t[1], t[0]) for t in final.items()] | |||
items.sort() | |||
hit1 = len(sys.argv) > 1 | |||
for v, name in items: | |||
if v >= 1.0 and not hit1: | |||
hit1 = True | |||
print '-'*72 | |||
print '%.0f%% %s' % (v*100, name) | |||
|
|||
|