From fc047f31086a4ae806ef317fabdf189b205003e2 Mon Sep 17 00:00:00 2001 From: jianli Date: Fri, 26 Jun 2015 15:29:01 -0700 Subject: [PATCH] Improve registration log in gcm-internals page for Instance ID Changes: 1) The column name "Sender Ids" is renamed to "Source". 2) For deleting an InstanceID token, the source will be passed. 3) Registration retry will now also show delay time, similar to what we did for unregistration retry. BUG=477084 TBR=arv@chromium.org Review URL: https://codereview.chromium.org/1205163003 Cr-Commit-Position: refs/heads/master@{#336466} --- chrome/browser/resources/gcm_internals.html | 2 +- chrome/browser/ui/webui/gcm_internals_ui.cc | 2 +- components/gcm_driver/gcm_activity.h | 3 +- components/gcm_driver/gcm_client_impl.cc | 9 ++++- components/gcm_driver/gcm_stats_recorder_impl.cc | 33 +++++++++------ components/gcm_driver/gcm_stats_recorder_impl.h | 16 +++++--- .../gcm_driver/gcm_stats_recorder_impl_unittest.cc | 47 ++++++++++++---------- google_apis/gcm/engine/registration_request.cc | 9 +++-- google_apis/gcm/engine/unregistration_request.cc | 13 ++++-- google_apis/gcm/engine/unregistration_request.h | 4 +- .../gcm/engine/unregistration_request_unittest.cc | 6 ++- .../gcm/monitoring/fake_gcm_stats_recorder.cc | 13 +++--- .../gcm/monitoring/fake_gcm_stats_recorder.h | 15 ++++--- google_apis/gcm/monitoring/gcm_stats_recorder.h | 18 +++++---- 14 files changed, 116 insertions(+), 74 deletions(-) diff --git a/chrome/browser/resources/gcm_internals.html b/chrome/browser/resources/gcm_internals.html index 48fb41b28cee..faddaa478b1d 100644 --- a/chrome/browser/resources/gcm_internals.html +++ b/chrome/browser/resources/gcm_internals.html @@ -128,7 +128,7 @@ Time App Id - Sender Ids + Source Event Details diff --git a/chrome/browser/ui/webui/gcm_internals_ui.cc b/chrome/browser/ui/webui/gcm_internals_ui.cc index dce561a760ee..bf35824a85f0 100644 --- a/chrome/browser/ui/webui/gcm_internals_ui.cc +++ b/chrome/browser/ui/webui/gcm_internals_ui.cc @@ -66,7 +66,7 @@ void SetRegistrationInfo( row->AppendDouble(it->time.ToJsTime()); row->AppendString(it->app_id); - row->AppendString(it->sender_ids); + row->AppendString(it->source); row->AppendString(it->event); row->AppendString(it->details); } diff --git a/components/gcm_driver/gcm_activity.h b/components/gcm_driver/gcm_activity.h index 2209cb0b4140..55c12901315e 100644 --- a/components/gcm_driver/gcm_activity.h +++ b/components/gcm_driver/gcm_activity.h @@ -40,7 +40,8 @@ struct RegistrationActivity : Activity { ~RegistrationActivity() override; std::string app_id; - std::string sender_ids; // Comma separated sender ids. + // For GCM, comma separated sender ids. For Instance ID, authorized entity. + std::string source; }; // Contains relevant data of a message receiving event. diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc index 972cea17a248..00dbfd132bc0 100644 --- a/components/gcm_driver/gcm_client_impl.cc +++ b/components/gcm_driver/gcm_client_impl.cc @@ -906,7 +906,8 @@ void GCMClientImpl::Register( instance_id_token_info->scope, ConstructGCMVersion(chrome_build_info_.version), instance_id_token_info->options)); - source_to_record = instance_id_token_info->authorized_entity; + source_to_record = instance_id_token_info->authorized_entity + "/" + + instance_id_token_info->scope; } RegistrationRequest::RequestInfo request_info( @@ -970,6 +971,7 @@ void GCMClientImpl::Unregister( DCHECK_EQ(state_, READY); scoped_ptr request_handler; + std::string source_to_record; const GCMRegistrationInfo* gcm_registration_info = GCMRegistrationInfo::FromRegistrationInfo(registration_info.get()); @@ -993,6 +995,8 @@ void GCMClientImpl::Unregister( instance_id_token_info->authorized_entity, instance_id_token_info->scope, ConstructGCMVersion(chrome_build_info_.version))); + source_to_record = instance_id_token_info->authorized_entity + "/" + + instance_id_token_info->scope; } // Remove the registration/token(s) from the cache and the store. @@ -1052,7 +1056,8 @@ void GCMClientImpl::Unregister( request_handler.Pass(), GetGCMBackoffPolicy(), base::Bind(&GCMClientImpl::OnUnregisterCompleted, weak_ptr_factory_.GetWeakPtr(), registration_info), - kMaxUnregistrationRetries, url_request_context_getter_, &recorder_)); + kMaxUnregistrationRetries, url_request_context_getter_, &recorder_, + source_to_record)); unregistration_request->Start(); pending_unregistration_requests_.insert(registration_info, unregistration_request.Pass()); diff --git a/components/gcm_driver/gcm_stats_recorder_impl.cc b/components/gcm_driver/gcm_stats_recorder_impl.cc index 010aa8e5c11c..8b05f6fdf127 100644 --- a/components/gcm_driver/gcm_stats_recorder_impl.cc +++ b/components/gcm_driver/gcm_stats_recorder_impl.cc @@ -272,14 +272,14 @@ void GCMStatsRecorderImpl::RecordConnectionResetSignaled( void GCMStatsRecorderImpl::RecordRegistration( const std::string& app_id, - const std::string& senders, + const std::string& source, const std::string& event, const std::string& details) { RegistrationActivity data; RegistrationActivity* inserted_data = InsertCircularBuffer( ®istration_activities_, data); inserted_data->app_id = app_id; - inserted_data->sender_ids = senders; + inserted_data->source = source; inserted_data->event = event; inserted_data->details = details; NotifyActivityRecorded(); @@ -297,55 +297,62 @@ void GCMStatsRecorderImpl::RecordRegistrationSent( void GCMStatsRecorderImpl::RecordRegistrationResponse( const std::string& app_id, - const std::string& senders, + const std::string& source, RegistrationRequest::Status status) { if (!is_recording_) return; - RecordRegistration(app_id, senders, + RecordRegistration(app_id, source, "Registration response received", GetRegistrationStatusString(status)); } -void GCMStatsRecorderImpl::RecordRegistrationRetryRequested( +void GCMStatsRecorderImpl::RecordRegistrationRetryDelayed( const std::string& app_id, - const std::string& senders, + const std::string& source, + int64 delay_msec, int retries_left) { if (!is_recording_) return; - RecordRegistration(app_id, senders, - "Registration retry requested", - base::StringPrintf("Retries left: %d", retries_left)); + RecordRegistration( + app_id, + source, + "Registration retry delayed", + base::StringPrintf("Delayed for %" PRId64 " msec, retries left: %d", + delay_msec, + retries_left)); } void GCMStatsRecorderImpl::RecordUnregistrationSent( - const std::string& app_id) { + const std::string& app_id, const std::string& source) { UMA_HISTOGRAM_COUNTS("GCM.UnregistrationRequest", 1); if (!is_recording_) return; - RecordRegistration(app_id, std::string(), "Unregistration request sent", + RecordRegistration(app_id, source, "Unregistration request sent", std::string()); } void GCMStatsRecorderImpl::RecordUnregistrationResponse( const std::string& app_id, + const std::string& source, UnregistrationRequest::Status status) { if (!is_recording_) return; RecordRegistration(app_id, - std::string(), + source, "Unregistration response received", GetUnregistrationStatusString(status)); } void GCMStatsRecorderImpl::RecordUnregistrationRetryDelayed( const std::string& app_id, + const std::string& source, int64 delay_msec, int retries_left) { if (!is_recording_) return; RecordRegistration( app_id, - std::string(), + source, "Unregistration retry delayed", base::StringPrintf("Delayed for %" PRId64 " msec, retries left: %d", delay_msec, diff --git a/components/gcm_driver/gcm_stats_recorder_impl.h b/components/gcm_driver/gcm_stats_recorder_impl.h index d09ddf041c6e..de11d49121b0 100644 --- a/components/gcm_driver/gcm_stats_recorder_impl.h +++ b/components/gcm_driver/gcm_stats_recorder_impl.h @@ -55,19 +55,23 @@ class GCMStatsRecorderImpl : public GCMStatsRecorder { void RecordConnectionResetSignaled( ConnectionFactory::ConnectionResetReason reason) override; void RecordRegistrationSent(const std::string& app_id, - const std::string& senders) override; + const std::string& source) override; void RecordRegistrationResponse(const std::string& app_id, - const std::string& senders, + const std::string& source, RegistrationRequest::Status status) override; - void RecordRegistrationRetryRequested( + void RecordRegistrationRetryDelayed( const std::string& app_id, - const std::string& senders, + const std::string& source, + int64 delay_msec, int retries_left) override; - void RecordUnregistrationSent(const std::string& app_id) override; + void RecordUnregistrationSent(const std::string& app_id, + const std::string& source) override; void RecordUnregistrationResponse( const std::string& app_id, + const std::string& source, UnregistrationRequest::Status status) override; void RecordUnregistrationRetryDelayed(const std::string& app_id, + const std::string& source, int64 delay_msec, int retries_left) override; void RecordDataMessageReceived(const std::string& app_id, @@ -120,7 +124,7 @@ class GCMStatsRecorderImpl : public GCMStatsRecorder { const std::string& details); void RecordRegistration(const std::string& app_id, - const std::string& sender_id, + const std::string& source, const std::string& event, const std::string& details); diff --git a/components/gcm_driver/gcm_stats_recorder_impl_unittest.cc b/components/gcm_driver/gcm_stats_recorder_impl_unittest.cc index 871378d79a21..bb8ea313c62a 100644 --- a/components/gcm_driver/gcm_stats_recorder_impl_unittest.cc +++ b/components/gcm_driver/gcm_stats_recorder_impl_unittest.cc @@ -66,9 +66,10 @@ static const char kRegistrationSentDetails[] = ""; static const char kRegistrationResponseEvent[] = "Registration response received"; static const char kRegistrationResponseDetails[] = "SUCCESS"; -static const char kRegistrationRetryRequestedEvent[] = - "Registration retry requested"; -static const char kRegistrationRetryRequestedDetails[] = "Retries left: 3"; +static const char kRegistrationRetryDelayedEvent[] = + "Registration retry delayed"; +static const char kRegistrationRetryDelayedDetails[] = + "Delayed for 15000 msec, retries left: 3"; static const char kUnregistrationSentEvent[] = "Unregistration request sent"; static const char kUnregistrationSentDetails[] = ""; static const char kUnregistrationResponseEvent[] = @@ -213,14 +214,14 @@ class GCMStatsRecorderImplTest : public testing::Test { void VerifyRegistrationRetryRequested(const std::string& remark) { VerifyRegistration(recorder_.registration_activities(), kSenderIds, - kRegistrationRetryRequestedEvent, - kRegistrationRetryRequestedDetails, + kRegistrationRetryDelayedEvent, + kRegistrationRetryDelayedDetails, remark); } void VerifyUnregistrationSent(const std::string& remark) { VerifyRegistration(recorder_.registration_activities(), - std::string(), + kSenderIds, kUnregistrationSentEvent, kUnregistrationSentDetails, remark); @@ -228,7 +229,7 @@ class GCMStatsRecorderImplTest : public testing::Test { void VerifyUnregistrationResponse(const std::string& remark) { VerifyRegistration(recorder_.registration_activities(), - std::string(), + kSenderIds, kUnregistrationResponseEvent, kUnregistrationResponseDetails, remark); @@ -236,7 +237,7 @@ class GCMStatsRecorderImplTest : public testing::Test { void VerifyUnregistrationRetryDelayed(const std::string& remark) { VerifyRegistration(recorder_.registration_activities(), - std::string(), + kSenderIds, kUnregistrationRetryDelayedEvent, kUnregistrationRetryDelayedDetails, remark); @@ -305,12 +306,12 @@ class GCMStatsRecorderImplTest : public testing::Test { void VerifyRegistration( const std::deque& queue, - const std::string& sender_ids, + const std::string& source, const std::string& event, const std::string& details, const std::string& remark) { EXPECT_EQ(kAppId, queue.front().app_id) << remark; - EXPECT_EQ(sender_ids, queue.front().sender_ids) << remark; + EXPECT_EQ(source, queue.front().source) << remark; EXPECT_EQ(event, queue.front().event) << remark; EXPECT_EQ(details, queue.front().details) << remark; } @@ -338,7 +339,7 @@ class GCMStatsRecorderImplTest : public testing::Test { EXPECT_EQ(details, queue.front().details) << remark; } - std::string sender_ids_; + std::string source_; GCMStatsRecorderImpl recorder_; }; @@ -348,7 +349,7 @@ GCMStatsRecorderImplTest::GCMStatsRecorderImplTest(){ GCMStatsRecorderImplTest::~GCMStatsRecorderImplTest() {} void GCMStatsRecorderImplTest::SetUp(){ - sender_ids_ = "s1,s2"; + source_ = "s1,s2"; recorder_.SetRecording(true); } @@ -378,12 +379,13 @@ TEST_F(GCMStatsRecorderImplTest, StartStopRecordingTest) { VerifyAllActivityQueueEmpty("no registration"); recorder_.RecordRegistrationSent(kAppId, kSenderIds); - recorder_.RecordRegistrationResponse(kAppId, sender_ids_, + recorder_.RecordRegistrationResponse(kAppId, source_, kRegistrationStatus); - recorder_.RecordRegistrationRetryRequested(kAppId, sender_ids_, kRetries); - recorder_.RecordUnregistrationSent(kAppId); - recorder_.RecordUnregistrationResponse(kAppId, kUnregistrationStatus); - recorder_.RecordUnregistrationRetryDelayed(kAppId, kDelay, kRetries); + recorder_.RecordRegistrationRetryDelayed(kAppId, source_, kDelay, kRetries); + recorder_.RecordUnregistrationSent(kAppId, source_); + recorder_.RecordUnregistrationResponse( + kAppId, source_, kUnregistrationStatus); + recorder_.RecordUnregistrationRetryDelayed(kAppId, source_, kDelay, kRetries); VerifyAllActivityQueueEmpty("no unregistration"); recorder_.RecordDataMessageReceived(kAppId, kFrom, kByteSize, true, @@ -461,24 +463,25 @@ TEST_F(GCMStatsRecorderImplTest, RegistrationTest) { VerifyRecordedRegistrationCount(1); VerifyRegistrationSent("1st call"); - recorder_.RecordRegistrationResponse(kAppId, sender_ids_, + recorder_.RecordRegistrationResponse(kAppId, source_, kRegistrationStatus); VerifyRecordedRegistrationCount(2); VerifyRegistrationResponse("2nd call"); - recorder_.RecordRegistrationRetryRequested(kAppId, sender_ids_, kRetries); + recorder_.RecordRegistrationRetryDelayed(kAppId, source_, kDelay, kRetries); VerifyRecordedRegistrationCount(3); VerifyRegistrationRetryRequested("3rd call"); - recorder_.RecordUnregistrationSent(kAppId); + recorder_.RecordUnregistrationSent(kAppId, source_); VerifyRecordedRegistrationCount(4); VerifyUnregistrationSent("4th call"); - recorder_.RecordUnregistrationResponse(kAppId, kUnregistrationStatus); + recorder_.RecordUnregistrationResponse( + kAppId, source_, kUnregistrationStatus); VerifyRecordedRegistrationCount(5); VerifyUnregistrationResponse("5th call"); - recorder_.RecordUnregistrationRetryDelayed(kAppId, kDelay, kRetries); + recorder_.RecordUnregistrationRetryDelayed(kAppId, source_, kDelay, kRetries); VerifyRecordedRegistrationCount(6); VerifyUnregistrationRetryDelayed("6th call"); } diff --git a/google_apis/gcm/engine/registration_request.cc b/google_apis/gcm/engine/registration_request.cc index 6537389f1945..a593e2bf8332 100644 --- a/google_apis/gcm/engine/registration_request.cc +++ b/google_apis/gcm/engine/registration_request.cc @@ -167,6 +167,11 @@ void RegistrationRequest::RetryWithBackoff(bool update_backoff) { << request_info_.app_id << ", for " << backoff_entry_.GetTimeUntilRelease().InMilliseconds() << " milliseconds."; + recorder_->RecordRegistrationRetryDelayed( + request_info_.app_id, + source_to_record_, + backoff_entry_.GetTimeUntilRelease().InMilliseconds(), + retries_left_ + 1); base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&RegistrationRequest::RetryWithBackoff, @@ -236,10 +241,6 @@ void RegistrationRequest::OnURLFetchComplete(const net::URLFetcher* source) { if (ShouldRetryWithStatus(status)) { if (retries_left_ > 0) { - recorder_->RecordRegistrationRetryRequested( - request_info_.app_id, - source_to_record_, - retries_left_); RetryWithBackoff(true); return; } diff --git a/google_apis/gcm/engine/unregistration_request.cc b/google_apis/gcm/engine/unregistration_request.cc index f128c1a6ec02..e9fab18f9c64 100644 --- a/google_apis/gcm/engine/unregistration_request.cc +++ b/google_apis/gcm/engine/unregistration_request.cc @@ -59,7 +59,8 @@ UnregistrationRequest::UnregistrationRequest( const UnregistrationCallback& callback, int max_retry_count, scoped_refptr request_context_getter, - GCMStatsRecorder* recorder) + GCMStatsRecorder* recorder, + const std::string& source_to_record) : callback_(callback), request_info_(request_info), custom_request_handler_(custom_request_handler.Pass()), @@ -68,6 +69,7 @@ UnregistrationRequest::UnregistrationRequest( request_context_getter_(request_context_getter), retries_left_(max_retry_count), recorder_(recorder), + source_to_record_(source_to_record), weak_ptr_factory_(this) { DCHECK_GE(max_retry_count, 0); } @@ -95,7 +97,7 @@ void UnregistrationRequest::Start() { url_fetcher_->SetUploadData(kRequestContentType, body); DVLOG(1) << "Performing unregistration for: " << request_info_.app_id; - recorder_->RecordUnregistrationSent(request_info_.app_id); + recorder_->RecordUnregistrationSent(request_info_.app_id, source_to_record_); request_start_time_ = base::TimeTicks::Now(); url_fetcher_->Start(); } @@ -159,6 +161,7 @@ void UnregistrationRequest::RetryWithBackoff(bool update_backoff) { << " milliseconds."; recorder_->RecordUnregistrationRetryDelayed( request_info_.app_id, + source_to_record_, backoff_entry_.GetTimeUntilRelease().InMilliseconds(), retries_left_ + 1); base::MessageLoop::current()->PostDelayedTask( @@ -184,7 +187,8 @@ void UnregistrationRequest::OnURLFetchComplete(const net::URLFetcher* source) { backoff_entry_.failure_count(), base::TimeTicks::Now() - request_start_time_); - recorder_->RecordUnregistrationResponse(request_info_.app_id, status); + recorder_->RecordUnregistrationResponse( + request_info_.app_id, source_to_record_, status); if (status == URL_FETCHING_FAILED || status == HTTP_NOT_OK || @@ -199,7 +203,8 @@ void UnregistrationRequest::OnURLFetchComplete(const net::URLFetcher* source) { } status = REACHED_MAX_RETRIES; - recorder_->RecordUnregistrationResponse(request_info_.app_id, status); + recorder_->RecordUnregistrationResponse( + request_info_.app_id, source_to_record_, status); // Only REACHED_MAX_RETRIES is reported because the function will skip // reporting count and time when status is not SUCCESS. diff --git a/google_apis/gcm/engine/unregistration_request.h b/google_apis/gcm/engine/unregistration_request.h index 501a943bc803..56854255622e 100644 --- a/google_apis/gcm/engine/unregistration_request.h +++ b/google_apis/gcm/engine/unregistration_request.h @@ -105,7 +105,8 @@ class GCM_EXPORT UnregistrationRequest : public net::URLFetcherDelegate { const UnregistrationCallback& callback, int max_retry_count, scoped_refptr request_context_getter, - GCMStatsRecorder* recorder); + GCMStatsRecorder* recorder, + const std::string& source_to_record); ~UnregistrationRequest() override; // Starts an unregistration request. @@ -136,6 +137,7 @@ class GCM_EXPORT UnregistrationRequest : public net::URLFetcherDelegate { // Recorder that records GCM activities for debugging purpose. Not owned. GCMStatsRecorder* recorder_; + std::string source_to_record_; base::WeakPtrFactory weak_ptr_factory_; diff --git a/google_apis/gcm/engine/unregistration_request_unittest.cc b/google_apis/gcm/engine/unregistration_request_unittest.cc index eb555e5f9944..8d1bb33f5568 100644 --- a/google_apis/gcm/engine/unregistration_request_unittest.cc +++ b/google_apis/gcm/engine/unregistration_request_unittest.cc @@ -149,7 +149,8 @@ void GCMUnregistrationRequestTest::CreateRequest() { base::Unretained(this)), max_retry_count_, url_request_context_getter_.get(), - &recorder_)); + &recorder_, + std::string())); } TEST_F(GCMUnregistrationRequestTest, RequestDataPassedToFetcher) { @@ -401,7 +402,8 @@ void InstaceIDDeleteTokenRequestTest::CreateRequest( base::Unretained(this)), max_retry_count(), url_request_context_getter_.get(), - &recorder_)); + &recorder_, + std::string())); } TEST_F(InstaceIDDeleteTokenRequestTest, RequestDataPassedToFetcher) { diff --git a/google_apis/gcm/monitoring/fake_gcm_stats_recorder.cc b/google_apis/gcm/monitoring/fake_gcm_stats_recorder.cc index d4c781e8317b..f2934d45416a 100644 --- a/google_apis/gcm/monitoring/fake_gcm_stats_recorder.cc +++ b/google_apis/gcm/monitoring/fake_gcm_stats_recorder.cc @@ -44,32 +44,35 @@ void FakeGCMStatsRecorder::RecordConnectionResetSignaled( void FakeGCMStatsRecorder::RecordRegistrationSent( const std::string& app_id, - const std::string& senders) { + const std::string& source) { } void FakeGCMStatsRecorder::RecordRegistrationResponse( const std::string& app_id, - const std::string& senders, + const std::string& source, RegistrationRequest::Status status) { } -void FakeGCMStatsRecorder::RecordRegistrationRetryRequested( +void FakeGCMStatsRecorder::RecordRegistrationRetryDelayed( const std::string& app_id, - const std::string& senders, + const std::string& source, + int64 delay_msec, int retries_left) { } void FakeGCMStatsRecorder::RecordUnregistrationSent( - const std::string& app_id) { + const std::string& app_id, const std::string& source) { } void FakeGCMStatsRecorder::RecordUnregistrationResponse( const std::string& app_id, + const std::string& source, UnregistrationRequest::Status status) { } void FakeGCMStatsRecorder::RecordUnregistrationRetryDelayed( const std::string& app_id, + const std::string& source, int64 delay_msec, int retries_left) { } diff --git a/google_apis/gcm/monitoring/fake_gcm_stats_recorder.h b/google_apis/gcm/monitoring/fake_gcm_stats_recorder.h index a48146c071aa..ba8acfdf8bfa 100644 --- a/google_apis/gcm/monitoring/fake_gcm_stats_recorder.h +++ b/google_apis/gcm/monitoring/fake_gcm_stats_recorder.h @@ -26,19 +26,24 @@ class FakeGCMStatsRecorder : public GCMStatsRecorder { void RecordConnectionResetSignaled( ConnectionFactory::ConnectionResetReason reason) override; void RecordRegistrationSent(const std::string& app_id, - const std::string& senders) override; + const std::string& source) override; void RecordRegistrationResponse(const std::string& app_id, - const std::string& senders, + const std::string& source, RegistrationRequest::Status status) override; - void RecordRegistrationRetryRequested( + void RecordRegistrationRetryDelayed( const std::string& app_id, - const std::string& senders, + const std::string& source, + int64 delay_msec, int retries_left) override; - void RecordUnregistrationSent(const std::string& app_id) override; + void RecordUnregistrationSent( + const std::string& app_id, + const std::string& source) override; void RecordUnregistrationResponse( const std::string& app_id, + const std::string& source, UnregistrationRequest::Status status) override; void RecordUnregistrationRetryDelayed(const std::string& app_id, + const std::string& source, int64 delay_msec, int retries_left) override; void RecordDataMessageReceived(const std::string& app_id, diff --git a/google_apis/gcm/monitoring/gcm_stats_recorder.h b/google_apis/gcm/monitoring/gcm_stats_recorder.h index 5b493f840bc4..8a093ebbb823 100644 --- a/google_apis/gcm/monitoring/gcm_stats_recorder.h +++ b/google_apis/gcm/monitoring/gcm_stats_recorder.h @@ -73,33 +73,37 @@ class GCM_EXPORT GCMStatsRecorder { // Records that a registration request has been sent. This could be initiated // directly from API, or from retry logic. virtual void RecordRegistrationSent(const std::string& app_id, - const std::string& senders) = 0; + const std::string& source) = 0; // Records that a registration response has been received from server. virtual void RecordRegistrationResponse( const std::string& app_id, - const std::string& senders, + const std::string& source, RegistrationRequest::Status status) = 0; - // Records that a registration retry has been requested. The actual retry - // action may not occur until some time later according to backoff logic. - virtual void RecordRegistrationRetryRequested( + // Records that a registration retry has been requested and delayed due to + // backoff logic. + virtual void RecordRegistrationRetryDelayed( const std::string& app_id, - const std::string& senders, + const std::string& source, + int64 delay_msec, int retries_left) = 0; // Records that an unregistration request has been sent. This could be // initiated directly from API, or from retry logic. - virtual void RecordUnregistrationSent(const std::string& app_id) = 0; + virtual void RecordUnregistrationSent(const std::string& app_id, + const std::string& source) = 0; // Records that an unregistration response has been received from server. virtual void RecordUnregistrationResponse( const std::string& app_id, + const std::string& source, UnregistrationRequest::Status status) = 0; // Records that an unregistration retry has been requested and delayed due to // backoff logic. virtual void RecordUnregistrationRetryDelayed(const std::string& app_id, + const std::string& source, int64 delay_msec, int retries_left) = 0; -- 2.11.4.GIT