Commit e2120984 authored by Paul's avatar Paul
Browse files

Format

parent efbe9607
...@@ -17,6 +17,7 @@ def tmp_file(dump=None): ...@@ -17,6 +17,7 @@ def tmp_file(dump=None):
def pretty_print(obj): def pretty_print(obj):
print(json.dumps(obj, indent=2)) print(json.dumps(obj, indent=2))
def run_driver(b): def run_driver(b):
print(b) print(b)
with tmp_file(lambda tf: json.dump(b, tf)) as tf: with tmp_file(lambda tf: json.dump(b, tf)) as tf:
...@@ -31,13 +32,16 @@ def run_driver(b): ...@@ -31,13 +32,16 @@ def run_driver(b):
continue continue
yield s.split(']: ')[1].strip() yield s.split(']: ')[1].strip()
def convert_to_float(s): def convert_to_float(s):
return s[:-2] return s[:-2]
def get_device_time(s): def get_device_time(s):
fields = s.split(',') fields = s.split(',')
return convert_to_float(fields[-1].strip()) return convert_to_float(fields[-1].strip())
def benchmark_ck(config, tuning): def benchmark_ck(config, tuning):
b = { b = {
'settings': { 'settings': {
...@@ -70,6 +74,7 @@ def parse_log(f): ...@@ -70,6 +74,7 @@ def parse_log(f):
config = json.loads(line) config = json.loads(line)
yield config yield config
def benchmark_log(f): def benchmark_log(f):
result = [] result = []
for config in parse_log(f): for config in parse_log(f):
......
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