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

Unified Diff: components/gcm_driver/gcm_stats_recorder_impl.cc

Issue 344613003: Record GCM received data message intervals in UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/gcm_driver/gcm_stats_recorder_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « components/gcm_driver/gcm_stats_recorder_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698