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

--HG--
extra : rebase_source : 481daa6ef6b05f9c83698ffa39ed7334cd108b8c
This commit is contained in:
Benjamin Smedberg 2016-12-09 08:52:28 -10:00
Родитель 8d1051edff
Коммит 80f9ae8dda
3 изменённых файлов: 17 добавлений и 0 удалений

Просмотреть файл

@ -1791,6 +1791,7 @@ ContentParent::LaunchSubprocess(ProcessPriority aInitialPriority /* = PROCESS_PR
ContentParent::ContentParent(ContentParent* aOpener,
const nsAString& aRemoteType)
: nsIContentParent()
, mLaunchTS(TimeStamp::Now())
, mOpener(aOpener)
, mRemoteType(aRemoteType)
, mIsForBrowser(!mRemoteType.IsEmpty())
@ -2505,6 +2506,10 @@ ContentParent::RecvGetXPCOMProcessAttributes(bool* aIsOffline,
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);

Просмотреть файл

@ -17,6 +17,7 @@
#include "mozilla/HalTypes.h"
#include "mozilla/LinkedList.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/UniquePtr.h"
#include "nsDataHashtable.h"
@ -1096,6 +1097,7 @@ private:
// details.
GeckoChildProcessHost* mSubprocess;
const TimeStamp mLaunchTS; // used to calculate time to start content process
ContentParent* mOpener;
nsString mRemoteType;

Просмотреть файл

@ -186,6 +186,16 @@
"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, in milliseconds"
},
"CONTENT_RESPONSE_DURATION" : {
"alert_emails": ["kgupta@mozilla.com"],
"bug_numbers": [1261373],