OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import collections | 5 import collections |
6 import copy | 6 import copy |
7 import datetime | 7 import datetime |
8 import json | 8 import json |
9 import logging | 9 import logging |
10 import os | 10 import os |
11 import random | 11 import random |
12 import sys | 12 import sys |
13 import tempfile | 13 import tempfile |
14 import time | 14 import time |
15 import traceback | 15 import traceback |
16 | 16 |
17 from py_utils import cloud_storage # pylint: disable=import-error | 17 from py_utils import cloud_storage # pylint: disable=import-error |
18 | 18 |
19 from telemetry import value as value_module | 19 from telemetry import value as value_module |
20 from telemetry.internal.results import chart_json_output_formatter | 20 from telemetry.internal.results import chart_json_output_formatter |
21 from telemetry.internal.results import json_output_formatter | |
22 from telemetry.internal.results import html_output_formatter | 21 from telemetry.internal.results import html_output_formatter |
23 from telemetry.internal.results import progress_reporter as reporter_module | 22 from telemetry.internal.results import progress_reporter as reporter_module |
24 from telemetry.internal.results import story_run | 23 from telemetry.internal.results import story_run |
25 from telemetry.value import failure | 24 from telemetry.value import failure |
26 from telemetry.value import skip | 25 from telemetry.value import skip |
27 from telemetry.value import trace | 26 from telemetry.value import trace |
28 | 27 |
29 from tracing.value import convert_chart_json | 28 from tracing.value import convert_chart_json |
30 from tracing.value import histogram_set | 29 from tracing.value import histogram_set |
31 from tracing.value.diagnostics import reserved_infos | 30 from tracing.value.diagnostics import reserved_infos |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 representative_value = self._representative_value_for_each_value_name[ | 388 representative_value = self._representative_value_for_each_value_name[ |
390 value.name] | 389 value.name] |
391 assert value.IsMergableWith(representative_value) | 390 assert value.IsMergableWith(representative_value) |
392 | 391 |
393 def PrintSummary(self): | 392 def PrintSummary(self): |
394 if self._benchmark_enabled: | 393 if self._benchmark_enabled: |
395 self._progress_reporter.DidFinishAllTests(self) | 394 self._progress_reporter.DidFinishAllTests(self) |
396 | 395 |
397 # Only serialize the trace if output_format is json or html. | 396 # Only serialize the trace if output_format is json or html. |
398 if (self._output_dir and | 397 if (self._output_dir and |
399 any(isinstance(o, (json_output_formatter.JsonOutputFormatter, | 398 any(isinstance(o, html_output_formatter.HtmlOutputFormatter) |
400 html_output_formatter.HtmlOutputFormatter)) | |
401 for o in self._output_formatters)): | 399 for o in self._output_formatters)): |
402 self._SerializeTracesToDirPath(self._output_dir) | 400 self._SerializeTracesToDirPath(self._output_dir) |
403 for output_formatter in self._output_formatters: | 401 for output_formatter in self._output_formatters: |
404 output_formatter.Format(self) | 402 output_formatter.Format(self) |
405 output_formatter.PrintViewResults() | 403 output_formatter.PrintViewResults() |
406 else: | 404 else: |
407 for output_formatter in self._output_formatters: | 405 for output_formatter in self._output_formatters: |
408 output_formatter.FormatDisabled(self) | 406 output_formatter.FormatDisabled(self) |
409 | 407 |
410 def FindValues(self, predicate): | 408 def FindValues(self, predicate): |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 try: | 454 try: |
457 cloud_url = cloud_storage.Insert( | 455 cloud_url = cloud_storage.Insert( |
458 bucket, remote_path, file_handle.GetAbsPath()) | 456 bucket, remote_path, file_handle.GetAbsPath()) |
459 sys.stderr.write( | 457 sys.stderr.write( |
460 'View generated profiler files online at %s for page %s\n' % | 458 'View generated profiler files online at %s for page %s\n' % |
461 (cloud_url, page.name)) | 459 (cloud_url, page.name)) |
462 self._pages_to_profiling_files_cloud_url[page].append(cloud_url) | 460 self._pages_to_profiling_files_cloud_url[page].append(cloud_url) |
463 except cloud_storage.PermissionError as e: | 461 except cloud_storage.PermissionError as e: |
464 logging.error('Cannot upload profiling files to cloud storage due to ' | 462 logging.error('Cannot upload profiling files to cloud storage due to ' |
465 ' permission error: %s', e.message) | 463 ' permission error: %s', e.message) |
OLD | NEW |