| Index: telemetry/telemetry/internal/results/page_test_results.py
|
| diff --git a/telemetry/telemetry/internal/results/page_test_results.py b/telemetry/telemetry/internal/results/page_test_results.py
|
| index ff709d316ae3055eb8ba7d351caac30618f4b3bd..6a279d7fffc681d427f37b3a677f92de74dd81f4 100644
|
| --- a/telemetry/telemetry/internal/results/page_test_results.py
|
| +++ b/telemetry/telemetry/internal/results/page_test_results.py
|
| @@ -31,7 +31,7 @@
|
| from tracing.value.diagnostics import reserved_infos
|
|
|
| class TelemetryInfo(object):
|
| - def __init__(self, upload_bucket=None, output_dir=None):
|
| + def __init__(self):
|
| self._benchmark_name = None
|
| self._benchmark_start_epoch = None
|
| self._benchmark_interrupted = False
|
| @@ -41,14 +41,6 @@
|
| self._story_grouping_keys = {}
|
| self._storyset_repeat_counter = 0
|
| self._trace_start_ms = None
|
| - self._upload_bucket = upload_bucket
|
| - self._trace_remote_path = None
|
| - self._output_dir = output_dir
|
| - self._trace_local_path = None
|
| -
|
| - @property
|
| - def upload_bucket(self):
|
| - return self._upload_bucket
|
|
|
| @property
|
| def benchmark_name(self):
|
| @@ -112,45 +104,6 @@
|
| self._story_grouping_keys = story.grouping_keys
|
| self._story_tags = story.tags
|
| self._storyset_repeat_counter = storyset_repeat_counter
|
| -
|
| - trace_basepath = (
|
| - story.file_safe_name + '_' +
|
| - datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S') + '.html')
|
| -
|
| - if self._upload_bucket:
|
| - self._trace_remote_path = trace_basepath
|
| -
|
| - if self._output_dir:
|
| - self._trace_local_path = os.path.abspath(os.path.join(
|
| - self._output_dir, trace_basepath))
|
| -
|
| - @property
|
| - def trace_local_path(self):
|
| - return self._trace_local_path
|
| -
|
| - @property
|
| - def trace_local_url(self):
|
| - if self._trace_local_path is None:
|
| - return None
|
| - return 'file://' + self._trace_local_path
|
| -
|
| - @property
|
| - def trace_remote_path(self):
|
| - return self._trace_remote_path
|
| -
|
| - @property
|
| - def trace_remote_url(self):
|
| - if self._upload_bucket is None or self._trace_remote_path is None:
|
| - return None
|
| - return 'https://console.developers.google.com/m/cloudstorage/b/%s/o/%s' % (
|
| - self._upload_bucket, self._trace_remote_path)
|
| -
|
| - @property
|
| - def trace_url(self):
|
| - # This is MRE's canonicalUrl.
|
| - if self._upload_bucket is None:
|
| - return self.trace_local_url
|
| - return self.trace_remote_url
|
|
|
| def AsDict(self):
|
| assert self.benchmark_name is not None, (
|
| @@ -167,9 +120,6 @@
|
| '%s:%s' % kv for kv in self.story_grouping_keys.iteritems()]
|
| d[reserved_infos.STORYSET_REPEATS.name] = [self.storyset_repeat_counter]
|
| d[reserved_infos.TRACE_START.name] = self.trace_start_ms
|
| - trace_url = self.trace_url
|
| - if trace_url is not None:
|
| - d[reserved_infos.TRACE_URLS.name] = [trace_url]
|
| return d
|
|
|
|
|
| @@ -177,7 +127,7 @@
|
| def __init__(self, output_formatters=None,
|
| progress_reporter=None, trace_tag='', output_dir=None,
|
| value_can_be_added_predicate=lambda v, is_first: True,
|
| - benchmark_enabled=True, upload_bucket=None):
|
| + benchmark_enabled=True):
|
| """
|
| Args:
|
| output_formatters: A list of output formatters. The output
|
| @@ -218,8 +168,7 @@
|
|
|
| self._histograms = histogram_set.HistogramSet()
|
|
|
| - self._telemetry_info = TelemetryInfo(
|
| - upload_bucket=upload_bucket, output_dir=output_dir)
|
| + self._telemetry_info = TelemetryInfo()
|
|
|
| # State of the benchmark this set of results represents.
|
| self._benchmark_enabled = benchmark_enabled
|
| @@ -377,7 +326,8 @@
|
| assert not self._current_page_run, 'Did not call DidRunPage.'
|
| self._current_page_run = story_run.StoryRun(page)
|
| self._progress_reporter.WillRunPage(self)
|
| - self.telemetry_info.WillRunStory(page, storyset_repeat_counter)
|
| + self.telemetry_info.WillRunStory(
|
| + page, storyset_repeat_counter)
|
|
|
| def DidRunPage(self, page): # pylint: disable=unused-argument
|
| """
|
| @@ -449,7 +399,7 @@
|
| any(isinstance(o, (json_output_formatter.JsonOutputFormatter,
|
| html_output_formatter.HtmlOutputFormatter))
|
| for o in self._output_formatters)):
|
| - self._SerializeTracesToDirPath()
|
| + self._SerializeTracesToDirPath(self._output_dir)
|
| for output_formatter in self._output_formatters:
|
| output_formatter.Format(self)
|
| output_formatter.PrintViewResults()
|
| @@ -484,19 +434,18 @@
|
| def FindAllTraceValues(self):
|
| return self.FindValues(lambda v: isinstance(v, trace.TraceValue))
|
|
|
| - def _SerializeTracesToDirPath(self):
|
| + def _SerializeTracesToDirPath(self, dir_path):
|
| """ Serialize all trace values to files in dir_path and return a list of
|
| file handles to those files. """
|
| for value in self.FindAllTraceValues():
|
| - fh = value.Serialize()
|
| + fh = value.Serialize(dir_path)
|
| self._serialized_trace_file_ids_to_paths[fh.id] = fh.GetAbsPath()
|
|
|
| - def UploadTraceFilesToCloud(self):
|
| + def UploadTraceFilesToCloud(self, bucket):
|
| for value in self.FindAllTraceValues():
|
| - value.UploadToCloud()
|
| -
|
| - def UploadProfilingFilesToCloud(self):
|
| - bucket = self.telemetry_info.upload_bucket
|
| + value.UploadToCloud(bucket)
|
| +
|
| + def UploadProfilingFilesToCloud(self, bucket):
|
| for page, file_handle_list in self._pages_to_profiling_files.iteritems():
|
| for file_handle in file_handle_list:
|
| remote_path = ('profiler-file-id_%s-%s%-d%s' % (
|
|
|