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

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: Fix Typoe 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
« no previous file with comments | « content/browser/bluetooth/bluetooth_metrics.h ('k') | tools/metrics/histograms/histograms.xml » ('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 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 <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include "base/hash.h" 9 #include "base/hash.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 UMA_HISTOGRAM_SPARSE_SLOWLY("Bluetooth.Web.GetPrimaryService.Services", 119 UMA_HISTOGRAM_SPARSE_SLOWLY("Bluetooth.Web.GetPrimaryService.Services",
120 HashUUID(service.canonical_value())); 120 HashUUID(service.canonical_value()));
121 } 121 }
122 122
123 void RecordGetPrimaryServiceOutcome(UMAGetPrimaryServiceOutcome outcome) { 123 void RecordGetPrimaryServiceOutcome(UMAGetPrimaryServiceOutcome outcome) {
124 UMA_HISTOGRAM_ENUMERATION( 124 UMA_HISTOGRAM_ENUMERATION(
125 "Bluetooth.Web.GetPrimaryService.Outcome", static_cast<int>(outcome), 125 "Bluetooth.Web.GetPrimaryService.Outcome", static_cast<int>(outcome),
126 static_cast<int>(UMAGetPrimaryServiceOutcome::COUNT)); 126 static_cast<int>(UMAGetPrimaryServiceOutcome::COUNT));
127 } 127 }
128 128
129 // getCharacteristic
130
131 void RecordGetCharacteristicOutcome(UMAGetCharacteristicOutcome outcome) {
132 UMA_HISTOGRAM_ENUMERATION(
133 "Bluetooth.Web.GetCharacteristic.Outcome", static_cast<int>(outcome),
134 static_cast<int>(UMAGetCharacteristicOutcome::COUNT));
135 }
136
137 void RecordGetCharacteristicCharacteristic(const std::string& characteristic) {
138 UMA_HISTOGRAM_SPARSE_SLOWLY("Bluetooth.Web.GetCharacteristic.Characteristic",
139 HashUUID(characteristic));
140 }
141
129 // read/write characteristic 142 // read/write characteristic
130 143
131 void RecordGATTError(UMAGATTError error) { 144 void RecordGATTError(UMAGATTError error) {
132 UMA_HISTOGRAM_ENUMERATION("Bluetooth.GATTErrors", static_cast<int>(error), 145 UMA_HISTOGRAM_ENUMERATION("Bluetooth.GATTErrors", static_cast<int>(error),
133 static_cast<int>(UMAGATTError::MAX_ERROR)); 146 static_cast<int>(UMAGATTError::MAX_ERROR));
134 } 147 }
135 148
136 } // namespace content 149 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/bluetooth/bluetooth_metrics.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698