1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 19:01:15 +01:00

iozone: Whitespace cleanup

Cleanup whitespace and reorganize code.

Signed-off-by: Lisa Nguyen <lisa.nguyen@linaro.org>
This commit is contained in:
Lisa Nguyen 2015-10-01 11:52:51 -07:00
parent 8e84e4a230
commit 361f1a0f0c

View File

@ -15,11 +15,11 @@
from wlauto import Workload, Parameter, Executable from wlauto import Workload, Parameter, Executable
from wlauto.exceptions import ConfigError from wlauto.exceptions import ConfigError
from wlauto.utils.types import list_of_ints from wlauto.utils.types import list_of_ints
from collections import OrderedDict
from itertools import izip_longest
import os import os
import re import re
import csv import csv
from collections import OrderedDict
from itertools import izip_longest
iozone_results_txt = 'iozone_results.txt' iozone_results_txt = 'iozone_results.txt'
@ -74,7 +74,7 @@ class Iozone(Workload):
Measure performance of writing a file using the Measure performance of writing a file using the
the library function fwrite() that performs the library function fwrite() that performs
buffered and blocked write operations. buffered and blocked write operations.
`
11 - Fread Test 11 - Fread Test
Measure performance of reading a file using the Measure performance of reading a file using the
library function fread() that performs buffered library function fread() that performs buffered
@ -156,8 +156,7 @@ class Iozone(Workload):
if match: if match:
self.user_file = match.group(1) self.user_file = match.group(1)
self.device_output_file = os.path.join(self.device.working_directory, self.device_output_file = os.path.join(self.device.working_directory,
self.user_file) self.user_file)
return iozone_command return iozone_command
@ -250,19 +249,20 @@ class Iozone(Workload):
record_sizes = reports[1] record_sizes = reports[1]
values = reports[2:] values = reports[2:]
for data in values: for v in values:
temp = OrderedDict(izip_longest(record_sizes, data)) templist = OrderedDict(izip_longest(record_sizes, v))
for reclen,value in temp.items(): for reclen,value in templist.items():
if reclen is '0': if reclen is '0':
fs = value fs = value
if value is None: if value is None:
value = '0' value = '0'
classifier = {'reclen': reclen, 'file_size': fs} classifiers = {'reclen': reclen, 'file_size': fs}
if reclen != '0': if reclen != '0':
context.add_metric(report_name, int(value), 'kb/s', classifiers=classifier) context.add_metric(report_name, int(value), 'kb/s',
classifiers=classifiers)
# parse thread-mode results # parse thread-mode results
def parse_thread_results(self): def parse_thread_results(self):