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

Unified Diff: tools/telemetry/telemetry/page/page_set_archive_info.py

Issue 298863016: Adds extra logging to telemetry in hope it helps diagnose issue 351143 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 7 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 | « tools/telemetry/telemetry/page/cloud_storage.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/page_set_archive_info.py
diff --git a/tools/telemetry/telemetry/page/page_set_archive_info.py b/tools/telemetry/telemetry/page/page_set_archive_info.py
index c9a7959f589e752768d820f9263055dca7359dad..a93f33eb32c2ce68982200d299208698402a3b40 100644
--- a/tools/telemetry/telemetry/page/page_set_archive_info.py
+++ b/tools/telemetry/telemetry/page/page_set_archive_info.py
@@ -8,6 +8,7 @@ import os
import re
import shutil
+from telemetry.core.backends.chrome import cros_interface
from telemetry.page import cloud_storage
@@ -22,16 +23,28 @@ class PageSetArchiveInfo(object):
# Download all .wpr files.
if not ignore_archive:
+ # TODO(tbarzic): Remove this once http://crbug.com/351143 is diagnosed.
+ log_cloud_storage_exception = cros_interface.IsRunningOnCrosDevice()
for archive_path in data['archives']:
archive_path = self._WprFileNameToPath(archive_path)
try:
cloud_storage.GetIfChanged(archive_path)
- except (cloud_storage.CredentialsError, cloud_storage.PermissionError):
+ except (cloud_storage.CredentialsError,
+ cloud_storage.PermissionError) as e:
if os.path.exists(archive_path):
# If the archive exists, assume the user recorded their own and
# simply warn.
logging.warning('Need credentials to update WPR archive: %s',
archive_path)
+ elif log_cloud_storage_exception:
+ # Log access errors only once, as they should stay the same in other
+ # iterations.
+ log_cloud_storage_exception = False
+ logging.warning('Error getting WPR archive %s: %s ' %
+ (archive_path, str(e)))
+ logging.info(
+ 'HOME: "%s"; USER: "%s"' %
+ (os.environ.get('HOME', ''), os.environ.get('USER', '')))
# Map from the relative path (as it appears in the metadata file) of the
# .wpr file to a list of page names it supports.
@@ -53,6 +66,9 @@ class PageSetArchiveInfo(object):
with open(file_path, 'r') as f:
data = json.load(f)
return cls(file_path, data, ignore_archive=ignore_archive)
+ # TODO(tbarzic): Remove this once http://crbug.com/351143 is diagnosed.
+ if cros_interface.IsRunningOnCrosDevice():
+ logging.warning('Page set archives not found: %s' % file_path)
return cls(file_path, {'archives': {}}, ignore_archive=ignore_archive)
def WprFilePathForPage(self, page):
« no previous file with comments | « tools/telemetry/telemetry/page/cloud_storage.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698