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

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

Issue 2367373002: Track the ratio of received GCM messages for registered applications (Closed)
Patch Set: Created 4 years, 2 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "components/gcm_driver/gcm_stats_recorder_android.h" 7 #include "components/gcm_driver/gcm_stats_recorder_android.h"
8 8
9 namespace gcm { 9 namespace gcm {
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 registration_activities_.pop_back(); 99 registration_activities_.pop_back();
100 100
101 if (delegate_) 101 if (delegate_)
102 delegate_->OnActivityRecorded(); 102 delegate_->OnActivityRecorded();
103 } 103 }
104 104
105 void GCMStatsRecorderAndroid::RecordDataMessageReceived( 105 void GCMStatsRecorderAndroid::RecordDataMessageReceived(
106 const std::string& app_id, 106 const std::string& app_id,
107 const std::string& from, 107 const std::string& from,
108 int message_byte_size) { 108 int message_byte_size) {
109 // Active registrations are maintained by Android, not Chrome, so any
110 // received data message is per definition still registered.
111 UMA_HISTOGRAM_BOOLEAN("GCM.DataMessageReceivedHasRegisteredApp", true);
johnme 2016/09/26 13:29:13 I'd lean towards not logging this - it feels misle
Peter Beverloo 2016/09/26 13:31:42 Done.
112
109 if (!is_recording_) 113 if (!is_recording_)
110 return; 114 return;
111 115
112 ReceivingActivity activity; 116 ReceivingActivity activity;
113 activity.app_id = app_id; 117 activity.app_id = app_id;
114 activity.from = from; 118 activity.from = from;
115 activity.message_byte_size = message_byte_size; 119 activity.message_byte_size = message_byte_size;
116 activity.event = "Data msg received"; 120 activity.event = "Data msg received";
117 121
118 receiving_activities_.push_front(activity); 122 receiving_activities_.push_front(activity);
(...skipping 19 matching lines...) Expand all
138 142
139 decryption_failure_activities_.push_front(activity); 143 decryption_failure_activities_.push_front(activity);
140 if (decryption_failure_activities_.size() > MAX_LOGGED_ACTIVITY_COUNT) 144 if (decryption_failure_activities_.size() > MAX_LOGGED_ACTIVITY_COUNT)
141 decryption_failure_activities_.pop_back(); 145 decryption_failure_activities_.pop_back();
142 146
143 if (delegate_) 147 if (delegate_)
144 delegate_->OnActivityRecorded(); 148 delegate_->OnActivityRecorded();
145 } 149 }
146 150
147 } // namespace gcm 151 } // namespace gcm
OLDNEW
« no previous file with comments | « no previous file | components/gcm_driver/gcm_stats_recorder_impl.cc » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698