Commit 0cf1e814 authored by Ravi Mistry's avatar Ravi Mistry Committed by Commit Bot

Plumb cloud trace lik to metric_running.RunMetric

This is to fix the trace_analysis_ct benchmark failure mentioned in
https://bugs.chromium.org/p/skia/issues/detail?id=7796#c8
and
https://chromium-review.googlesource.com/c/catapult/+/1035454#message-2b3d62be6599a5733e1af25499c95ec9808138c1

Bug: skia:7796
Change-Id: Ibed7336c9fde57b681e18ad6c0024731693d4430
Reviewed-on: https://chromium-review.googlesource.com/1036202Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Commit-Queue: Ravi Mistry <rmistry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554913}
parent 35d520e5
...@@ -27,20 +27,30 @@ class AnalysisMetricsCT(perf_benchmark.PerfBenchmark): ...@@ -27,20 +27,30 @@ class AnalysisMetricsCT(perf_benchmark.PerfBenchmark):
def AddBenchmarkCommandLineArgs(cls, parser): def AddBenchmarkCommandLineArgs(cls, parser):
super(AnalysisMetricsCT, cls).AddBenchmarkCommandLineArgs(parser) super(AnalysisMetricsCT, cls).AddBenchmarkCommandLineArgs(parser)
ct_benchmarks_util.AddBenchmarkCommandLineArgs(parser) ct_benchmarks_util.AddBenchmarkCommandLineArgs(parser)
parser.add_option('--local-trace-path', type='string',
default=None,
help='The local path to the trace file')
parser.add_option('--cloud-trace-link', type='string',
default=None,
help='Cloud link from where the local trace file was ' +
'downloaded')
parser.add_option('--metric-name', type='string', parser.add_option('--metric-name', type='string',
default=None, default=None,
help='The metric to parse the trace with') help='The metric to parse the trace with')
@classmethod @classmethod
def ProcessCommandLineArgs(cls, parser, args): def ProcessCommandLineArgs(cls, parser, args):
if not args.urls_list: if not args.local_trace_path:
parser.error('Please specify --urls-list') parser.error('Please specify --local-trace-path')
if not args.cloud_trace_link:
parser.error('Please specify --cloud-trace-link')
if not args.metric_name: if not args.metric_name:
parser.error('Please specify --metric-name') parser.error('Please specify --metric-name')
cls.metric_name = args.metric_name cls.metric_name = args.metric_name
def CreateStorySet(self, options): def CreateStorySet(self, options):
return page_set.CTBrowserLessPageSet(options.urls_list) return page_set.CTBrowserLessPageSet(options.local_trace_path,
options.cloud_trace_link)
@classmethod @classmethod
def Name(cls): def Name(cls):
......
...@@ -43,7 +43,8 @@ class LocalTraceMeasurement( ...@@ -43,7 +43,8 @@ class LocalTraceMeasurement(
start = time.time() start = time.time()
mre_result = metric_runner.RunMetric( mre_result = metric_runner.RunMetric(
filename, metrics, extra_import_options, filename, metrics, extra_import_options,
report_progress=False) report_progress=False,
canonical_url=results.current_page.cloud_trace_link)
logging.warning('Processing resulting traces took %.3f seconds' % ( logging.warning('Processing resulting traces took %.3f seconds' % (
time.time() - start)) time.time() - start))
page = results.current_page page = results.current_page
......
...@@ -37,24 +37,25 @@ class CTPage(page_module.Page): ...@@ -37,24 +37,25 @@ class CTPage(page_module.Page):
class LocalTracePath(story.Story): class LocalTracePath(story.Story):
def __init__(self, local_file_path, shared_state_class): def __init__(self, local_trace_path, cloud_trace_link, shared_state_class):
super(LocalTracePath, self).__init__( super(LocalTracePath, self).__init__(
shared_state_class=shared_state_class, shared_state_class=shared_state_class,
name=local_file_path) name=local_trace_path)
self.cloud_trace_link = cloud_trace_link
def Run(self, shared_state): def Run(self, shared_state):
pass pass
class CTBrowserLessPageSet(story.StorySet): class CTBrowserLessPageSet(story.StorySet):
"""Page set used by CT Benchmarks that do not require a browser.""" """Page set used by CT Benchmarks that do not require a browser."""
def __init__(self, local_file_paths): def __init__(self, local_trace_path, cloud_trace_link):
super(CTBrowserLessPageSet, self).__init__() super(CTBrowserLessPageSet, self).__init__()
shared_state_class = shared_browserless_story.SharedBrowserlessStory shared_state_class = shared_browserless_story.SharedBrowserlessStory
for local_file_path in local_file_paths.split(','): self.AddStory(
self.AddStory( LocalTracePath(
LocalTracePath( local_trace_path=local_trace_path,
local_file_path=local_file_path, cloud_trace_link=cloud_trace_link,
shared_state_class=shared_state_class)) shared_state_class=shared_state_class))
class CTPageSet(story.StorySet): class CTPageSet(story.StorySet):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment