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

Unified Diff: chrome/browser/chromeos/arc/arc_auth_service.cc

Issue 2734983002: [Merge M57] arc: Handle metrics for Auth operations. (Closed)
Patch Set: fix merge conflict/manually tested with/without android changes Created 3 years, 9 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 | « chrome/browser/chromeos/arc/arc_auth_service.h ('k') | chrome/browser/chromeos/arc/arc_optin_uma.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/arc/arc_auth_service.cc
diff --git a/chrome/browser/chromeos/arc/arc_auth_service.cc b/chrome/browser/chromeos/arc/arc_auth_service.cc
index b765ba6573cb5089d4248811087ed757671c2011..eaf5b760a76b3e7be4913f7c683db0286c153d06 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc
@@ -9,6 +9,7 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
+#include "base/time/time.h"
#include "chrome/browser/chromeos/arc/arc_optin_uma.h"
#include "chrome/browser/chromeos/arc/arc_session_manager.h"
#include "chrome/browser/chromeos/arc/auth/arc_auth_code_fetcher.h"
@@ -170,6 +171,27 @@ void ArcAuthService::RequestAccountInfo() {
weak_ptr_factory_.GetWeakPtr())));
}
+void ArcAuthService::ReportMetrics(mojom::MetricsType metrics_type,
+ int32_t value) {
+ switch (metrics_type) {
+ case mojom::MetricsType::NETWORK_WAITING_TIME_MILLISECONDS:
+ UpdateAuthTiming("ArcAuth.NetworkWaitTime",
+ base::TimeDelta::FromMilliseconds(value));
+ break;
+ case mojom::MetricsType::CHECKIN_ATTEMPTS:
+ UpdateAuthCheckinAttempts(value);
+ break;
+ case mojom::MetricsType::CHECKIN_TIME_MILLISECONDS:
+ UpdateAuthTiming("ArcAuth.CheckinTime",
+ base::TimeDelta::FromMilliseconds(value));
+ break;
+ case mojom::MetricsType::SIGNIN_TIME_MILLISECONDS:
+ UpdateAuthTiming("ArcAuth.SignInTime",
+ base::TimeDelta::FromMilliseconds(value));
+ break;
+ }
+}
+
void ArcAuthService::OnAccountInfoReady(mojom::AccountInfoPtr account_info) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
auto* instance = ARC_GET_INSTANCE_FOR_METHOD(arc_bridge_service()->auth(),
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_service.h ('k') | chrome/browser/chromeos/arc/arc_optin_uma.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698