Bug 1346866 - Make the IPC serialization/deserialization time probes main-thread-only, r=billm

MozReview-Commit-ID: 5Sc820Jh494
This commit is contained in:
Michael Layzell
2017-03-13 14:46:19 -04:00
parent 90ce5c6845
commit 4f1d511383
3 changed files with 9 additions and 9 deletions

View File

@@ -786,12 +786,12 @@ MessageChannel::Send(Message* aMsg)
}
// If the message was created by the IPC bindings, the create time will be
// recorded. Use this information to report the IPC_WRITE_LATENCY_MS (time
// recorded. Use this information to report the IPC_WRITE_MAIN_THREAD_LATENCY_MS (time
// from message creation to it being sent).
if (aMsg->create_time()) {
if (NS_IsMainThread() && aMsg->create_time()) {
uint32_t latencyMs = round((mozilla::TimeStamp::Now() - aMsg->create_time()).ToMilliseconds());
if (latencyMs >= kMinTelemetryIPCWriteLatencyMs) {
mozilla::Telemetry::Accumulate(mozilla::Telemetry::IPC_WRITE_LATENCY_MS,
mozilla::Telemetry::Accumulate(mozilla::Telemetry::IPC_WRITE_MAIN_THREAD_LATENCY_MS,
nsDependentCString(aMsg->name()),
latencyMs);
}