summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mojo/edk/system/node_controller.cc4
-rw-r--r--tools/metrics/histograms/histograms.xml9
2 files changed, 13 insertions, 0 deletions
diff --git a/mojo/edk/system/node_controller.cc b/mojo/edk/system/node_controller.cc
index 698238d..58c87e2 100644
--- a/mojo/edk/system/node_controller.cc
+++ b/mojo/edk/system/node_controller.cc
@@ -14,6 +14,7 @@
#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram_macros.h"
#include "base/process/process_handle.h"
+#include "base/timer/elapsed_timer.h"
#include "crypto/random.h"
#include "mojo/edk/embedder/embedder_internal.h"
#include "mojo/edk/embedder/platform_channel_pair.h"
@@ -143,8 +144,11 @@ void NodeController::ConnectToParent(ScopedPlatformHandle platform_handle) {
#if defined(OS_POSIX) && !defined(OS_MACOSX)
// On posix, use the bootstrap channel for the broker and receive the node's
// channel synchronously as the first message from the broker.
+ base::ElapsedTimer timer;
broker_.reset(new Broker(std::move(platform_handle)));
platform_handle = broker_->GetParentPlatformHandle();
+ UMA_HISTOGRAM_TIMES("Mojo.System.GetParentPlatformHandleSyncTime",
+ timer.Elapsed());
#endif
io_task_runner_->PostTask(
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index 02c325c..3a70aa9 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -22237,6 +22237,15 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary>
</histogram>
+<histogram name="Mojo.System.GetParentPlatformHandleSyncTime" units="ms">
+ <owner>rockot@chromium.org</owner>
+ <summary>
+ Measures the time it takes for a child to receive its parent platform handle
+ synchronously from the broker on startup. This only applies to the subset of
+ platforms on which the sync broker is used.
+ </summary>
+</histogram>
+
<histogram name="Mojo.System.Node.ConnectedPeers">
<owner>rockot@chromium.org</owner>
<summary>