mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-04-20 01:30:58 +01:00
wa: Rename results_processors
to output_processors
For clarity and to better reflect their purpose, rename `results_processors` to `output_processors`.
This commit is contained in:
parent
a688c9120e
commit
538cd8d332
@ -3,7 +3,7 @@ from wa.framework.command import Command, ComplexCommand, SubCommand
|
|||||||
from wa.framework.configuration import settings
|
from wa.framework.configuration import settings
|
||||||
from wa.framework.configuration.core import Status
|
from wa.framework.configuration.core import Status
|
||||||
from wa.framework.exception import HostError, JobError, InstrumentError, ConfigError
|
from wa.framework.exception import HostError, JobError, InstrumentError, ConfigError
|
||||||
from wa.framework.exception import (ResultProcessorError, ResourceError,
|
from wa.framework.exception import (OutputProcessorError, ResourceError,
|
||||||
CommandError, ToolError)
|
CommandError, ToolError)
|
||||||
from wa.framework.exception import (WAError, NotFoundError, ValidationError,
|
from wa.framework.exception import (WAError, NotFoundError, ValidationError,
|
||||||
WorkloadError)
|
WorkloadError)
|
||||||
@ -12,7 +12,7 @@ from wa.framework.instrumentation import (Instrument, very_slow, slow, normal, f
|
|||||||
very_fast)
|
very_fast)
|
||||||
from wa.framework.output import RunOutput, discover_wa_outputs
|
from wa.framework.output import RunOutput, discover_wa_outputs
|
||||||
from wa.framework.plugin import Plugin, Parameter
|
from wa.framework.plugin import Plugin, Parameter
|
||||||
from wa.framework.processor import ResultProcessor
|
from wa.framework.output_processor import OutputProcessor
|
||||||
from wa.framework.resource import (NO_ONE, JarFile, ApkFile, ReventFile, File,
|
from wa.framework.resource import (NO_ONE, JarFile, ApkFile, ReventFile, File,
|
||||||
Executable)
|
Executable)
|
||||||
from wa.framework.workload import (Workload, ApkWorkload, ApkUiautoWorkload,
|
from wa.framework.workload import (Workload, ApkWorkload, ApkUiautoWorkload,
|
||||||
|
@ -36,7 +36,7 @@ class CreateAgendaSubcommand(SubCommand):
|
|||||||
|
|
||||||
def execute(self, state, args):
|
def execute(self, state, args):
|
||||||
agenda = OrderedDict()
|
agenda = OrderedDict()
|
||||||
agenda['config'] = OrderedDict(instrumentation=[], result_processors=[])
|
agenda['config'] = OrderedDict(instrumentation=[], output_processors=[])
|
||||||
agenda['global'] = OrderedDict(iterations=args.iterations)
|
agenda['global'] = OrderedDict(iterations=args.iterations)
|
||||||
agenda['workloads'] = []
|
agenda['workloads'] = []
|
||||||
target_desc = None
|
target_desc = None
|
||||||
@ -65,8 +65,8 @@ class CreateAgendaSubcommand(SubCommand):
|
|||||||
else:
|
else:
|
||||||
if extcls.kind == 'instrument':
|
if extcls.kind == 'instrument':
|
||||||
agenda['config']['instrumentation'].append(name)
|
agenda['config']['instrumentation'].append(name)
|
||||||
if extcls.kind == 'result_processor':
|
if extcls.kind == 'output_processor':
|
||||||
agenda['config']['result_processors'].append(name)
|
agenda['config']['output_processors'].append(name)
|
||||||
agenda['config'][name] = config
|
agenda['config'][name] = config
|
||||||
|
|
||||||
if args.output:
|
if args.output:
|
||||||
|
@ -74,7 +74,7 @@ class RunCommand(Command):
|
|||||||
self.parser.add_argument('--disable', action='append', dest='augmentations_to_disable',
|
self.parser.add_argument('--disable', action='append', dest='augmentations_to_disable',
|
||||||
default=[],
|
default=[],
|
||||||
metavar='INSTRUMENT', help="""
|
metavar='INSTRUMENT', help="""
|
||||||
Specify an instrument or result processor to
|
Specify an instrument or output processor to
|
||||||
disable from the command line. This equivalent
|
disable from the command line. This equivalent
|
||||||
to adding "~{metavar}" to the instrumentation
|
to adding "~{metavar}" to the instrumentation
|
||||||
list in the agenda. This can be used to
|
list in the agenda. This can be used to
|
||||||
|
@ -558,7 +558,7 @@ class MetaConfiguration(Configuration):
|
|||||||
'wa.framework.getters',
|
'wa.framework.getters',
|
||||||
'wa.framework.target.descriptor',
|
'wa.framework.target.descriptor',
|
||||||
'wa.instrumentation',
|
'wa.instrumentation',
|
||||||
'wa.processors',
|
'wa.output_processors',
|
||||||
'wa.workloads',
|
'wa.workloads',
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -793,7 +793,7 @@ class RunConfiguration(Configuration):
|
|||||||
'''
|
'''
|
||||||
),
|
),
|
||||||
ConfigurationPoint(
|
ConfigurationPoint(
|
||||||
'result_processors',
|
'output_processors',
|
||||||
kind=toggle_set,
|
kind=toggle_set,
|
||||||
default=['csv', 'status'],
|
default=['csv', 'status'],
|
||||||
description='''
|
description='''
|
||||||
@ -891,14 +891,14 @@ class JobSpec(Configuration):
|
|||||||
Similar to IDs but do not have the uniqueness restriction.
|
Similar to IDs but do not have the uniqueness restriction.
|
||||||
If specified, labels will be used by some result
|
If specified, labels will be used by some result
|
||||||
processes instead of (or in addition to) the workload
|
processes instead of (or in addition to) the workload
|
||||||
name. For example, the csv result processor will put
|
name. For example, the csv output processor will put
|
||||||
the label in the "workload" column of the CSV file.
|
the label in the "workload" column of the CSV file.
|
||||||
'''),
|
'''),
|
||||||
ConfigurationPoint('augmentations', kind=toggle_set, merge=True,
|
ConfigurationPoint('augmentations', kind=toggle_set, merge=True,
|
||||||
aliases=["instruments", "processors", "instrumentation",
|
aliases=["instruments", "processors", "instrumentation",
|
||||||
"result_processors", "augment"],
|
"output_processors", "augment", "result_processor"],
|
||||||
description='''
|
description='''
|
||||||
The instruments and result processors to enable (or
|
The instruments and output processors to enable (or
|
||||||
disabled using a ~) during this workload spec. This combines the
|
disabled using a ~) during this workload spec. This combines the
|
||||||
"instrumentation" and "result_processors" from
|
"instrumentation" and "result_processors" from
|
||||||
previous versions of WA (the old entries are now
|
previous versions of WA (the old entries are now
|
||||||
@ -1073,7 +1073,7 @@ class JobGenerator(object):
|
|||||||
msg = "'enabled_instruments' cannot be updated after it has been accessed"
|
msg = "'enabled_instruments' cannot be updated after it has been accessed"
|
||||||
raise RuntimeError(msg)
|
raise RuntimeError(msg)
|
||||||
self._enabled_instruments.add(entry)
|
self._enabled_instruments.add(entry)
|
||||||
elif entry_cls.kind == 'result_processor':
|
elif entry_cls.kind == 'output_processor':
|
||||||
if self._read_enabled_processors:
|
if self._read_enabled_processors:
|
||||||
msg = "'enabled_processors' cannot be updated after it has been accessed"
|
msg = "'enabled_processors' cannot be updated after it has been accessed"
|
||||||
raise RuntimeError(msg)
|
raise RuntimeError(msg)
|
||||||
|
@ -98,9 +98,9 @@ class ConfigManager(object):
|
|||||||
processors = []
|
processors = []
|
||||||
for name in self.enabled_processors:
|
for name in self.enabled_processors:
|
||||||
try:
|
try:
|
||||||
proc = self.plugin_cache.get_plugin(name, kind='result_processor')
|
proc = self.plugin_cache.get_plugin(name, kind='output_processor')
|
||||||
except NotFoundError:
|
except NotFoundError:
|
||||||
msg = 'Result processor "{}" not found'
|
msg = 'Output Processor "{}" not found'
|
||||||
raise NotFoundError(msg.format(name))
|
raise NotFoundError(msg.format(name))
|
||||||
processors.append(proc)
|
processors.append(proc)
|
||||||
return processors
|
return processors
|
||||||
|
@ -208,9 +208,9 @@ def _load_file(filepath, error_name):
|
|||||||
|
|
||||||
def merge_augmentations(raw):
|
def merge_augmentations(raw):
|
||||||
"""
|
"""
|
||||||
Since, from configuration perspective, result processors and instrumens are
|
Since, from configuration perspective, output processors and instrumens are
|
||||||
handled identically, the configuration entries are now interchangeable. E.g. it is
|
handled identically, the configuration entries are now interchangeable. E.g. it is
|
||||||
now valid to specify a result processor in instrumentation list. This is to make things
|
now valid to specify a output processor in instrumentation list. This is to make things
|
||||||
eassier for the users, as, from their perspective, the distinction is somewhat arbitrary.
|
eassier for the users, as, from their perspective, the distinction is somewhat arbitrary.
|
||||||
|
|
||||||
For backwards compatibility, both entries are still valid, and this
|
For backwards compatibility, both entries are still valid, and this
|
||||||
|
@ -48,8 +48,8 @@ class InstrumentError(WAError):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class ResultProcessorError(WAError):
|
class OutputProcessorError(WAError):
|
||||||
"""General ResultProcessor error."""
|
"""General OutputProcessor error."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ from wa.framework.configuration.core import Status
|
|||||||
from wa.framework.exception import HostError, WorkloadError
|
from wa.framework.exception import HostError, WorkloadError
|
||||||
from wa.framework.job import Job
|
from wa.framework.job import Job
|
||||||
from wa.framework.output import init_job_output
|
from wa.framework.output import init_job_output
|
||||||
from wa.framework.processor import ProcessorManager
|
from wa.framework.output_processor import ProcessorManager
|
||||||
from wa.framework.resource import ResourceResolver
|
from wa.framework.resource import ResourceResolver
|
||||||
from wa.framework.target.manager import TargetManager
|
from wa.framework.target.manager import TargetManager
|
||||||
from wa.utils import log
|
from wa.utils import log
|
||||||
@ -253,7 +253,7 @@ class Executor(object):
|
|||||||
|
|
||||||
The initial context set up involves combining configuration from various
|
The initial context set up involves combining configuration from various
|
||||||
sources, loading of requided workloads, loading and installation of
|
sources, loading of requided workloads, loading and installation of
|
||||||
instruments and result processors, etc. Static validation of the combined
|
instruments and output processors, etc. Static validation of the combined
|
||||||
configuration is also performed.
|
configuration is also performed.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@ -305,7 +305,7 @@ class Executor(object):
|
|||||||
instrumentation.install(instrument, context)
|
instrumentation.install(instrument, context)
|
||||||
instrumentation.validate()
|
instrumentation.validate()
|
||||||
|
|
||||||
self.logger.info('Installing result processors')
|
self.logger.info('Installing output processors')
|
||||||
pm = ProcessorManager()
|
pm = ProcessorManager()
|
||||||
for proc in config_manager.get_processors():
|
for proc in config_manager.get_processors():
|
||||||
pm.install(proc, context)
|
pm.install(proc, context)
|
||||||
|
@ -286,20 +286,20 @@ class Artifact(object):
|
|||||||
"""
|
"""
|
||||||
This is an artifact generated during execution/post-processing of a
|
This is an artifact generated during execution/post-processing of a
|
||||||
workload. Unlike metrics, this represents an actual artifact, such as a
|
workload. Unlike metrics, this represents an actual artifact, such as a
|
||||||
file, generated. This may be "result", such as trace, or it could be "meta
|
file, generated. This may be "output", such as trace, or it could be "meta
|
||||||
data" such as logs. These are distinguished using the ``kind`` attribute,
|
data" such as logs. These are distinguished using the ``kind`` attribute,
|
||||||
which also helps WA decide how it should be handled. Currently supported
|
which also helps WA decide how it should be handled. Currently supported
|
||||||
kinds are:
|
kinds are:
|
||||||
|
|
||||||
:log: A log file. Not part of "results" as such but contains
|
:log: A log file. Not part of the "output" as such but contains
|
||||||
information about the run/workload execution that be useful for
|
information about the run/workload execution that be useful for
|
||||||
diagnostics/meta analysis.
|
diagnostics/meta analysis.
|
||||||
:meta: A file containing metadata. This is not part of "results", but
|
:meta: A file containing metadata. This is not part of the "output", but
|
||||||
contains information that may be necessary to reproduce the
|
contains information that may be necessary to reproduce the
|
||||||
results (contrast with ``log`` artifacts which are *not*
|
results (contrast with ``log`` artifacts which are *not*
|
||||||
necessary).
|
necessary).
|
||||||
:data: This file contains new data, not available otherwise and should
|
:data: This file contains new data, not available otherwise and should
|
||||||
be considered part of the "results" generated by WA. Most traces
|
be considered part of the "output" generated by WA. Most traces
|
||||||
would fall into this category.
|
would fall into this category.
|
||||||
:export: Exported version of results or some other artifact. This
|
:export: Exported version of results or some other artifact. This
|
||||||
signifies that this artifact does not contain any new data
|
signifies that this artifact does not contain any new data
|
||||||
@ -325,7 +325,7 @@ class Artifact(object):
|
|||||||
|
|
||||||
.. note: The kind parameter is intended to represent the logical
|
.. note: The kind parameter is intended to represent the logical
|
||||||
function of a particular artifact, not it's intended means of
|
function of a particular artifact, not it's intended means of
|
||||||
processing -- this is left entirely up to the result
|
processing -- this is left entirely up to the output
|
||||||
processors.
|
processors.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@ -344,7 +344,7 @@ class Artifact(object):
|
|||||||
using ``/`` irrespective of the
|
using ``/`` irrespective of the
|
||||||
operating system.
|
operating system.
|
||||||
:param kind: The type of the artifact this is (e.g. log file, result,
|
:param kind: The type of the artifact this is (e.g. log file, result,
|
||||||
etc.) this will be used a hit to result processors. This
|
etc.) this will be used as a hint to output processors. This
|
||||||
must be one of ``'log'``, ``'meta'``, ``'data'``,
|
must be one of ``'log'``, ``'meta'``, ``'data'``,
|
||||||
``'export'``, ``'raw'``.
|
``'export'``, ``'raw'``.
|
||||||
:param description: A free-form description of what this artifact is.
|
:param description: A free-form description of what this artifact is.
|
||||||
|
@ -7,13 +7,13 @@ from wa.framework.plugin import Plugin
|
|||||||
from wa.utils.log import log_error, indent, dedent
|
from wa.utils.log import log_error, indent, dedent
|
||||||
|
|
||||||
|
|
||||||
class ResultProcessor(Plugin):
|
class OutputProcessor(Plugin):
|
||||||
|
|
||||||
kind = 'result_processor'
|
kind = 'output_processor'
|
||||||
requires = []
|
requires = []
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
super(ResultProcessor, self).validate()
|
super(OutputProcessor, self).validate()
|
||||||
for instrument in self.requires:
|
for instrument in self.requires:
|
||||||
if not is_installed(instrument):
|
if not is_installed(instrument):
|
||||||
msg = 'Instrument "{}" is required by {}, but is not installed.'
|
msg = 'Instrument "{}" is required by {}, but is not installed.'
|
||||||
@ -34,8 +34,8 @@ class ProcessorManager(object):
|
|||||||
self.processors = []
|
self.processors = []
|
||||||
|
|
||||||
def install(self, processor, context):
|
def install(self, processor, context):
|
||||||
if not isinstance(processor, ResultProcessor):
|
if not isinstance(processor, OutputProcessor):
|
||||||
processor = self.loader.get_result_processor(processor)
|
processor = self.loader.get_output_processor(processor)
|
||||||
self.logger.debug('Installing {}'.format(processor.name))
|
self.logger.debug('Installing {}'.format(processor.name))
|
||||||
processor.logger.context = context
|
processor.logger.context = context
|
||||||
self.processors.append(processor)
|
self.processors.append(processor)
|
@ -22,7 +22,7 @@ import android.util.Log;
|
|||||||
* deliminating and timing actions. Markers are output to logcat with debug
|
* deliminating and timing actions. Markers are output to logcat with debug
|
||||||
* priority. Actions represent a series of UI interactions to time.
|
* priority. Actions represent a series of UI interactions to time.
|
||||||
*
|
*
|
||||||
* The marker API provides a way for instruments and result processors to hook into
|
* The marker API provides a way for instruments and output processors to hook into
|
||||||
* per-action timings by parsing logcat logs produced per workload iteration.
|
* per-action timings by parsing logcat logs produced per workload iteration.
|
||||||
*
|
*
|
||||||
* The marker output consists of a logcat tag 'UX_PERF' and a message. The
|
* The marker output consists of a logcat tag 'UX_PERF' and a message. The
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import csv
|
import csv
|
||||||
|
|
||||||
from wa import ResultProcessor, Parameter
|
from wa import OutputProcessor, Parameter
|
||||||
from wa.framework.exception import ConfigError
|
from wa.framework.exception import ConfigError
|
||||||
from wa.utils.types import list_of_strings
|
from wa.utils.types import list_of_strings
|
||||||
|
|
||||||
|
|
||||||
class CsvReportProcessor(ResultProcessor):
|
class CsvReportProcessor(OutputProcessor):
|
||||||
|
|
||||||
name = 'csv'
|
name = 'csv'
|
||||||
description = """
|
description = """
|
@ -18,11 +18,11 @@
|
|||||||
import time
|
import time
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
|
|
||||||
from wa import ResultProcessor, Status
|
from wa import OutputProcessor, Status
|
||||||
from wa.utils.misc import write_table
|
from wa.utils.misc import write_table
|
||||||
|
|
||||||
|
|
||||||
class StatusTxtReporter(ResultProcessor):
|
class StatusTxtReporter(OutputProcessor):
|
||||||
name = 'status'
|
name = 'status'
|
||||||
description = """
|
description = """
|
||||||
Outputs a txt file containing general status information about which runs
|
Outputs a txt file containing general status information about which runs
|
@ -1,11 +1,11 @@
|
|||||||
import shutil
|
import shutil
|
||||||
import tarfile
|
import tarfile
|
||||||
|
|
||||||
from wa import ResultProcessor, Parameter
|
from wa import OutputProcessor, Parameter
|
||||||
from wa.framework import signal
|
from wa.framework import signal
|
||||||
|
|
||||||
|
|
||||||
class TargzProcessor(ResultProcessor):
|
class TargzProcessor(OutputProcessor):
|
||||||
|
|
||||||
name = 'targz'
|
name = 'targz'
|
||||||
|
|
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
from wa import ResultProcessor
|
from wa import OutputProcessor
|
||||||
from wa.utils.android import LogcatParser
|
from wa.utils.android import LogcatParser
|
||||||
|
|
||||||
|
|
||||||
class UxperfProcessor(ResultProcessor):
|
class UxperfProcessor(OutputProcessor):
|
||||||
|
|
||||||
name = 'uxperf'
|
name = 'uxperf'
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user