Commit d2f9d2b6 authored by Ned Nguyen's avatar Ned Nguyen Committed by Commit Bot

Remove keychain metrics

These days, perf bots are managed by swarming service. If needed, it's better
to address keychain issues with swarming infra instead. Removing the keychain
metrics help clean the code of speedometer benchmark.

Bug: 714231
Change-Id: I3d18bc8da20f904cb254d3d1b2b016a4de05b203
Reviewed-on: https://chromium-review.googlesource.com/c/1312968Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
Reviewed-by: default avatarEmily Hanley <eyaich@chromium.org>
Commit-Queue: Ned Nguyen <nednguyen@google.com>
Cr-Commit-Position: refs/heads/master@{#604629}
parent c20a6343
...@@ -26,8 +26,6 @@ from telemetry.page import legacy_page_test ...@@ -26,8 +26,6 @@ from telemetry.page import legacy_page_test
from telemetry import story from telemetry import story
from telemetry.value import list_of_scalar_values from telemetry.value import list_of_scalar_values
from metrics import keychain_metric
class SpeedometerMeasurement(legacy_page_test.LegacyPageTest): class SpeedometerMeasurement(legacy_page_test.LegacyPageTest):
enabled_suites = [ enabled_suites = [
...@@ -43,9 +41,6 @@ class SpeedometerMeasurement(legacy_page_test.LegacyPageTest): ...@@ -43,9 +41,6 @@ class SpeedometerMeasurement(legacy_page_test.LegacyPageTest):
def __init__(self): def __init__(self):
super(SpeedometerMeasurement, self).__init__() super(SpeedometerMeasurement, self).__init__()
def CustomizeBrowserOptions(self, options):
keychain_metric.KeychainMetric.CustomizeBrowserOptions(options)
def ValidateAndMeasurePage(self, page, tab, results): def ValidateAndMeasurePage(self, page, tab, results):
tab.WaitForDocumentReadyStateToBeComplete() tab.WaitForDocumentReadyStateToBeComplete()
iterationCount = 10 iterationCount = 10
...@@ -92,7 +87,6 @@ class SpeedometerMeasurement(legacy_page_test.LegacyPageTest): ...@@ -92,7 +87,6 @@ class SpeedometerMeasurement(legacy_page_test.LegacyPageTest):
suite_times; suite_times;
""", """,
key=suite_name), important=False)) key=suite_name), important=False))
keychain_metric.KeychainMetric().AddResults(tab, results)
@benchmark.Info(emails=['hablich@chromium.org'], @benchmark.Info(emails=['hablich@chromium.org'],
......
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import sys
from telemetry.util.mac import keychain_helper
from telemetry.value import histogram_util
from telemetry.value import scalar
from metrics import Metric
class KeychainMetric(Metric):
"""KeychainMetric gathers keychain statistics from the browser object.
This includes the number of times that the keychain was accessed.
"""
DISPLAY_NAME = 'OSX_Keychain_Access'
HISTOGRAM_NAME = 'OSX.Keychain.Access'
@staticmethod
def _CheckKeychainConfiguration():
"""On OSX, it is possible for a misconfigured keychain to cause the
Telemetry tests to stall.
This method confirms that the keychain is in a sane state that will
not cause this behavior. Three conditions are checked:
- The keychain is unlocked.
- The keychain will not auto-lock after a period of time.
- The ACLs are correctly configured on the relevant keychain items.
"""
warning_suffix = ('which will cause some Telemetry tests to stall when run'
' on a headless machine (e.g. perf bot).')
if keychain_helper.IsKeychainLocked():
logging.warning('The default keychain is locked, %s', warning_suffix)
if keychain_helper.DoesKeychainHaveTimeout():
logging.warning('The default keychain is configured to automatically'
' lock itself have a period of time, %s', warning_suffix)
chrome_acl_configured = (keychain_helper.
IsKeychainConfiguredForBotsWithChrome())
chromium_acl_configured = (keychain_helper.
IsKeychainConfiguredForBotsWithChromium())
acl_warning = ('A commonly used %s key stored in the default keychain does'
' not give decryption access to all applications, %s')
if not chrome_acl_configured:
logging.warning(acl_warning, 'Chrome', warning_suffix)
if not chromium_acl_configured:
logging.warning(acl_warning, 'Chromium', warning_suffix)
@classmethod
def CustomizeBrowserOptions(cls, options):
"""Adds a browser argument that allows for the collection of keychain
metrics. Has no effect on non-Mac platforms.
"""
if sys.platform != 'darwin':
return
KeychainMetric._CheckKeychainConfiguration()
options.AppendExtraBrowserArgs(['--enable-stats-collection-bindings'])
def AddResults(self, tab, results):
"""Adds the number of times that the keychain was accessed to |results|.
Has no effect on non-Mac platforms.
"""
if sys.platform != 'darwin':
return
access_count = histogram_util.GetHistogramSum(
histogram_util.BROWSER_HISTOGRAM, KeychainMetric.HISTOGRAM_NAME, tab)
results.AddValue(scalar.ScalarValue(
results.current_page, KeychainMetric.DISPLAY_NAME, 'count',
access_count))
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