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

Unified Diff: perf_insights/perf_insights/map_runner.py

Issue 1417883005: Enable vulcanizing perf_insights mapper Base URL: https://github.com/catapult-project/catapult@master
Patch Set: Undo changes to vinn Created 5 years, 1 month 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 | « no previous file | perf_insights/perf_insights/map_single_trace.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: perf_insights/perf_insights/map_runner.py
diff --git a/perf_insights/perf_insights/map_runner.py b/perf_insights/perf_insights/map_runner.py
index e349e5d0130b8d8d12710d4a0e4e50ba6cb76e78..e66a330fb7b07b755a4fdab171bec91f51f069ca 100644
--- a/perf_insights/perf_insights/map_runner.py
+++ b/perf_insights/perf_insights/map_runner.py
@@ -14,11 +14,14 @@ from perf_insights import value as value_module
from perf_insights.results import gtest_progress_reporter
+import perf_insights_project
+
+
AUTO_JOB_COUNT = 'auto-job-count'
-class MapRunner:
+class MapRunner(object):
def __init__(self, trace_handles, map_function_handle,
- stop_on_error=False, progress_reporter=None):
+ stop_on_error=False, progress_reporter=None, vulcanize=True):
self._map_function_handle = map_function_handle
self._work_queue = queue.Queue()
self._result_queue = queue.Queue()
@@ -32,15 +35,15 @@ class MapRunner:
self._progress_reporter = progress_reporter
for trace_handle in trace_handles:
self._work_queue.put(trace_handle)
+ self._vulcanized_map_single_trace = None
+ self._single_trace_mapper = map_single_trace.SingleTraceMapper(vulcanize)
def _ProcessTrace(self, trace_handle):
run_info = trace_handle.run_info
subresults = results_module.Results()
run_reporter = self._progress_reporter.WillRun(run_info)
- map_single_trace.MapSingleTrace(
- subresults,
- trace_handle,
- self._map_function_handle)
+ self._single_trace_mapper.MapSingleTrace(
+ subresults, trace_handle, self._map_function_handle)
for v in subresults.all_values:
run_reporter.DidAddValue(v)
self._result_queue.put(subresults)
@@ -56,6 +59,12 @@ class MapRunner:
self._work_queue.task_done()
def Run(self, jobs=1, output_formatters=None):
+ try:
+ return self._RunMapTraceJobs(jobs, output_formatters)
+ finally:
+ self._single_trace_mapper.CleanUp()
+
+ def _RunMapTraceJobs(self, jobs, output_formatters):
if jobs == AUTO_JOB_COUNT:
jobs = multiprocessing.cpu_count()
« no previous file with comments | « no previous file | perf_insights/perf_insights/map_single_trace.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698