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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
408 inserted_data->event = event; | 408 inserted_data->event = event; |
409 inserted_data->details = details; | 409 inserted_data->details = details; |
410 NotifyActivityRecorded(); | 410 NotifyActivityRecorded(); |
411 } | 411 } |
412 | 412 |
413 void GCMStatsRecorderImpl::RecordDataMessageReceived( | 413 void GCMStatsRecorderImpl::RecordDataMessageReceived( |
414 const std::string& app_id, | 414 const std::string& app_id, |
415 const std::string& from, | 415 const std::string& from, |
416 int message_byte_size, | 416 int message_byte_size, |
417 bool to_registered_app, | 417 bool to_registered_app, |
418 ReceivedMessageType message_type) { | 418 ReceivedMessageType message_type, |
419 UMA_HISTOGRAM_BOOLEAN("GCM.DataMessageReceivedHasRegisteredApp", | 419 bool has_collapse_key, |
420 to_registered_app); | 420 int deleted_count) { |
421 if (to_registered_app) | 421 switch (message_type) { |
422 UMA_HISTOGRAM_COUNTS("GCM.DataMessageReceived", 1); | 422 case GCMStatsRecorderImpl::DATA_MESSAGE: |
423 UMA_HISTOGRAM_BOOLEAN("GCM.DataMessageReceivedHasRegisteredApp", | |
Peter Beverloo
2016/12/07 13:44:12
This means that we're not recording this histogram
johnme
2016/12/07 14:29:16
That's deliberate - we don't really care about mes
| |
424 to_registered_app); | |
425 if (to_registered_app) { | |
426 UMA_HISTOGRAM_COUNTS("GCM.DataMessageReceived", 1); | |
427 UMA_HISTOGRAM_BOOLEAN("GCM.DataMessageReceivedHasCollapseKey", | |
428 has_collapse_key); | |
429 } | |
430 break; | |
431 case GCMStatsRecorderImpl::DELETED_MESSAGES: | |
432 if (to_registered_app) | |
433 UMA_HISTOGRAM_COUNTS_1000("GCM.DeletedMessagesReceived", deleted_count); | |
434 break; | |
435 } | |
423 | 436 |
424 base::TimeTicks new_timestamp = base::TimeTicks::Now(); | 437 base::TimeTicks new_timestamp = base::TimeTicks::Now(); |
425 if (last_received_data_message_burst_start_time_.is_null()) { | 438 if (last_received_data_message_burst_start_time_.is_null()) { |
426 last_received_data_message_burst_start_time_ = new_timestamp; | 439 last_received_data_message_burst_start_time_ = new_timestamp; |
427 last_received_data_message_time_within_burst_ = new_timestamp; | 440 last_received_data_message_time_within_burst_ = new_timestamp; |
428 received_data_message_burst_size_ = 1; | 441 received_data_message_burst_size_ = 1; |
429 } else if ((new_timestamp - last_received_data_message_burst_start_time_) >= | 442 } else if ((new_timestamp - last_received_data_message_burst_start_time_) >= |
430 base::TimeDelta::FromSeconds( | 443 base::TimeDelta::FromSeconds( |
431 RECEIVED_DATA_MESSAGE_BURST_LENGTH_SECONDS)) { | 444 RECEIVED_DATA_MESSAGE_BURST_LENGTH_SECONDS)) { |
432 UMA_HISTOGRAM_LONG_TIMES( | 445 UMA_HISTOGRAM_LONG_TIMES( |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
553 const std::string& receiver_id, | 566 const std::string& receiver_id, |
554 const std::string& message_id) { | 567 const std::string& message_id) { |
555 UMA_HISTOGRAM_COUNTS("GCM.IncomingSendErrors", 1); | 568 UMA_HISTOGRAM_COUNTS("GCM.IncomingSendErrors", 1); |
556 if (!is_recording_) | 569 if (!is_recording_) |
557 return; | 570 return; |
558 RecordSending(app_id, receiver_id, message_id, "Received 'send error' msg", | 571 RecordSending(app_id, receiver_id, message_id, "Received 'send error' msg", |
559 std::string()); | 572 std::string()); |
560 } | 573 } |
561 | 574 |
562 } // namespace gcm | 575 } // namespace gcm |
OLD | NEW |