Bug 1897060 - Gather process lifetime telemetry r=ipc-reviewers,mccr8

Differential Revision: https://phabricator.services.mozilla.com/D210751
This commit is contained in:
Paul Bone 2024-05-18 02:05:50 +00:00
parent c171f6282b
commit 532849a1b0
2 changed files with 21 additions and 0 deletions

View file

@ -2039,6 +2039,14 @@ void ContentParent::ActorDestroy(ActorDestroyReason why) {
MOZ_FUZZING_IPC_DROP_PEER("ContentParent::ActorDestroy");
#endif
// Gather process lifetime telemetry.
if (StringBeginsWith(mRemoteType, WEB_REMOTE_TYPE) ||
mRemoteType == FILE_REMOTE_TYPE || mRemoteType == EXTENSION_REMOTE_TYPE) {
TimeDuration runtime = TimeStamp::Now() - mActivateTS;
Telemetry::Accumulate(Telemetry::PROCESS_LIFETIME,
uint64_t(runtime.ToSeconds()));
}
if (mSendShutdownTimer) {
mSendShutdownTimer->Cancel();
mSendShutdownTimer = nullptr;

View file

@ -1790,6 +1790,19 @@
"description": "Number of PHC slots allocated-then-freed",
"releaseChannelCollection": "opt-out"
},
"PROCESS_LIFETIME": {
"record_in_processes": ["main"],
"products": ["firefox"],
"alert_emails": ["pbone@mozilla.com"],
"bug_numbers": [1897060],
"expires_in_version": "135",
"kind": "exponential",
"low": 15,
"high": 86400,
"n_buckets": 24,
"description": "Average lifetime of a content process in seconds",
"releaseChannelCollection": "opt-out"
},
"FONTLIST_INITOTHERFAMILYNAMES": {
"record_in_processes": ["main", "content"],