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

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

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 #include "content/browser/bluetooth/bluetooth_metrics.h" 5 #include "content/browser/bluetooth/bluetooth_metrics.h"
6 6
7 #include "base/hash.h" 7 #include "base/hash.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/metrics/sparse_histogram.h" 9 #include "base/metrics/sparse_histogram.h"
10 #include "content/common/bluetooth/bluetooth_scan_filter.h" 10 #include "content/common/bluetooth/bluetooth_scan_filter.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 133 }
134 134
135 // static 135 // static
136 void BluetoothMetrics::RecordGetPrimaryServiceOutcome( 136 void BluetoothMetrics::RecordGetPrimaryServiceOutcome(
137 UMAGetPrimaryServiceOutcome outcome) { 137 UMAGetPrimaryServiceOutcome outcome) {
138 UMA_HISTOGRAM_ENUMERATION( 138 UMA_HISTOGRAM_ENUMERATION(
139 "Bluetooth.Web.GetPrimaryService.Outcome", static_cast<int>(outcome), 139 "Bluetooth.Web.GetPrimaryService.Outcome", static_cast<int>(outcome),
140 static_cast<int>(UMAGetPrimaryServiceOutcome::COUNT)); 140 static_cast<int>(UMAGetPrimaryServiceOutcome::COUNT));
141 } 141 }
142 142
143 // getCharacteristic
144
145 // static
146 void BluetoothMetrics::RecordGetCharacteristicOutcome(
147 UMAGetCharacteristicOutcome outcome) {
148 UMA_HISTOGRAM_ENUMERATION(
149 "Bluetooth.Web.GetCharacteristic.Outcome", static_cast<int>(outcome),
150 static_cast<int>(UMAGetCharacteristicOutcome::COUNT));
151 }
152
153 // static
154 void BluetoothMetrics::RecordGetCharacteristicCharacteristic(
155 const std::string& characteristic) {
156 UMA_HISTOGRAM_SPARSE_SLOWLY("Bluetooth.Web.GetCharacteristic.Characteristic",
157 HashUUID(characteristic));
158 }
159
143 // read/write characteristic 160 // read/write characteristic
144 161
145 // static 162 // static
146 void BluetoothMetrics::RecordGATTError(UMAGATTError error) { 163 void BluetoothMetrics::RecordGATTError(UMAGATTError error) {
147 UMA_HISTOGRAM_ENUMERATION("Bluetooth.GATTErrors", static_cast<int>(error), 164 UMA_HISTOGRAM_ENUMERATION("Bluetooth.GATTErrors", static_cast<int>(error),
148 static_cast<int>(UMAGATTError::MAX_ERROR)); 165 static_cast<int>(UMAGATTError::MAX_ERROR));
149 } 166 }
150 167
151 } // namespace content 168 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698