mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-18 20:11:20 +00:00
wa: pep8 fixes
This commit is contained in:
parent
4b86fa5aee
commit
925bc8b719
@ -46,6 +46,7 @@ class ListCommand(Command):
|
|||||||
Only list results that are supported by the
|
Only list results that are supported by the
|
||||||
specified platform.
|
specified platform.
|
||||||
''')
|
''')
|
||||||
|
|
||||||
# pylint: disable=superfluous-parens
|
# pylint: disable=superfluous-parens
|
||||||
def execute(self, state, args):
|
def execute(self, state, args):
|
||||||
filters = {}
|
filters = {}
|
||||||
|
@ -26,7 +26,7 @@ from wa.utils.revent import ReventRecorder
|
|||||||
|
|
||||||
|
|
||||||
if sys.version_info[0] == 3:
|
if sys.version_info[0] == 3:
|
||||||
raw_input = input #pylint: disable=redefined-builtin
|
raw_input = input # pylint: disable=redefined-builtin
|
||||||
|
|
||||||
|
|
||||||
class RecordCommand(Command):
|
class RecordCommand(Command):
|
||||||
|
@ -89,7 +89,7 @@ class ShowCommand(Command):
|
|||||||
|
|
||||||
call('echo "{}" | man -l -'.format(escape_double_quotes(output)), shell=True)
|
call('echo "{}" | man -l -'.format(escape_double_quotes(output)), shell=True)
|
||||||
else:
|
else:
|
||||||
print(rst_output) # pylint: disable=superfluous-parens
|
print(rst_output) # pylint: disable=superfluous-parens
|
||||||
|
|
||||||
|
|
||||||
def get_target_description(name):
|
def get_target_description(name):
|
||||||
|
@ -199,7 +199,7 @@ class SysfileValuesRuntimeConfig(RuntimeConfig):
|
|||||||
|
|
||||||
name = 'rt-sysfiles'
|
name = 'rt-sysfiles'
|
||||||
|
|
||||||
#pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def set_sysfile(obj, values, core):
|
def set_sysfile(obj, values, core):
|
||||||
for path, value in values.items():
|
for path, value in values.items():
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
#pylint: disable=W0613,E1101,E0203,W0201
|
# pylint: disable=W0613,E1101,E0203,W0201
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from wa import Instrument, Parameter
|
from wa import Instrument, Parameter
|
||||||
|
@ -38,7 +38,7 @@ class DmesgInstrument(Instrument):
|
|||||||
|
|
||||||
loglevel_file = '/proc/sys/kernel/printk'
|
loglevel_file = '/proc/sys/kernel/printk'
|
||||||
|
|
||||||
def initialize(self, context): #pylint: disable=unused-argument
|
def initialize(self, context): # pylint: disable=unused-argument
|
||||||
self.need_root = self.target.os == 'android'
|
self.need_root = self.target.os == 'android'
|
||||||
if self.need_root and not self.target.is_rooted:
|
if self.need_root and not self.target.is_rooted:
|
||||||
raise InstrumentError('Need root to collect dmesg on Android')
|
raise InstrumentError('Need root to collect dmesg on Android')
|
||||||
|
@ -60,7 +60,7 @@ class EnergyInstrumentBackend(Plugin):
|
|||||||
Typically there is just a single device/instrument, in which case the
|
Typically there is just a single device/instrument, in which case the
|
||||||
device key is arbitrary.
|
device key is arbitrary.
|
||||||
"""
|
"""
|
||||||
return {None: self.instrument(target, **kwargs)} #pylint: disable=not-callable
|
return {None: self.instrument(target, **kwargs)} # pylint: disable=not-callable
|
||||||
|
|
||||||
|
|
||||||
class DAQBackend(EnergyInstrumentBackend):
|
class DAQBackend(EnergyInstrumentBackend):
|
||||||
@ -284,7 +284,7 @@ class AcmeCapeBackend(EnergyInstrumentBackend):
|
|||||||
"""),
|
"""),
|
||||||
]
|
]
|
||||||
|
|
||||||
#pylint: disable=arguments-differ
|
# pylint: disable=arguments-differ
|
||||||
def get_instruments(self, target, metadir,
|
def get_instruments(self, target, metadir,
|
||||||
iio_capture, host, iio_devices, buffer_size):
|
iio_capture, host, iio_devices, buffer_size):
|
||||||
|
|
||||||
@ -429,7 +429,7 @@ class EnergyMeasurement(Instrument):
|
|||||||
self.instruments = self.backend.get_instruments(self.target, context.run_output.metadir, **self.params)
|
self.instruments = self.backend.get_instruments(self.target, context.run_output.metadir, **self.params)
|
||||||
|
|
||||||
for instrument in self.instruments.values():
|
for instrument in self.instruments.values():
|
||||||
if not (instrument.mode & CONTINUOUS): #pylint: disable=superfluous-parens
|
if not (instrument.mode & CONTINUOUS): # pylint: disable=superfluous-parens
|
||||||
msg = '{} instrument does not support continuous measurement collection'
|
msg = '{} instrument does not support continuous measurement collection'
|
||||||
raise ConfigError(msg.format(self.instrument))
|
raise ConfigError(msg.format(self.instrument))
|
||||||
instrument.setup()
|
instrument.setup()
|
||||||
|
@ -119,7 +119,7 @@ class FpsInstrument(Instrument):
|
|||||||
return
|
return
|
||||||
|
|
||||||
self._is_enabled = True
|
self._is_enabled = True
|
||||||
#pylint: disable=redefined-variable-type
|
# pylint: disable=redefined-variable-type
|
||||||
if use_gfxinfo:
|
if use_gfxinfo:
|
||||||
self.collector = GfxInfoFramesInstrument(self.target, collector_target, self.period)
|
self.collector = GfxInfoFramesInstrument(self.target, collector_target, self.period)
|
||||||
self.processor = DerivedGfxInfoStats(self.drop_threshold, filename='fps.csv')
|
self.processor = DerivedGfxInfoStats(self.drop_threshold, filename='fps.csv')
|
||||||
@ -128,12 +128,12 @@ class FpsInstrument(Instrument):
|
|||||||
self.processor = DerivedSurfaceFlingerStats(self.drop_threshold, filename='fps.csv')
|
self.processor = DerivedSurfaceFlingerStats(self.drop_threshold, filename='fps.csv')
|
||||||
self.collector.reset()
|
self.collector.reset()
|
||||||
|
|
||||||
def start(self, context): #pylint: disable=unused-argument
|
def start(self, context): # pylint: disable=unused-argument
|
||||||
if not self._is_enabled:
|
if not self._is_enabled:
|
||||||
return
|
return
|
||||||
self.collector.start()
|
self.collector.start()
|
||||||
|
|
||||||
def stop(self, context): #pylint: disable=unused-argument
|
def stop(self, context): # pylint: disable=unused-argument
|
||||||
if not self._is_enabled:
|
if not self._is_enabled:
|
||||||
return
|
return
|
||||||
self.collector.stop()
|
self.collector.stop()
|
||||||
|
@ -41,18 +41,18 @@ class HwmonInstrument(Instrument):
|
|||||||
hwmon data will be reported.
|
hwmon data will be reported.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def initialize(self, context): #pylint: disable=unused-argument
|
def initialize(self, context): # pylint: disable=unused-argument
|
||||||
self.instrument = _Instrument(self.target)
|
self.instrument = _Instrument(self.target)
|
||||||
|
|
||||||
def setup(self, context): #pylint: disable=unused-argument
|
def setup(self, context): # pylint: disable=unused-argument
|
||||||
self.instrument.reset()
|
self.instrument.reset()
|
||||||
|
|
||||||
@fast
|
@fast
|
||||||
def start(self, context): #pylint: disable=unused-argument
|
def start(self, context): # pylint: disable=unused-argument
|
||||||
self.before = self.instrument.take_measurement()
|
self.before = self.instrument.take_measurement()
|
||||||
|
|
||||||
@fast
|
@fast
|
||||||
def stop(self, context): #pylint: disable=unused-argument
|
def stop(self, context): # pylint: disable=unused-argument
|
||||||
self.after = self.instrument.take_measurement()
|
self.after = self.instrument.take_measurement()
|
||||||
|
|
||||||
def update_output(self, context):
|
def update_output(self, context):
|
||||||
@ -85,5 +85,5 @@ class HwmonInstrument(Instrument):
|
|||||||
"Don't know what to do with hwmon channel '{}'"
|
"Don't know what to do with hwmon channel '{}'"
|
||||||
.format(measurement_after.channel))
|
.format(measurement_after.channel))
|
||||||
|
|
||||||
def teardown(self, context): #pylint: disable=unused-argument
|
def teardown(self, context): # pylint: disable=unused-argument
|
||||||
self.instrument.teardown()
|
self.instrument.teardown()
|
||||||
|
@ -50,8 +50,8 @@ class ScreenCaptureInstrument(Instrument):
|
|||||||
output_path,
|
output_path,
|
||||||
self.period)
|
self.period)
|
||||||
|
|
||||||
def start(self, context): #pylint: disable=unused-argument
|
def start(self, context): # pylint: disable=unused-argument
|
||||||
self.collector.start()
|
self.collector.start()
|
||||||
|
|
||||||
def stop(self, context): #pylint: disable=unused-argument
|
def stop(self, context): # pylint: disable=unused-argument
|
||||||
self.collector.stop()
|
self.collector.stop()
|
||||||
|
@ -88,7 +88,7 @@ class CpuStatesProcessor(OutputProcessor):
|
|||||||
def initialize(self):
|
def initialize(self):
|
||||||
self.iteration_reports = OrderedDict()
|
self.iteration_reports = OrderedDict()
|
||||||
|
|
||||||
def process_job_output(self, output, target_info, run_output): #pylint: disable=unused-argument
|
def process_job_output(self, output, target_info, run_output): # pylint: disable=unused-argument
|
||||||
trace_file = output.get_artifact_path('trace-cmd-txt')
|
trace_file = output.get_artifact_path('trace-cmd-txt')
|
||||||
if not trace_file:
|
if not trace_file:
|
||||||
self.logger.warning('Text trace does not appear to have been generated; skipping this iteration.')
|
self.logger.warning('Text trace does not appear to have been generated; skipping this iteration.')
|
||||||
@ -110,7 +110,7 @@ class CpuStatesProcessor(OutputProcessor):
|
|||||||
iteration_id = (output.id, output.label, output.iteration)
|
iteration_id = (output.id, output.label, output.iteration)
|
||||||
self.iteration_reports[iteration_id] = reports
|
self.iteration_reports[iteration_id] = reports
|
||||||
|
|
||||||
#pylint: disable=too-many-locals,unused-argument
|
# pylint: disable=too-many-locals,unused-argument
|
||||||
def process_run_output(self, output, target_info):
|
def process_run_output(self, output, target_info):
|
||||||
if not self.iteration_reports:
|
if not self.iteration_reports:
|
||||||
self.logger.warning('No power state reports generated.')
|
self.logger.warning('No power state reports generated.')
|
||||||
|
@ -60,7 +60,7 @@ class CsvReportProcessor(OutputProcessor):
|
|||||||
self.outputs_so_far = [] # pylint: disable=attribute-defined-outside-init
|
self.outputs_so_far = [] # pylint: disable=attribute-defined-outside-init
|
||||||
self.artifact_added = False
|
self.artifact_added = False
|
||||||
|
|
||||||
#pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
def process_job_output(self, output, target_info, run_output):
|
def process_job_output(self, output, target_info, run_output):
|
||||||
self.outputs_so_far.append(output)
|
self.outputs_so_far.append(output)
|
||||||
self._write_outputs(self.outputs_so_far, run_output)
|
self._write_outputs(self.outputs_so_far, run_output)
|
||||||
@ -68,7 +68,7 @@ class CsvReportProcessor(OutputProcessor):
|
|||||||
run_output.add_artifact('run_result_csv', 'results.csv', 'export')
|
run_output.add_artifact('run_result_csv', 'results.csv', 'export')
|
||||||
self.artifact_added = True
|
self.artifact_added = True
|
||||||
|
|
||||||
def process_run_output(self, output, target_info): #pylint: disable=unused-argument
|
def process_run_output(self, output, target_info): # pylint: disable=unused-argument
|
||||||
self.outputs_so_far.append(output)
|
self.outputs_so_far.append(output)
|
||||||
self._write_outputs(self.outputs_so_far, output)
|
self._write_outputs(self.outputs_so_far, output)
|
||||||
if not self.artifact_added:
|
if not self.artifact_added:
|
||||||
|
@ -115,7 +115,7 @@ class SqliteResultProcessor(OutputProcessor):
|
|||||||
self._spec_oid = None
|
self._spec_oid = None
|
||||||
self._run_initialized = False
|
self._run_initialized = False
|
||||||
|
|
||||||
def export_job_output(self, job_output, target_info, run_output): #pylint: disable=unused-argument
|
def export_job_output(self, job_output, target_info, run_output): # pylint: disable=unused-argument
|
||||||
if not self._run_initialized:
|
if not self._run_initialized:
|
||||||
self._init_run(run_output)
|
self._init_run(run_output)
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ class SqliteResultProcessor(OutputProcessor):
|
|||||||
with self._open_connection() as conn:
|
with self._open_connection() as conn:
|
||||||
conn.executemany('INSERT INTO metrics VALUES (?,?,?,?,?,?)', metrics)
|
conn.executemany('INSERT INTO metrics VALUES (?,?,?,?,?,?)', metrics)
|
||||||
|
|
||||||
def export_run_output(self, run_output, target_info): #pylint: disable=unused-argument
|
def export_run_output(self, run_output, target_info): # pylint: disable=unused-argument
|
||||||
if not self._run_initialized:
|
if not self._run_initialized:
|
||||||
self._init_run(run_output)
|
self._init_run(run_output)
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class StatusTxtReporter(OutputProcessor):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def process_run_output(self, output, target_info): #pylint: disable=unused-argument
|
def process_run_output(self, output, target_info): # pylint: disable=unused-argument
|
||||||
counter = Counter()
|
counter = Counter()
|
||||||
for jo in output.jobs:
|
for jo in output.jobs:
|
||||||
counter[jo.status] += 1
|
counter[jo.status] += 1
|
||||||
|
@ -61,7 +61,7 @@ class TargzProcessor(OutputProcessor):
|
|||||||
self.logger.debug('Registering RUN_FINALIZED handler.')
|
self.logger.debug('Registering RUN_FINALIZED handler.')
|
||||||
signal.connect(self.delete_output_directory, signal.RUN_FINALIZED, priority=-100)
|
signal.connect(self.delete_output_directory, signal.RUN_FINALIZED, priority=-100)
|
||||||
|
|
||||||
def export_run_output(self, run_output, target_info): #pylint: disable=unused-argument
|
def export_run_output(self, run_output, target_info): # pylint: disable=unused-argument
|
||||||
if self.outfile:
|
if self.outfile:
|
||||||
outfile_path = self.outfile.format(**run_output.info.to_pod())
|
outfile_path = self.outfile.format(**run_output.info.to_pod())
|
||||||
else:
|
else:
|
||||||
|
@ -30,7 +30,7 @@ class UxperfProcessor(OutputProcessor):
|
|||||||
a agenda file by setting ``markers_enabled`` for the workload to ``True``.
|
a agenda file by setting ``markers_enabled`` for the workload to ``True``.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
#pylint: disable=too-many-locals,unused-argument
|
# pylint: disable=too-many-locals,unused-argument
|
||||||
def process_job_output(self, output, target_info, job_output):
|
def process_job_output(self, output, target_info, job_output):
|
||||||
logcat = output.get_artifact('logcat')
|
logcat = output.get_artifact('logcat')
|
||||||
if not logcat:
|
if not logcat:
|
||||||
|
@ -57,7 +57,7 @@ class LogcatParser(object):
|
|||||||
if event:
|
if event:
|
||||||
yield event
|
yield event
|
||||||
|
|
||||||
def parse_line(self, line): #pylint: disable=no-self-use
|
def parse_line(self, line): # pylint: disable=no-self-use
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if not line or line.startswith('-') or ': ' not in line:
|
if not line or line.startswith('-') or ': ' not in line:
|
||||||
return None
|
return None
|
||||||
|
@ -18,7 +18,7 @@ import re
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
from builtins import zip #pyline disable=redefined-builtin
|
from builtins import zip # pylint: disable=redefined-builtin
|
||||||
from future.moves.itertools import zip_longest
|
from future.moves.itertools import zip_longest
|
||||||
|
|
||||||
from wa.utils.misc import diff_tokens, write_table
|
from wa.utils.misc import diff_tokens, write_table
|
||||||
@ -26,6 +26,7 @@ from wa.utils.misc import ensure_file_directory_exists as _f
|
|||||||
|
|
||||||
logger = logging.getLogger('diff')
|
logger = logging.getLogger('diff')
|
||||||
|
|
||||||
|
|
||||||
def diff_interrupt_files(before, after, result): # pylint: disable=R0914
|
def diff_interrupt_files(before, after, result): # pylint: disable=R0914
|
||||||
output_lines = []
|
output_lines = []
|
||||||
with open(before) as bfh:
|
with open(before) as bfh:
|
||||||
|
@ -24,7 +24,7 @@ def activate_environment(name):
|
|||||||
environment with that name does not already exist, it will be
|
environment with that name does not already exist, it will be
|
||||||
created.
|
created.
|
||||||
"""
|
"""
|
||||||
#pylint: disable=W0603
|
# pylint: disable=W0603
|
||||||
global __active_environment
|
global __active_environment
|
||||||
|
|
||||||
if name not in list(__environments.keys()):
|
if name not in list(__environments.keys()):
|
||||||
|
@ -49,7 +49,8 @@ _indent_width = 4
|
|||||||
_console_handler = None
|
_console_handler = None
|
||||||
_init_handler = None
|
_init_handler = None
|
||||||
|
|
||||||
#pylint: disable=global-statement
|
|
||||||
|
# pylint: disable=global-statement
|
||||||
def init(verbosity=logging.INFO, color=True, indent_with=4,
|
def init(verbosity=logging.INFO, color=True, indent_with=4,
|
||||||
regular_fmt='%(levelname)-8s %(message)s',
|
regular_fmt='%(levelname)-8s %(message)s',
|
||||||
verbose_fmt='%(asctime)s %(levelname)-8s %(name)10.10s: %(message)s',
|
verbose_fmt='%(asctime)s %(levelname)-8s %(name)10.10s: %(message)s',
|
||||||
@ -95,7 +96,7 @@ def set_level(level):
|
|||||||
_console_handler.setLevel(level)
|
_console_handler.setLevel(level)
|
||||||
|
|
||||||
|
|
||||||
#pylint: disable=global-statement
|
# pylint: disable=global-statement
|
||||||
def add_file(filepath, level=logging.DEBUG,
|
def add_file(filepath, level=logging.DEBUG,
|
||||||
fmt='%(asctime)s %(levelname)-8s %(name)10.10s: %(message)s'):
|
fmt='%(asctime)s %(levelname)-8s %(name)10.10s: %(message)s'):
|
||||||
global _init_handler
|
global _init_handler
|
||||||
@ -140,13 +141,13 @@ def __disable_logger(logger):
|
|||||||
logger.propagate = False
|
logger.propagate = False
|
||||||
|
|
||||||
|
|
||||||
#pylint: disable=global-statement
|
# pylint: disable=global-statement
|
||||||
def indent():
|
def indent():
|
||||||
global _indent_level
|
global _indent_level
|
||||||
_indent_level += 1
|
_indent_level += 1
|
||||||
|
|
||||||
|
|
||||||
#pylint: disable=global-statement
|
# pylint: disable=global-statement
|
||||||
def dedent():
|
def dedent():
|
||||||
global _indent_level
|
global _indent_level
|
||||||
_indent_level -= 1
|
_indent_level -= 1
|
||||||
@ -161,7 +162,7 @@ def indentcontext():
|
|||||||
dedent()
|
dedent()
|
||||||
|
|
||||||
|
|
||||||
#pylint: disable=global-statement
|
# pylint: disable=global-statement
|
||||||
def set_indent_level(level):
|
def set_indent_level(level):
|
||||||
global _indent_level
|
global _indent_level
|
||||||
old_level = _indent_level
|
old_level = _indent_level
|
||||||
|
@ -418,7 +418,8 @@ def categorize(v):
|
|||||||
else:
|
else:
|
||||||
return 'c'
|
return 'c'
|
||||||
|
|
||||||
#pylint: disable=too-many-return-statements,too-many-branches
|
|
||||||
|
# pylint: disable=too-many-return-statements,too-many-branches
|
||||||
def merge_config_values(base, other):
|
def merge_config_values(base, other):
|
||||||
"""
|
"""
|
||||||
This is used to merge two objects, typically when setting the value of a
|
This is used to merge two objects, typically when setting the value of a
|
||||||
|
@ -65,7 +65,7 @@ from datetime import datetime
|
|||||||
import yaml as _yaml
|
import yaml as _yaml
|
||||||
import dateutil.parser
|
import dateutil.parser
|
||||||
|
|
||||||
#pylint: disable=redefined-builtin
|
# pylint: disable=redefined-builtin
|
||||||
from past.builtins import basestring
|
from past.builtins import basestring
|
||||||
|
|
||||||
from wa.framework.exception import SerializerSyntaxError
|
from wa.framework.exception import SerializerSyntaxError
|
||||||
@ -275,7 +275,7 @@ class python(object):
|
|||||||
exec(s, pod) # pylint: disable=exec-used
|
exec(s, pod) # pylint: disable=exec-used
|
||||||
except SyntaxError as e:
|
except SyntaxError as e:
|
||||||
raise SerializerSyntaxError(e.message, e.lineno)
|
raise SerializerSyntaxError(e.message, e.lineno)
|
||||||
for k in list(pod.keys()): # pylint: disable=consider-iterating-dictionary
|
for k in list(pod.keys()): # pylint: disable=consider-iterating-dictionary
|
||||||
if k.startswith('__'):
|
if k.startswith('__'):
|
||||||
del pod[k]
|
del pod[k]
|
||||||
return pod
|
return pod
|
||||||
@ -351,7 +351,7 @@ def _write_pod(pod, wfh, fmt=None):
|
|||||||
|
|
||||||
|
|
||||||
def is_pod(obj):
|
def is_pod(obj):
|
||||||
if type(obj) not in POD_TYPES: #pylint: disable=unidiomatic-typecheck
|
if type(obj) not in POD_TYPES: # pylint: disable=unidiomatic-typecheck
|
||||||
return False
|
return False
|
||||||
if hasattr(obj, 'items'):
|
if hasattr(obj, 'items'):
|
||||||
for k, v in obj.items():
|
for k, v in obj.items():
|
||||||
|
@ -266,7 +266,7 @@ class TraceCmdParser(object):
|
|||||||
by trace-cmd
|
by trace-cmd
|
||||||
"""
|
"""
|
||||||
inside_maked_region = False
|
inside_maked_region = False
|
||||||
#pylint: disable=superfluous-parens
|
# pylint: disable=superfluous-parens
|
||||||
filters = [re.compile('^{}$'.format(e)) for e in (self.events or [])]
|
filters = [re.compile('^{}$'.format(e)) for e in (self.events or [])]
|
||||||
filter_markers = self.filter_markers
|
filter_markers = self.filter_markers
|
||||||
if filter_markers and self.check_for_markers:
|
if filter_markers and self.check_for_markers:
|
||||||
|
@ -32,12 +32,12 @@ import shlex
|
|||||||
import sys
|
import sys
|
||||||
from bisect import insort
|
from bisect import insort
|
||||||
if sys.version_info[0] == 3:
|
if sys.version_info[0] == 3:
|
||||||
from urllib.parse import quote, unquote #pylint: disable=no-name-in-module, import-error
|
from urllib.parse import quote, unquote # pylint: disable=no-name-in-module, import-error
|
||||||
from past.builtins import basestring #pylint: disable=redefined-builtin
|
from past.builtins import basestring # pylint: disable=redefined-builtin
|
||||||
long = int
|
long = int
|
||||||
else:
|
else:
|
||||||
from urllib import quote, unquote
|
from urllib import quote, unquote
|
||||||
#pylint: disable=wrong-import-position
|
# pylint: disable=wrong-import-position
|
||||||
from collections import defaultdict, MutableMapping
|
from collections import defaultdict, MutableMapping
|
||||||
from copy import copy
|
from copy import copy
|
||||||
from functools import total_ordering
|
from functools import total_ordering
|
||||||
@ -800,7 +800,7 @@ class cpu_mask(object):
|
|||||||
elif isinstance(cpus, list):
|
elif isinstance(cpus, list):
|
||||||
self._mask = list_to_mask(cpus)
|
self._mask = list_to_mask(cpus)
|
||||||
elif isinstance(cpus, cpu_mask):
|
elif isinstance(cpus, cpu_mask):
|
||||||
self._mask = cpus._mask # pylint: disable=protected-access
|
self._mask = cpus._mask # pylint: disable=protected-access
|
||||||
else:
|
else:
|
||||||
msg = 'Unknown conversion from {} to cpu mask'
|
msg = 'Unknown conversion from {} to cpu mask'
|
||||||
raise ValueError(msg.format(cpus))
|
raise ValueError(msg.format(cpus))
|
||||||
|
@ -55,7 +55,7 @@ class Antutu(ApkUiautoWorkload):
|
|||||||
try:
|
try:
|
||||||
result = float(match.group(1))
|
result = float(match.group(1))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
result = 'NaN' #pylint: disable=redefined-variable-type
|
result = 'NaN' # pylint: disable=redefined-variable-type
|
||||||
entry = regex.pattern.rsplit(None, 1)[0]
|
entry = regex.pattern.rsplit(None, 1)[0]
|
||||||
context.add_metric(entry, result, lower_is_better=False)
|
context.add_metric(entry, result, lower_is_better=False)
|
||||||
expected_results -= 1
|
expected_results -= 1
|
||||||
|
@ -15,11 +15,11 @@
|
|||||||
|
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
import os
|
import os
|
||||||
#pylint: disable=wrong-import-order,wrong-import-position
|
# pylint: disable=wrong-import-order,wrong-import-position
|
||||||
from future.standard_library import install_aliases
|
from future.standard_library import install_aliases
|
||||||
install_aliases()
|
install_aliases()
|
||||||
|
|
||||||
from urllib.request import urlopen #pylint: disable=import-error
|
from urllib.request import urlopen # pylint: disable=import-error
|
||||||
|
|
||||||
from wa import Workload, Parameter, Alias, WorkloadError
|
from wa import Workload, Parameter, Alias, WorkloadError
|
||||||
from wa.utils.exec_control import once
|
from wa.utils.exec_control import once
|
||||||
@ -99,7 +99,7 @@ class ApacheBenchmark(Workload):
|
|||||||
wfh.write(self.output)
|
wfh.write(self.output)
|
||||||
context.add_artifact('ab-output', outfile, kind='raw')
|
context.add_artifact('ab-output', outfile, kind='raw')
|
||||||
|
|
||||||
def update_output(self, context): #pylint: disable=too-many-locals
|
def update_output(self, context): # pylint: disable=too-many-locals
|
||||||
with open(context.get_artifact_path('ab-output')) as fh:
|
with open(context.get_artifact_path('ab-output')) as fh:
|
||||||
server_software = get_line(fh, 'Server Software').split(':')[1].strip()
|
server_software = get_line(fh, 'Server Software').split(':')[1].strip()
|
||||||
context.add_metadata('server-software', server_software)
|
context.add_metadata('server-software', server_software)
|
||||||
|
@ -92,7 +92,7 @@ class Applaunch(ApkUiautoWorkload):
|
|||||||
def init_resources(self, context):
|
def init_resources(self, context):
|
||||||
super(Applaunch, self).init_resources(context)
|
super(Applaunch, self).init_resources(context)
|
||||||
self.workload_params['markers_enabled'] = True
|
self.workload_params['markers_enabled'] = True
|
||||||
#pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
self.workload = pluginloader.get_workload(self.workload_name, self.target,
|
self.workload = pluginloader.get_workload(self.workload_name, self.target,
|
||||||
**self.workload_params)
|
**self.workload_params)
|
||||||
self.workload.init_resources(context)
|
self.workload.init_resources(context)
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
#pylint: disable=E1101,W0201
|
# pylint: disable=E1101,W0201
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
#pylint: disable=E1101,W0201
|
# pylint: disable=E1101,W0201
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
@ -19,11 +19,11 @@ import re
|
|||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
#pylint: disable=wrong-import-position
|
# pylint: disable=wrong-import-position
|
||||||
from future.standard_library import install_aliases
|
from future.standard_library import install_aliases
|
||||||
install_aliases()
|
install_aliases()
|
||||||
|
|
||||||
#pylint: disable=import-error, wrong-import-order
|
# pylint: disable=import-error, wrong-import-order
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
import urllib.error
|
import urllib.error
|
||||||
@ -113,7 +113,7 @@ class ExoPlayer(ApkWorkload):
|
|||||||
"""),
|
"""),
|
||||||
]
|
]
|
||||||
|
|
||||||
#pylint: disable=access-member-before-definition
|
# pylint: disable=access-member-before-definition
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if self.format and self.filename:
|
if self.format and self.filename:
|
||||||
raise ConfigError('Either format *or* filename must be specified; but not both.')
|
raise ConfigError('Either format *or* filename must be specified; but not both.')
|
||||||
@ -156,7 +156,7 @@ class ExoPlayer(ApkWorkload):
|
|||||||
'"format" to specify a different file.')
|
'"format" to specify a different file.')
|
||||||
return files[0]
|
return files[0]
|
||||||
|
|
||||||
def init_resources(self, context): #pylint: disable=unused-argument
|
def init_resources(self, context): # pylint: disable=unused-argument
|
||||||
# Needs to happen first, as it sets self.format, which is required by
|
# Needs to happen first, as it sets self.format, which is required by
|
||||||
# _find_host_video_file
|
# _find_host_video_file
|
||||||
self.validate()
|
self.validate()
|
||||||
|
@ -291,33 +291,31 @@ class GBScoreCalculator(object):
|
|||||||
'memory': 0.1926489,
|
'memory': 0.1926489,
|
||||||
'stream': 0.1054738,
|
'stream': 0.1054738,
|
||||||
}
|
}
|
||||||
#pylint: disable=C0326
|
# pylint: disable=C0326
|
||||||
workloads = [
|
workloads = [
|
||||||
# ID Name Power Mac ST Power Mac MT
|
# ID Name Power Mac ST Power Mac MT
|
||||||
GBWorkload(101, 'Blowfish', 43971, 40979),
|
GBWorkload(101, 'Blowfish', 43971, 40979), # NOQA
|
||||||
GBWorkload(102, 'Text Compress', 3202, 3280),
|
GBWorkload(102, 'Text Compress', 3202, 3280), # NOQA
|
||||||
GBWorkload(103, 'Text Decompress', 4112, 3986),
|
GBWorkload(103, 'Text Decompress', 4112, 3986), # NOQA
|
||||||
GBWorkload(104, 'Image Compress', 8272, 8412),
|
GBWorkload(104, 'Image Compress', 8272, 8412), # NOQA
|
||||||
GBWorkload(105, 'Image Decompress', 16800, 16330),
|
GBWorkload(105, 'Image Decompress', 16800, 16330), # NOQA
|
||||||
GBWorkload(107, 'Lua', 385, 385),
|
GBWorkload(107, 'Lua', 385, 385), # NOQA
|
||||||
|
|
||||||
GBWorkload(201, 'Mandelbrot', 665589, 653746),
|
GBWorkload(201, 'Mandelbrot', 665589, 653746), # NOQA),
|
||||||
GBWorkload(202, 'Dot Product', 481449, 455422),
|
GBWorkload(202, 'Dot Product', 481449, 455422), # NOQA,
|
||||||
GBWorkload(203, 'LU Decomposition', 889933, 877657),
|
GBWorkload(203, 'LU Decomposition', 889933, 877657), # NOQA
|
||||||
GBWorkload(204, 'Primality Test', 149394, 185502),
|
GBWorkload(204, 'Primality Test', 149394, 185502), # NOQA
|
||||||
GBWorkload(205, 'Sharpen Image', 2340, 2304),
|
GBWorkload(205, 'Sharpen Image', 2340, 2304), # NOQA
|
||||||
GBWorkload(206, 'Blur Image', 791, 787),
|
GBWorkload(206, 'Blur Image', 791, 787), # NOQA
|
||||||
|
|
||||||
GBWorkload(302, 'Read Sequential', 1226708, None),
|
GBWorkload(302, 'Read Sequential', 1226708, None), # NOQA
|
||||||
GBWorkload(304, 'Write Sequential', 683782, None),
|
GBWorkload(304, 'Write Sequential', 683782, None), # NOQA
|
||||||
GBWorkload(306, 'Stdlib Allocate', 3739, None),
|
GBWorkload(306, 'Stdlib Allocate', 3739, None), # NOQA
|
||||||
GBWorkload(307, 'Stdlib Write', 2070681, None),
|
GBWorkload(307, 'Stdlib Write', 2070681, None), # NOQA
|
||||||
GBWorkload(308, 'Stdlib Copy', 1030360, None),
|
GBWorkload(401, 'Stream Copy', 1367892, None), # NOQA
|
||||||
|
GBWorkload(402, 'Stream Scale', 1296053, None), # NOQA
|
||||||
GBWorkload(401, 'Stream Copy', 1367892, None),
|
GBWorkload(403, 'Stream Add', 1507115, None), # NOQA
|
||||||
GBWorkload(402, 'Stream Scale', 1296053, None),
|
GBWorkload(404, 'Stream Triad', 1384526, None), # NOQA
|
||||||
GBWorkload(403, 'Stream Add', 1507115, None),
|
|
||||||
GBWorkload(404, 'Stream Triad', 1384526, None),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -389,7 +387,7 @@ class GBScoreCalculator(object):
|
|||||||
context.add_metric('Geekbench Score', int(overall_score))
|
context.add_metric('Geekbench Score', int(overall_score))
|
||||||
|
|
||||||
|
|
||||||
class GeekbenchCorproate(Geekbench): #pylint: disable=too-many-ancestors
|
class GeekbenchCorproate(Geekbench): # pylint: disable=too-many-ancestors
|
||||||
name = "geekbench-corporate"
|
name = "geekbench-corporate"
|
||||||
is_corporate = True
|
is_corporate = True
|
||||||
requires_network = False
|
requires_network = False
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
#pylint: disable=E1101,W0201
|
# pylint: disable=E1101,W0201
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
@ -129,7 +129,7 @@ class Jankbench(ApkWorkload):
|
|||||||
else:
|
else:
|
||||||
self.extract_metrics_from_logcat(context)
|
self.extract_metrics_from_logcat(context)
|
||||||
|
|
||||||
def extract_metrics_from_db(self, context): #pylint: disable=no-self-use
|
def extract_metrics_from_db(self, context): # pylint: disable=no-self-use
|
||||||
dbfile = context.get_artifact_path('jankbench-results')
|
dbfile = context.get_artifact_path('jankbench-results')
|
||||||
with sqlite3.connect(dbfile) as conn:
|
with sqlite3.connect(dbfile) as conn:
|
||||||
df = pd.read_sql('select name, iteration, total_duration, jank_frame from ui_results', conn)
|
df = pd.read_sql('select name, iteration, total_duration, jank_frame from ui_results', conn)
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
#pylint: disable=E1101,W0201
|
# pylint: disable=E1101,W0201
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
@ -41,9 +41,9 @@ class Mongoperf(Workload):
|
|||||||
|
|
||||||
parameters = [
|
parameters = [
|
||||||
Parameter('duration', kind=int, default=300,
|
Parameter('duration', kind=int, default=300,
|
||||||
description="""
|
description="""
|
||||||
Duration of of the workload.
|
Duration of of the workload.
|
||||||
"""),
|
"""),
|
||||||
Parameter('threads', kind=int, default=16,
|
Parameter('threads', kind=int, default=16,
|
||||||
description="""
|
description="""
|
||||||
Defines the number of threads mongoperf will use in the test.
|
Defines the number of threads mongoperf will use in the test.
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
#pylint: disable=E1101,W0201
|
# pylint: disable=E1101,W0201
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
Loading…
x
Reference in New Issue
Block a user