Index: components/gcm_driver/gcm_stats_recorder_impl.cc |
diff --git a/components/gcm_driver/gcm_stats_recorder_impl.cc b/components/gcm_driver/gcm_stats_recorder_impl.cc |
index 746d5e3fa801a69e5c9025c794aae8c926b996e4..5b215558d535fd4997ec9715633a851426dcc467 100644 |
--- a/components/gcm_driver/gcm_stats_recorder_impl.cc |
+++ b/components/gcm_driver/gcm_stats_recorder_impl.cc |
@@ -142,7 +142,9 @@ std::string GetUnregistrationStatusString( |
GCMStatsRecorderImpl::GCMStatsRecorderImpl() |
: is_recording_(false), |
- delegate_(NULL) { |
+ delegate_(NULL), |
+ clock_(new base::DefaultClock()), |
+ last_data_message_received_timestamp_(0) { |
} |
GCMStatsRecorderImpl::~GCMStatsRecorderImpl() { |
@@ -362,6 +364,14 @@ void GCMStatsRecorderImpl::RecordDataMessageReceived( |
ReceivedMessageType message_type) { |
if (to_registered_app) |
UMA_HISTOGRAM_COUNTS("GCM.DataMessageReceived", 1); |
+ |
+ int64 new_timestamp = clock_->Now().ToTimeT(); |
jianli
2014/06/19 17:24:06
Why not calling Time::Now()?
juyik
2014/07/15 23:42:12
Done.
|
+ if (last_data_message_received_timestamp_ > 0) { |
fgorski
2014/06/18 20:06:19
will this trigger only after all of the messages t
fgorski
2014/06/20 14:23:45
Ju-Yi, given that the wake-up period during sleep
juyik
2014/07/15 23:42:12
This is triggered every time a data message is con
juyik
2014/07/15 23:42:13
Done. Collapsed all received data message within 2
|
+ UMA_HISTOGRAM_COUNTS("GCM.DataMessageReceivedIntervalSeconds", |
fgorski
2014/06/18 20:06:19
please update histograms as well.
juyik
2014/07/15 23:42:13
Updated the name.
|
+ new_timestamp - last_data_message_received_timestamp_); |
+ } |
+ last_data_message_received_timestamp_ = new_timestamp; |
+ |
if (!is_recording_) |
return; |
if (!to_registered_app) { |