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 |