mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-10 05:47:04 +00:00
Bug 1348113 - Part 1: Add the IPC_SYNC_JS_LATENCY_MS probe to track JS sync IPC latency from sendSyncMessage/sendRpcMessage, r=billm
MozReview-Commit-ID: 6ROx87BL18p
This commit is contained in:
parent
ee460f557c
commit
490a6868bf
@ -658,6 +658,7 @@ nsFrameMessageManager::SendMessage(const nsAString& aMessageName,
|
|||||||
|
|
||||||
nsTArray<StructuredCloneData> retval;
|
nsTArray<StructuredCloneData> retval;
|
||||||
|
|
||||||
|
TimeStamp start = TimeStamp::Now();
|
||||||
sSendingSyncMessage |= aIsSync;
|
sSendingSyncMessage |= aIsSync;
|
||||||
bool ok = mCallback->DoSendBlockingMessage(aCx, aMessageName, data, objects,
|
bool ok = mCallback->DoSendBlockingMessage(aCx, aMessageName, data, objects,
|
||||||
aPrincipal, &retval, aIsSync);
|
aPrincipal, &retval, aIsSync);
|
||||||
@ -665,6 +666,12 @@ nsFrameMessageManager::SendMessage(const nsAString& aMessageName,
|
|||||||
sSendingSyncMessage = false;
|
sSendingSyncMessage = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t latencyMs = round((TimeStamp::Now() - start).ToMilliseconds());
|
||||||
|
if (latencyMs >= kMinTelemetrySyncMessageManagerLatencyMs) {
|
||||||
|
Telemetry::Accumulate(Telemetry::IPC_SYNC_MESSAGE_MANAGER_LATENCY_MS,
|
||||||
|
NS_ConvertUTF16toUTF8(aMessageName), latencyMs);
|
||||||
|
}
|
||||||
|
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,10 @@ class MessageManagerReporter;
|
|||||||
|
|
||||||
namespace ipc {
|
namespace ipc {
|
||||||
|
|
||||||
|
// Note: we round the time we spend to the nearest millisecond. So a min value
|
||||||
|
// of 1 ms actually captures from 500us and above.
|
||||||
|
static const uint32_t kMinTelemetrySyncMessageManagerLatencyMs = 1;
|
||||||
|
|
||||||
enum MessageManagerFlags {
|
enum MessageManagerFlags {
|
||||||
MM_CHILD = 0,
|
MM_CHILD = 0,
|
||||||
MM_CHROME = 1,
|
MM_CHROME = 1,
|
||||||
|
@ -11275,5 +11275,16 @@
|
|||||||
"n_buckets": 100,
|
"n_buckets": 100,
|
||||||
"bug_numbers": [1341531],
|
"bug_numbers": [1341531],
|
||||||
"description": "Time (ms) for the APZ handled wheel event to dispatch, but before handlers executing."
|
"description": "Time (ms) for the APZ handled wheel event to dispatch, but before handlers executing."
|
||||||
|
},
|
||||||
|
"IPC_SYNC_MESSAGE_MANAGER_LATENCY_MS": {
|
||||||
|
"alert_emails": ["michael@thelayzells.com"],
|
||||||
|
"bug_numbers": [1348113],
|
||||||
|
"expires_in_version": "60",
|
||||||
|
"kind": "exponential",
|
||||||
|
"low": 32,
|
||||||
|
"high": 750,
|
||||||
|
"n_buckets": 40,
|
||||||
|
"keyed": true,
|
||||||
|
"description": "Measures the number of milliseconds we spend waiting for sync message manager IPC messages to finish sending, keyed by message name. Note: only messages that wait for more than 500 microseconds are included in this probe."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user