diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-22 03:25:35 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-22 03:25:35 +0000 |
commit | 6a2a61d68c4011a6ff4697dc636b8e84f296d9fa (patch) | |
tree | cd704b26fb6089fa73a662cefab130c584c5df39 /chrome/browser/browser_main.cc | |
parent | 23f919a74a2deedf4e49391f60ff2c36d9710c54 (diff) | |
download | chromium_src-6a2a61d68c4011a6ff4697dc636b8e84f296d9fa.zip chromium_src-6a2a61d68c4011a6ff4697dc636b8e84f296d9fa.tar.gz chromium_src-6a2a61d68c4011a6ff4697dc636b8e84f296d9fa.tar.bz2 |
Record logout time stats for Chrome OS.
Record lougout time stats and dump it to /tmp/logout-times-sent.
ShutdownTime.Logout, ShutdownTime.UIMessageLoopEnded, and
ShutdownTime.BrowserDeleted will be sent to UMA, as well.
% cat /tmp/logout-times-sent
ShutdownTime.Logout: 0.39
0.00 +0.00 LogoutStarted
0.00 +0.00 ShutdownDetected
0.02 +0.02 StartedClosingWindows
0.27 +0.25 UIMessageLoopEnded
0.27 +0.00 BrowserShutdownStarted
0.39 +0.12 BrowserDeleted
0.39 +0.00 BrowserMainEnded
Along the way, change BootTimesLoader to append data to existing
/tmp/uptime-* files just like /sbin/bootstat does, so we can collect
numbers from 2nd login as well.
BUG=chromium-os:6847
TEST=confirmed that /tmp/login-times-sent and /tmp/logout-times-sent are written properly.
Review URL: http://codereview.chromium.org/4973002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66923 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_main.cc')
-rw-r--r-- | chrome/browser/browser_main.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index a92805e..e7afaff 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -510,6 +510,10 @@ void RunUIMessageLoop(BrowserProcess* browser_process) { #elif defined(OS_POSIX) MessageLoopForUI::current()->Run(); #endif +#if defined(OS_CHROMEOS) + chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("UIMessageLoopEnded", + true); +#endif TRACE_EVENT_END("BrowserMain:MESSAGE_LOOP", 0, ""); } @@ -1671,6 +1675,13 @@ int BrowserMain(const MainFunctionParams& parameters) { ignore_result(browser_process.release()); browser_shutdown::Shutdown(); +#if defined(OS_CHROMEOS) + // To be precise, logout (browser shutdown) is not yet done, but the + // remaining work is negligible, hence we say LogoutDone here. + chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", + false); + chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); +#endif TRACE_EVENT_END("BrowserMain", 0, 0); return result_code; } |