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

Side by Side Diff: content/browser/bluetooth/bluetooth_metrics.h

Issue 1286883002: bluetooth: Add histograms and logging for getCharacteristic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-uma-refactoring
Patch Set: Merge with ToT Created 5 years, 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ 5 #ifndef CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_
6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ 6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // Note: Add new GetPrimaryService outcomes immediately above this line. 90 // Note: Add new GetPrimaryService outcomes immediately above this line.
91 // Make sure to update the enum list in 91 // Make sure to update the enum list in
92 // tools/metrics/histograms/histograms.xml accordingly. 92 // tools/metrics/histograms/histograms.xml accordingly.
93 COUNT 93 COUNT
94 }; 94 };
95 static void RecordGetPrimaryServiceService( 95 static void RecordGetPrimaryServiceService(
96 const device::BluetoothUUID& service); 96 const device::BluetoothUUID& service);
97 static void RecordGetPrimaryServiceOutcome( 97 static void RecordGetPrimaryServiceOutcome(
98 UMAGetPrimaryServiceOutcome outcome); 98 UMAGetPrimaryServiceOutcome outcome);
99 99
100 // getCharacteristic()
101 enum class UMAGetCharacteristicOutcome {
102 SUCCESS = 0,
103 NO_DEVICE = 1,
104 NO_SERVICE = 2,
105 NOT_FOUND = 3,
106 // Note: Add new outcomes immediately above this line.
107 // Make sure to update the enum list in
108 // tools/metrisc/histogram/histograms.xml accordingly.
109 COUNT
110 };
111 static void RecordGetCharacteristicOutcome(
112 UMAGetCharacteristicOutcome outcome);
113 static void RecordGetCharacteristicCharacteristic(
114 const std::string& characteristic);
115
100 // read/write characteristics 116 // read/write characteristics
101 // TODO(ortuno): For now we are just copying over the code to record these 117 // TODO(ortuno): For now we are just copying over the code to record these
102 // errors but a follow up CL will add a function for each operation. 118 // errors but a follow up CL will add a function for each operation.
103 119
104 // These types of errors aren't as common. We log them to understand 120 // These types of errors aren't as common. We log them to understand
105 // how common they are and if we need to investigate more. 121 // how common they are and if we need to investigate more.
106 enum class UMAGATTError { 122 enum class UMAGATTError {
107 UNKNOWN = 0, 123 UNKNOWN = 0,
108 FAILED = 1, 124 FAILED = 1,
109 IN_PROGRESS = 2, 125 IN_PROGRESS = 2,
110 NOT_PAIRED = 3, 126 NOT_PAIRED = 3,
111 // Note: Add new GATT Errors immediately above this line. 127 // Note: Add new GATT Errors immediately above this line.
112 // Make sure to update the enum list in 128 // Make sure to update the enum list in
113 // tools/metrics/histograms/histograms.xml accordingly. 129 // tools/metrics/histograms/histograms.xml accordingly.
114 MAX_ERROR, 130 MAX_ERROR,
115 }; 131 };
116 static void RecordGATTError(UMAGATTError error); 132 static void RecordGATTError(UMAGATTError error);
117 }; 133 };
118 134
119 } // namespace content 135 } // namespace content
120 136
121 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ 137 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698