Bug 1304790 - Add a telemetry probe that measures how long it takes for a content process to start up and communicate back to the parent, r?mconley data-r?francois
MozReview-Commit-ID: 5OaeqZXL6zS
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -1786,16 +1786,17 @@ ContentParent::LaunchSubprocess(ProcessP
SetReplyTimeoutMs(Preferences::GetInt("dom.ipc.cpow.timeout", 0));
return true;
}
ContentParent::ContentParent(ContentParent* aOpener,
const nsAString& aRemoteType)
: nsIContentParent()
+ , mLaunchTS(TimeStamp::Now())
, mOpener(aOpener)
, mRemoteType(aRemoteType)
, mIsForBrowser(!mRemoteType.IsEmpty())
{
InitializeMembers(); // Perform common initialization.
// Insert ourselves into the global linked list of ContentParent objects.
if (!sContentParents) {
@@ -2500,16 +2501,20 @@ ContentParent::RecvGetXPCOMProcessAttrib
InfallibleTArray<nsString>* dictionaries,
ClipboardCapabilities* clipboardCaps,
DomainPolicyClone* domainPolicy,
StructuredCloneData* aInitialData,
InfallibleTArray<FontFamilyListEntry>* fontFamilies,
OptionalURIParams* aUserContentCSSURL,
nsTArray<LookAndFeelInt>* aLookAndFeelIntCache)
{
+ Telemetry::Accumulate(Telemetry::CONTENT_PROCESS_LAUNCH_TIME_MS,
+ static_cast<uint32_t>((TimeStamp::Now() - mLaunchTS)
+ .ToMilliseconds()));
+
nsCOMPtr<nsIIOService> io(do_GetIOService());
MOZ_ASSERT(io, "No IO service?");
DebugOnly<nsresult> rv = io->GetOffline(aIsOffline);
MOZ_ASSERT(NS_SUCCEEDED(rv), "Failed getting offline?");
rv = io->GetConnectivity(aIsConnected);
MOZ_ASSERT(NS_SUCCEEDED(rv), "Failed getting connectivity?");
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -12,16 +12,17 @@
#include "mozilla/gfx/gfxVarReceiver.h"
#include "mozilla/gfx/GPUProcessListener.h"
#include "mozilla/ipc/GeckoChildProcessHost.h"
#include "mozilla/Attributes.h"
#include "mozilla/FileUtils.h"
#include "mozilla/HalTypes.h"
#include "mozilla/LinkedList.h"
#include "mozilla/StaticPtr.h"
+#include "mozilla/TimeStamp.h"
#include "mozilla/UniquePtr.h"
#include "nsDataHashtable.h"
#include "nsFrameMessageManager.h"
#include "nsHashKeys.h"
#include "nsIObserver.h"
#include "nsIThreadInternal.h"
#include "nsIDOMGeoPositionCallback.h"
@@ -1091,16 +1092,17 @@ public:
private:
// If you add strong pointers to cycle collected objects here, be sure to
// release these objects in ShutDownProcess. See the comment there for more
// details.
GeckoChildProcessHost* mSubprocess;
+ const TimeStamp mLaunchTS; // used to calculate time to start content process
ContentParent* mOpener;
nsString mRemoteType;
ContentParentId mChildID;
int32_t mGeolocationWatchID;
nsCString mKillHardAnnotation;
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -181,16 +181,26 @@
},
"COMPOSITE_FRAME_ROUNDTRIP_TIME" : {
"expires_in_version": "never",
"description": "Time from vsync to finishing a composite in milliseconds.",
"kind": "exponential",
"high": 1000,
"n_buckets": 50
},
+ "CONTENT_PROCESS_LAUNCH_TIME_MS" : {
+ "alert_emails": ["bsmedberg@mozilla.com", "mconley@mozilla.com"],
+ "expires_in_version": "57",
+ "bug_numbers": [1304790],
+ "kind": "exponential",
+ "high": 64000,
+ "n_buckets": 100,
+ "releaseChannelCollection": "opt-out",
+ "description": "Content process launch time until the GetXPCOMProcessAttributes message is received, from in milliseconds"
+ },
"CONTENT_RESPONSE_DURATION" : {
"alert_emails": ["kgupta@mozilla.com"],
"bug_numbers": [1261373],
"expires_in_version": "55",
"description": "Main thread response times for APZ notifications about input events (ms)",
"kind" : "exponential",
"high": 60000,
"n_buckets": 50