| OLD | NEW |
| 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 "google_apis/gcm/monitoring/gcm_stats_recorder.h" | 5 #include "google_apis/gcm/monitoring/gcm_stats_recorder.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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 case gcm::UnregistrationRequest::UNKNOWN_ERROR: | 133 case gcm::UnregistrationRequest::UNKNOWN_ERROR: |
| 134 return "UNKNOWN_ERROR"; | 134 return "UNKNOWN_ERROR"; |
| 135 default: | 135 default: |
| 136 NOTREACHED(); | 136 NOTREACHED(); |
| 137 return "UNKNOWN_STATUS"; | 137 return "UNKNOWN_STATUS"; |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace | 141 } // namespace |
| 142 | 142 |
| 143 GCMStatsRecorder::Activity::Activity() | |
| 144 : time(base::Time::Now()) { | |
| 145 } | |
| 146 | |
| 147 GCMStatsRecorder::Activity::~Activity() { | |
| 148 } | |
| 149 | |
| 150 GCMStatsRecorder::CheckinActivity::CheckinActivity() { | |
| 151 } | |
| 152 | |
| 153 GCMStatsRecorder::CheckinActivity::~CheckinActivity() { | |
| 154 } | |
| 155 | |
| 156 GCMStatsRecorder::ConnectionActivity::ConnectionActivity() { | |
| 157 } | |
| 158 | |
| 159 GCMStatsRecorder::ConnectionActivity::~ConnectionActivity() { | |
| 160 } | |
| 161 | |
| 162 GCMStatsRecorder::RegistrationActivity::RegistrationActivity() { | |
| 163 } | |
| 164 | |
| 165 GCMStatsRecorder::RegistrationActivity::~RegistrationActivity() { | |
| 166 } | |
| 167 | |
| 168 GCMStatsRecorder::ReceivingActivity::ReceivingActivity() | |
| 169 : message_byte_size(0) { | |
| 170 } | |
| 171 | |
| 172 GCMStatsRecorder::ReceivingActivity::~ReceivingActivity() { | |
| 173 } | |
| 174 | |
| 175 GCMStatsRecorder::SendingActivity::SendingActivity() { | |
| 176 } | |
| 177 | |
| 178 GCMStatsRecorder::SendingActivity::~SendingActivity() { | |
| 179 } | |
| 180 | |
| 181 GCMStatsRecorder::RecordedActivities::RecordedActivities() { | |
| 182 } | |
| 183 | |
| 184 GCMStatsRecorder::RecordedActivities::~RecordedActivities() { | |
| 185 } | |
| 186 | |
| 187 GCMStatsRecorder::GCMStatsRecorder() : is_recording_(false), delegate_(NULL) { | 143 GCMStatsRecorder::GCMStatsRecorder() : is_recording_(false), delegate_(NULL) { |
| 188 } | 144 } |
| 189 | 145 |
| 190 GCMStatsRecorder::~GCMStatsRecorder() { | 146 GCMStatsRecorder::~GCMStatsRecorder() { |
| 191 } | 147 } |
| 192 | 148 |
| 193 void GCMStatsRecorder::SetRecording(bool recording) { | 149 void GCMStatsRecorder::SetRecording(bool recording) { |
| 194 is_recording_ = recording; | 150 is_recording_ = recording; |
| 195 } | 151 } |
| 196 | 152 |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 const std::string& receiver_id, | 457 const std::string& receiver_id, |
| 502 const std::string& message_id) { | 458 const std::string& message_id) { |
| 503 UMA_HISTOGRAM_COUNTS("GCM.IncomingSendErrors", 1); | 459 UMA_HISTOGRAM_COUNTS("GCM.IncomingSendErrors", 1); |
| 504 if (!is_recording_) | 460 if (!is_recording_) |
| 505 return; | 461 return; |
| 506 RecordSending(app_id, receiver_id, message_id, "Received 'send error' msg", | 462 RecordSending(app_id, receiver_id, message_id, "Received 'send error' msg", |
| 507 std::string()); | 463 std::string()); |
| 508 } | 464 } |
| 509 | 465 |
| 510 } // namespace gcm | 466 } // namespace gcm |
| OLD | NEW |