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

Side by Side Diff: tools/perf/metrics/keychain_metric.py

Issue 1029263003: [telemetry] Sort imports in Telemetry and its dependents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ensure we're up to date. Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « tools/perf/metrics/cpu.py ('k') | tools/perf/metrics/loading.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 logging 5 import logging
6 import sys 6 import sys
7 7
8 from metrics import Metric
9 from telemetry.util.mac import keychain_helper 8 from telemetry.util.mac import keychain_helper
10 from telemetry.value import histogram_util 9 from telemetry.value import histogram_util
11 from telemetry.value import scalar 10 from telemetry.value import scalar
12 11
12 from metrics import Metric
13
13 14
14 class KeychainMetric(Metric): 15 class KeychainMetric(Metric):
15 """KeychainMetric gathers keychain statistics from the browser object. 16 """KeychainMetric gathers keychain statistics from the browser object.
16 17
17 This includes the number of times that the keychain was accessed. 18 This includes the number of times that the keychain was accessed.
18 """ 19 """
19 20
20 DISPLAY_NAME = 'OSX_Keychain_Access' 21 DISPLAY_NAME = 'OSX_Keychain_Access'
21 HISTOGRAM_NAME = 'OSX.Keychain.Access' 22 HISTOGRAM_NAME = 'OSX.Keychain.Access'
22 23
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 """Adds the number of times that the keychain was accessed to |results|. 66 """Adds the number of times that the keychain was accessed to |results|.
66 Has no effect on non-Mac platforms.""" 67 Has no effect on non-Mac platforms."""
67 if sys.platform != 'darwin': 68 if sys.platform != 'darwin':
68 return 69 return
69 70
70 access_count = histogram_util.GetHistogramSum( 71 access_count = histogram_util.GetHistogramSum(
71 histogram_util.BROWSER_HISTOGRAM, KeychainMetric.HISTOGRAM_NAME, tab) 72 histogram_util.BROWSER_HISTOGRAM, KeychainMetric.HISTOGRAM_NAME, tab)
72 results.AddValue(scalar.ScalarValue( 73 results.AddValue(scalar.ScalarValue(
73 results.current_page, KeychainMetric.DISPLAY_NAME, 'count', 74 results.current_page, KeychainMetric.DISPLAY_NAME, 'count',
74 access_count)) 75 access_count))
OLDNEW
« no previous file with comments | « tools/perf/metrics/cpu.py ('k') | tools/perf/metrics/loading.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698