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

Unified Diff: google_apis/gcm/engine/connection_factory_impl.cc

Issue 123453004: [GCM] Add connection/persistent store metric collection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 11 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 | « no previous file | google_apis/gcm/engine/gcm_store_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/engine/connection_factory_impl.cc
diff --git a/google_apis/gcm/engine/connection_factory_impl.cc b/google_apis/gcm/engine/connection_factory_impl.cc
index 31c225b4d5570b57194ae812efe7d79927cdac65..b9e7f4f1a767722f688bd77ed0bb467bbe55d24c 100644
--- a/google_apis/gcm/engine/connection_factory_impl.cc
+++ b/google_apis/gcm/engine/connection_factory_impl.cc
@@ -5,6 +5,8 @@
#include "google_apis/gcm/engine/connection_factory_impl.h"
#include "base/message_loop/message_loop.h"
+#include "base/metrics/histogram.h"
+#include "base/metrics/sparse_histogram.h"
#include "google_apis/gcm/engine/connection_handler_impl.h"
#include "google_apis/gcm/protocol/mcs.pb.h"
#include "net/base/net_errors.h"
@@ -211,6 +213,7 @@ void ConnectionFactoryImpl::OnConnectDone(int result) {
if (result != net::OK) {
LOG(ERROR) << "Failed to connect to MCS endpoint with error " << result;
backoff_entry_->InformOfRequest(false);
+ UMA_HISTOGRAM_SPARSE_SLOWLY("GCM.ConnectionFailureErrorCode", result);
Connect();
return;
}
@@ -228,6 +231,10 @@ void ConnectionFactoryImpl::ConnectionHandlerCallback(int result) {
backoff_entry_->Reset();
return;
}
+
+ if (!connecting_)
+ UMA_HISTOGRAM_SPARSE_SLOWLY("GCM.ConnectionDisconnectErrorCode", result);
+
// TODO(zea): Consider how to handle errors that may require some sort of
// user intervention (login page, etc.).
LOG(ERROR) << "Connection reset with error " << result;
« no previous file with comments | « no previous file | google_apis/gcm/engine/gcm_store_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698