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

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

Issue 2704383006: arc: Handle metrics for Auth operations. (Closed)
Patch Set: update histogram.xml to match change Arc.Auth to ArcAuth Created 3 years, 10 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
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 33a82f001cbe9adc2726f57d4ff0a363d47e2028..f764adca5a4f455f3ec4c41127a6275539e28c02 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc
@@ -8,6 +8,7 @@
#include "base/command_line.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_active_directory_enrollment_token_fetcher.h"
@@ -176,6 +177,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:
+ UpdateAuthAttempts("ArcAuth.CheckinAttempts", 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(),

Powered by Google App Engine
This is Rietveld 408576698