Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: tracing/tracing/metrics/metric_runner.py

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tracing/tracing/metrics/metric_map_function_test.html ('k') | tracing/tracing/metrics/sample_metric.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/metrics/metric_runner.py
diff --git a/tracing/tracing/metrics/metric_runner.py b/tracing/tracing/metrics/metric_runner.py
index 62ac454ed42b917501c02a55db0b6f985d74f58c..743861992ca431ae12a4a0169b24bdf1f9da6ac5 100644
--- a/tracing/tracing/metrics/metric_runner.py
+++ b/tracing/tracing/metrics/metric_runner.py
@@ -16,30 +16,31 @@ _METRIC_MAP_FUNCTION_NAME = 'metricMapFunction'
def _GetMetricsDir():
return os.path.dirname(os.path.abspath(__file__))
-def _GetMetricRunnerHandle(metric):
- assert isinstance(metric, basestring)
+def _GetMetricRunnerHandle(metrics):
+ assert isinstance(metrics, list)
+ for metric in metrics:
+ assert isinstance(metric, basestring)
metrics_dir = _GetMetricsDir()
metric_mapper_path = os.path.join(metrics_dir, _METRIC_MAP_FUNCTION_FILENAME)
modules_to_load = [function_handle.ModuleToLoad(filename=metric_mapper_path)]
- options = {'metric': metric}
+ options = {'metrics': metrics}
map_function_handle = function_handle.FunctionHandle(
modules_to_load, _METRIC_MAP_FUNCTION_NAME, options)
return job_module.Job(map_function_handle, None)
-def RunMetric(filename, metric, extra_import_options=None):
- result = RunMetricOnTraces([filename], metric, extra_import_options)
+def RunMetric(filename, metrics, extra_import_options=None):
+ result = RunMetricOnTraces([filename], metrics, extra_import_options)
return result[filename]
-def RunMetricOnTraces(filenames, metric,
+def RunMetricOnTraces(filenames, metrics,
extra_import_options=None):
trace_handles = [
file_handle.URLFileHandle(f, 'file://%s' % f) for f in filenames]
- job = _GetMetricRunnerHandle(metric)
+ job = _GetMetricRunnerHandle(metrics)
runner = map_runner.MapRunner(
- trace_handles, job,
- extra_import_options=extra_import_options,
+ trace_handles, job, extra_import_options=extra_import_options,
progress_reporter=progress_reporter.ProgressReporter())
map_results = runner.RunMapper()
return map_results
« no previous file with comments | « tracing/tracing/metrics/metric_map_function_test.html ('k') | tracing/tracing/metrics/sample_metric.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698