diff options
author | rharrison@chromium.org <rharrison@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-05 22:03:21 +0000 |
---|---|---|
committer | rharrison@chromium.org <rharrison@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-05 22:03:21 +0000 |
commit | 8d5bd540ada2783c6bf153bf0c57e82996ffd8fb (patch) | |
tree | 16003359df9c352d75c9b805176d27408bd7639d /chromeos | |
parent | 6d3367dda416f9b2a5e23e9c7d41a2c9578d2e40 (diff) | |
download | chromium_src-8d5bd540ada2783c6bf153bf0c57e82996ffd8fb.zip chromium_src-8d5bd540ada2783c6bf153bf0c57e82996ffd8fb.tar.gz chromium_src-8d5bd540ada2783c6bf153bf0c57e82996ffd8fb.tar.bz2 |
Adding metric to tracking the lock screen request code path
For locking the screen we enter a code path were we do a method call, get a
empty reply, and then receive a signal to indicate that chrome can perform the
UI actions for screen locking. We have encountered issues where communication on
this path has failed. A fix for the specific bug has been landed, but we would
still like to track information about how we progress through this path to
detect future issues.
The metric that is being introduced is
"LockScreen.LockScreenPath". This metric replaces the existing
"LockScreen.RequestLockScreen" metric.
BUG=chromium-os:31346
TEST=Built Chrome with CL.
Built ChromeOS image using CL.
Ran image to confirm that no regressions had been introduced.
Ran image and locked screen. Checked histogram populated.
Review URL: https://chromiumcodereview.appspot.com/10543004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140632 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r-- | chromeos/dbus/power_manager_client.cc | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/chromeos/dbus/power_manager_client.cc b/chromeos/dbus/power_manager_client.cc index 6a57552..a1bf3d1 100644 --- a/chromeos/dbus/power_manager_client.cc +++ b/chromeos/dbus/power_manager_client.cc @@ -28,6 +28,14 @@ namespace chromeos { // The PowerManagerClient implementation used in production. class PowerManagerClientImpl : public PowerManagerClient { public: + enum LockScreensState { + LOCK_SCREEN_REQUESTED, // Lock screen is requested. + LOCK_SCREEN_REQUEST_SUCCEEDED, // Method call succeeded. + LOCK_SCREEN_REQUEST_FAILED, // Method call failed. + LOCK_SCREEN_FINISHED, // Signal is received. + NUM_LOCK_SCREEN_STATES + }; + explicit PowerManagerClientImpl(dbus::Bus* bus) : power_manager_proxy_(NULL), screen_locked_(false), @@ -280,6 +288,9 @@ class PowerManagerClientImpl : public PowerManagerClient { virtual void NotifyScreenLockRequested() OVERRIDE { dbus::MethodCall method_call(power_manager::kPowerManagerInterface, power_manager::kRequestLockScreenMethod); + UMA_HISTOGRAM_ENUMERATION("LockScreen.LockScreenPath", + LOCK_SCREEN_REQUESTED, + NUM_LOCK_SCREEN_STATES); power_manager_proxy_->CallMethodWithErrorCallback( &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, @@ -468,7 +479,9 @@ class PowerManagerClientImpl : public PowerManagerClient { } void OnScreenLockRequested(dbus::Response* response) { - UMA_HISTOGRAM_BOOLEAN("LockScreen.RequestLockScreen", true); + UMA_HISTOGRAM_ENUMERATION("LockScreen.LockScreenPath", + LOCK_SCREEN_REQUEST_SUCCEEDED, + NUM_LOCK_SCREEN_STATES); } void OnScreenLockRequestedError(dbus::ErrorResponse* error_response) { @@ -480,7 +493,9 @@ class PowerManagerClientImpl : public PowerManagerClient { << error_response->GetErrorName() << ": " << error_message; } - UMA_HISTOGRAM_BOOLEAN("LockScreen.RequestLockScreen", false); + UMA_HISTOGRAM_ENUMERATION("LockScreen.LockScreenPath", + LOCK_SCREEN_REQUEST_FAILED, + NUM_LOCK_SCREEN_STATES); } void OnGetScreenBrightnessPercent( @@ -505,6 +520,9 @@ class PowerManagerClientImpl : public PowerManagerClient { // if the problem is with dbus or in chrome. LOG(WARNING) << "LockScreen signal received from power manager."; screen_locked_ = true; + UMA_HISTOGRAM_ENUMERATION("LockScreen.LockScreenPath", + LOCK_SCREEN_FINISHED, + NUM_LOCK_SCREEN_STATES); FOR_EACH_OBSERVER(Observer, observers_, LockScreen()); } |