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

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

Issue 3007313002: Revert of Plumb trace canonicalUrl through TelemetryInfo. (Closed)
Patch Set: Created 3 years, 3 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.html ('k') | no next file » | 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 8886becf86068046fa5b538907e883a11902eb03..2da120488ed224941b5483bebb27c03f6026df3c 100644
--- a/tracing/tracing/metrics/metric_runner.py
+++ b/tracing/tracing/metrics/metric_runner.py
@@ -32,17 +32,15 @@
return job_module.Job(map_function_handle, None)
def RunMetric(filename, metrics, extra_import_options=None,
- report_progress=True, canonical_url=None):
- filename_url = 'file://' + filename
- if canonical_url is None:
- canonical_url = filename_url
- trace_handle = file_handle.URLFileHandle(canonical_url, filename_url)
- result = RunMetricOnTraceHandles(
- [trace_handle], metrics, extra_import_options, report_progress)
- return result[canonical_url]
+ report_progress=True):
+ result = RunMetricOnTraces(
+ [filename], metrics, extra_import_options, report_progress)
+ return result[filename]
-def RunMetricOnTraceHandles(trace_handles, metrics, extra_import_options=None,
- report_progress=True):
+def RunMetricOnTraces(filenames, metrics,
+ extra_import_options=None, report_progress=True):
+ trace_handles = [
+ file_handle.URLFileHandle(f, 'file://%s' % f) for f in filenames]
job = _GetMetricRunnerHandle(metrics)
with open(os.devnull, 'w') as devnull_f:
o_stream = sys.stdout
@@ -56,13 +54,3 @@
map_results = runner.RunMapper()
return map_results
-
-def RunMetricOnTraces(filenames, metrics,
- extra_import_options=None, report_progress=True):
- trace_handles = []
- for filename in filenames:
- filename_url = 'file://' + filename
- trace_handles.append(file_handle.URLFileHandle(filename_url, filename_url))
-
- return RunMetricOnTraceHandles(trace_handles, metrics, extra_import_options,
- report_progress)
« no previous file with comments | « tracing/tracing/metrics/metric_map_function.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698