1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-03-22 02:29:10 +00: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'
@ -49,7 +49,7 @@ class Iozone(Workload):
4 - Random Read Test 4 - Random Read Test
Measure performance of reading a file by accessing Measure performance of reading a file by accessing
random locations within the file. random locations within the file.
5 - Random Write Test 5 - Random Write Test
Measure performance of writing a file by accessing Measure performance of writing a file by accessing
random locations within the file. random locations within the file.
@ -60,30 +60,30 @@ class Iozone(Workload):
7 - Record Rewrite Test 7 - Record Rewrite Test
Measure performance of writing and rewriting a Measure performance of writing and rewriting a
particular spot within the file. particular spot within the file.
8 - Strided Read Test 8 - Strided Read Test
Measure performance of reading a file with strided Measure performance of reading a file with strided
access behavior. access behavior.
9 - Fwrite Test 9 - Fwrite Test
Measure performance of writing a file using the Measure performance of writing a file using the
library function fwrite() that performances library function fwrite() that performances
buffered write operations. buffered write operations.
10 - Frewrite Test 10 - Frewrite Test
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
and blocked read operations. and blocked read operations.
12 - Freread Test 12 - Freread Test
Same as the Fread Test except the current file Same as the Fread Test except the current file
being read was read previously sometime in the being read was read previously sometime in the
past. past.
By default, iozone will run all tests in auto mode. To run By default, iozone will run all tests in auto mode. To run
specific tests, they must be written in the form of: specific tests, they must be written in the form of:
@ -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
@ -249,20 +248,21 @@ 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):