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

Side by Side Diff: components/gcm_driver/gcm_stats_recorder_impl.cc

Issue 1707513002: Add various UMA histograms for measuring GCM crypto performance (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gcm-remove-info
Patch Set: android fix Created 4 years, 10 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 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 #include "components/gcm_driver/gcm_stats_recorder_impl.h" 5 #include "components/gcm_driver/gcm_stats_recorder_impl.h"
6 6
7 #include <deque> 7 #include <deque>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 decryption_failure_activities_.clear(); 166 decryption_failure_activities_.clear();
167 } 167 }
168 168
169 void GCMStatsRecorderImpl::NotifyActivityRecorded() { 169 void GCMStatsRecorderImpl::NotifyActivityRecorded() {
170 if (delegate_) 170 if (delegate_)
171 delegate_->OnActivityRecorded(); 171 delegate_->OnActivityRecorded();
172 } 172 }
173 173
174 void GCMStatsRecorderImpl::RecordDecryptionFailure( 174 void GCMStatsRecorderImpl::RecordDecryptionFailure(
175 const std::string& app_id, 175 const std::string& app_id,
176 GCMEncryptionProvider::DecryptionFailure reason) { 176 GCMEncryptionProvider::DecryptionResult result) {
177 DCHECK_NE(result, GCMEncryptionProvider::DECRYPTION_RESULT_UNENCRYPTED);
178 DCHECK_NE(result, GCMEncryptionProvider::DECRYPTION_RESULT_DECRYPTED);
177 if (!is_recording_) 179 if (!is_recording_)
178 return; 180 return;
179 181
180 DecryptionFailureActivity data; 182 DecryptionFailureActivity data;
181 DecryptionFailureActivity* inserted_data = InsertCircularBuffer( 183 DecryptionFailureActivity* inserted_data = InsertCircularBuffer(
182 &decryption_failure_activities_, data); 184 &decryption_failure_activities_, data);
183 inserted_data->app_id = app_id; 185 inserted_data->app_id = app_id;
184 inserted_data->details = 186 inserted_data->details =
185 GCMEncryptionProvider::ToDecryptionFailureDetailsString(reason); 187 GCMEncryptionProvider::ToDecryptionResultDetailsString(result);
186 188
187 NotifyActivityRecorded(); 189 NotifyActivityRecorded();
188 } 190 }
189 191
190 void GCMStatsRecorderImpl::RecordCheckin( 192 void GCMStatsRecorderImpl::RecordCheckin(
191 const std::string& event, 193 const std::string& event,
192 const std::string& details) { 194 const std::string& details) {
193 CheckinActivity data; 195 CheckinActivity data;
194 CheckinActivity* inserted_data = InsertCircularBuffer( 196 CheckinActivity* inserted_data = InsertCircularBuffer(
195 &checkin_activities_, data); 197 &checkin_activities_, data);
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 const std::string& receiver_id, 537 const std::string& receiver_id,
536 const std::string& message_id) { 538 const std::string& message_id) {
537 UMA_HISTOGRAM_COUNTS("GCM.IncomingSendErrors", 1); 539 UMA_HISTOGRAM_COUNTS("GCM.IncomingSendErrors", 1);
538 if (!is_recording_) 540 if (!is_recording_)
539 return; 541 return;
540 RecordSending(app_id, receiver_id, message_id, "Received 'send error' msg", 542 RecordSending(app_id, receiver_id, message_id, "Received 'send error' msg",
541 std::string()); 543 std::string());
542 } 544 }
543 545
544 } // namespace gcm 546 } // namespace gcm
OLDNEW
« no previous file with comments | « components/gcm_driver/gcm_stats_recorder_impl.h ('k') | components/gcm_driver/gcm_stats_recorder_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698