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 "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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 inserted_data->details = details; | 393 inserted_data->details = details; |
394 NotifyActivityRecorded(); | 394 NotifyActivityRecorded(); |
395 } | 395 } |
396 | 396 |
397 void GCMStatsRecorderImpl::RecordDataMessageReceived( | 397 void GCMStatsRecorderImpl::RecordDataMessageReceived( |
398 const std::string& app_id, | 398 const std::string& app_id, |
399 const std::string& from, | 399 const std::string& from, |
400 int message_byte_size, | 400 int message_byte_size, |
401 bool to_registered_app, | 401 bool to_registered_app, |
402 ReceivedMessageType message_type) { | 402 ReceivedMessageType message_type) { |
| 403 UMA_HISTOGRAM_BOOLEAN("GCM.DataMessageReceivedHasRegisteredApp", |
| 404 to_registered_app); |
403 if (to_registered_app) | 405 if (to_registered_app) |
404 UMA_HISTOGRAM_COUNTS("GCM.DataMessageReceived", 1); | 406 UMA_HISTOGRAM_COUNTS("GCM.DataMessageReceived", 1); |
405 | 407 |
406 base::TimeTicks new_timestamp = base::TimeTicks::Now(); | 408 base::TimeTicks new_timestamp = base::TimeTicks::Now(); |
407 if (last_received_data_message_burst_start_time_.is_null()) { | 409 if (last_received_data_message_burst_start_time_.is_null()) { |
408 last_received_data_message_burst_start_time_ = new_timestamp; | 410 last_received_data_message_burst_start_time_ = new_timestamp; |
409 last_received_data_message_time_within_burst_ = new_timestamp; | 411 last_received_data_message_time_within_burst_ = new_timestamp; |
410 received_data_message_burst_size_ = 1; | 412 received_data_message_burst_size_ = 1; |
411 } else if ((new_timestamp - last_received_data_message_burst_start_time_) >= | 413 } else if ((new_timestamp - last_received_data_message_burst_start_time_) >= |
412 base::TimeDelta::FromSeconds( | 414 base::TimeDelta::FromSeconds( |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 const std::string& receiver_id, | 539 const std::string& receiver_id, |
538 const std::string& message_id) { | 540 const std::string& message_id) { |
539 UMA_HISTOGRAM_COUNTS("GCM.IncomingSendErrors", 1); | 541 UMA_HISTOGRAM_COUNTS("GCM.IncomingSendErrors", 1); |
540 if (!is_recording_) | 542 if (!is_recording_) |
541 return; | 543 return; |
542 RecordSending(app_id, receiver_id, message_id, "Received 'send error' msg", | 544 RecordSending(app_id, receiver_id, message_id, "Received 'send error' msg", |
543 std::string()); | 545 std::string()); |
544 } | 546 } |
545 | 547 |
546 } // namespace gcm | 548 } // namespace gcm |
OLD | NEW |