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

Unified Diff: chrome/browser/process_singleton_win.cc

Issue 2399233002: Add histograms to the rendez-vous process (ProcessSingleton). (Closed)
Patch Set: fix compile Created 4 years, 2 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/process_singleton_posix.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/process_singleton_win.cc
diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc
index 442458e086bc0edf3a04ac6040707f7486ff63be..c33fd1a511bb9effbd0a2c9d8546b644ca4f05d8 100644
--- a/chrome/browser/process_singleton_win.cc
+++ b/chrome/browser/process_singleton_win.cc
@@ -13,6 +13,7 @@
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/macros.h"
+#include "base/metrics/histogram_macros.h"
#include "base/process/process.h"
#include "base/process/process_info.h"
#include "base/strings/string_number_conversions.h"
@@ -281,12 +282,22 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
ProcessSingleton::NotifyResult
ProcessSingleton::NotifyOtherProcessOrCreate() {
+ const base::TimeTicks begin_ticks = base::TimeTicks::Now();
for (int i = 0; i < 2; ++i) {
if (Create()) {
+ UMA_HISTOGRAM_MEDIUM_TIMES("Chrome.ProcessSingleton.TimeToCreate",
+ base::TimeTicks::Now() - begin_ticks);
return PROCESS_NONE; // This is the single browser process.
}
ProcessSingleton::NotifyResult result = NotifyOtherProcess();
if (result == PROCESS_NOTIFIED || result == LOCK_ERROR) {
+ if (result == PROCESS_NOTIFIED) {
+ UMA_HISTOGRAM_MEDIUM_TIMES("Chrome.ProcessSingleton.TimeToNotify",
+ base::TimeTicks::Now() - begin_ticks);
+ } else {
+ UMA_HISTOGRAM_MEDIUM_TIMES("Chrome.ProcessSingleton.TimeToFailure",
+ base::TimeTicks::Now() - begin_ticks);
+ }
// The single browser process was notified, the user chose not to
// terminate a hung browser, or the lock file could not be created.
// Nothing more to do.
@@ -297,6 +308,8 @@ ProcessSingleton::NotifyOtherProcessOrCreate() {
// terminated. Retry once if this is the first time; otherwise, fall through
// to report that the process must exit because the profile is in use.
}
+ UMA_HISTOGRAM_MEDIUM_TIMES("Chrome.ProcessSingleton.TimeToFailure",
+ base::TimeTicks::Now() - begin_ticks);
return PROFILE_IN_USE;
}
« no previous file with comments | « chrome/browser/process_singleton_posix.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698