summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorsatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-29 05:45:53 +0000
committersatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-29 05:45:53 +0000
commit906eed0d5bb752a29adbfa86054df1bebd507a80 (patch)
treeb705c3c59e7cb4b9e45c67aabddb81489d031539 /chrome/browser
parent3e24bd15777d994e335dfceb3ddb7ff11cb0360f (diff)
downloadchromium_src-906eed0d5bb752a29adbfa86054df1bebd507a80.zip
chromium_src-906eed0d5bb752a29adbfa86054df1bebd507a80.tar.gz
chromium_src-906eed0d5bb752a29adbfa86054df1bebd507a80.tar.bz2
Add user metrics and performance histgrams to the screen locker
BUG=chromium-os:611 TEST=Run chrome with --v=1 and confirmed that the timers worked right Review URL: http://codereview.chromium.org/4097009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64367 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/chromeos/login/screen_locker.cc31
-rw-r--r--chrome/browser/chromeos/login/screen_locker.h6
2 files changed, 35 insertions, 2 deletions
diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc
index 29b6708..a965dd9 100644
--- a/chrome/browser/chromeos/login/screen_locker.cc
+++ b/chrome/browser/chromeos/login/screen_locker.cc
@@ -10,6 +10,7 @@
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/command_line.h"
+#include "base/metrics/histogram.h"
#include "base/message_loop.h"
#include "base/singleton.h"
#include "base/string_util.h"
@@ -507,7 +508,8 @@ ScreenLocker::ScreenLocker(const UserManager::User& user)
// TODO(oshima): support auto login mode (this is not implemented yet)
// http://crosbug.com/1881
unlock_on_input_(user_.email().empty()),
- locked_(false) {
+ locked_(false),
+ start_time_(base::Time::Now()) {
DCHECK(!screen_locker_);
screen_locker_ = this;
}
@@ -571,6 +573,15 @@ void ScreenLocker::Init() {
void ScreenLocker::OnLoginFailure(const LoginFailure& error) {
DVLOG(1) << "OnLoginFailure";
+ UserMetrics::RecordAction(UserMetricsAction("ScreenLocker_OnLoginFailure"));
+ if (authentication_start_time_.is_null()) {
+ LOG(ERROR) << "authentication_start_time_ is not set";
+ } else {
+ base::TimeDelta delta = base::Time::Now() - authentication_start_time_;
+ VLOG(1) << "Authentication failure time: " << delta.InSecondsF();
+ UMA_HISTOGRAM_TIMES("ScreenLocker.AuthenticationFailureTime", delta);
+ }
+
EnableInput();
// Don't enable signout button here as we're showing
// MessageBubble.
@@ -615,6 +626,14 @@ void ScreenLocker::OnLoginSuccess(
const GaiaAuthConsumer::ClientLoginResult& unused,
bool pending_requests) {
VLOG(1) << "OnLoginSuccess: Sending Unlock request.";
+ if (authentication_start_time_.is_null()) {
+ LOG(ERROR) << "authentication_start_time_ is not set";
+ } else {
+ base::TimeDelta delta = base::Time::Now() - authentication_start_time_;
+ VLOG(1) << "Authentication success time: " << delta.InSecondsF();
+ UMA_HISTOGRAM_TIMES("ScreenLocker.AuthenticationSuccessTime", delta);
+ }
+
if (CrosLibrary::Get()->EnsureLoaded())
CrosLibrary::Get()->GetScreenLockLibrary()->NotifyScreenUnlockRequested();
}
@@ -630,6 +649,7 @@ void ScreenLocker::InfoBubbleClosing(InfoBubble* info_bubble,
}
void ScreenLocker::Authenticate(const string16& password) {
+ authentication_start_time_ = base::Time::Now();
screen_lock_view_->SetEnabled(false);
screen_lock_view_->SetSignoutEnabled(false);
BrowserThread::PostTask(
@@ -656,7 +676,7 @@ void ScreenLocker::EnableInput() {
void ScreenLocker::Signout() {
if (!error_info_) {
- // TODO(oshima): record this action in user metrics.
+ UserMetrics::RecordAction(UserMetricsAction("ScreenLocker_Signout"));
if (CrosLibrary::Get()->EnsureLoaded()) {
CrosLibrary::Get()->GetLoginLibrary()->StopSession("");
}
@@ -676,6 +696,7 @@ void ScreenLocker::OnGrabInputs() {
// static
void ScreenLocker::Show() {
VLOG(1) << "In ScreenLocker::Show";
+ UserMetrics::RecordAction(UserMetricsAction("ScreenLocker_Show"));
DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI);
// Exit fullscreen.
@@ -771,6 +792,10 @@ void ScreenLocker::SetAuthenticator(Authenticator* authenticator) {
void ScreenLocker::ScreenLockReady() {
VLOG(1) << "ScreenLockReady: sending completed signal to power manager.";
locked_ = true;
+ base::TimeDelta delta = base::Time::Now() - start_time_;
+ VLOG(1) << "Screen lock time: " << delta.InSecondsF();
+ UMA_HISTOGRAM_TIMES("ScreenLocker.ScreenLockTime", delta);
+
if (background_view_->ScreenSaverEnabled()) {
lock_widget_->GetFocusManager()->RegisterAccelerator(
views::Accelerator(app::VKEY_ESCAPE, false, false, false), this);
@@ -821,6 +846,8 @@ void ScreenLocker::StopScreenSaver() {
void ScreenLocker::StartScreenSaver() {
if (!background_view_->IsScreenSaverVisible()) {
VLOG(1) << "StartScreenSaver";
+ UserMetrics::RecordAction(
+ UserMetricsAction("ScreenLocker_StartScreenSaver"));
background_view_->ShowScreenSaver();
if (screen_lock_view_) {
screen_lock_view_->SetEnabled(false);
diff --git a/chrome/browser/chromeos/login/screen_locker.h b/chrome/browser/chromeos/login/screen_locker.h
index 26f03a8..a4a40e7 100644
--- a/chrome/browser/chromeos/login/screen_locker.h
+++ b/chrome/browser/chromeos/login/screen_locker.h
@@ -9,6 +9,7 @@
#include <string>
#include "base/task.h"
+#include "base/time.h"
#include "chrome/browser/chromeos/login/login_status_consumer.h"
#include "chrome/browser/chromeos/login/message_bubble.h"
#include "chrome/browser/chromeos/login/user_manager.h"
@@ -182,6 +183,11 @@ class ScreenLocker : public LoginStatusConsumer,
// This is used to make sure there is only one screen locker instance.
static ScreenLocker* screen_locker_;
+ // The time when the screen locker object is created.
+ base::Time start_time_;
+ // The time when the authenticaton is started.
+ base::Time authentication_start_time_;
+
DISALLOW_COPY_AND_ASSIGN(ScreenLocker);
};