Bug 1264820 - Measure IPC reply size in telemetry (r=mccr8) a=ritu
authorBill McCloskey <billm@mozilla.com>
Tue, 26 Apr 2016 13:50:56 -0700
changeset 332682 6ed5f604ddd81ca7fd027121ba4a293edc707e63
parent 332681 0b8f7132ed6dd7bcdadcc7a951393664ea95791a
child 332683 ae0bfe3d05cbe8f95566492324531aaf13aa6b38
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8, ritu
bugs1264820
milestone48.0a2
Bug 1264820 - Measure IPC reply size in telemetry (r=mccr8) a=ritu
ipc/glue/MessageChannel.cpp
toolkit/components/telemetry/Histograms.json
--- a/ipc/glue/MessageChannel.cpp
+++ b/ipc/glue/MessageChannel.cpp
@@ -754,17 +754,17 @@ MessageChannel::Echo(Message* aMsg)
     return true;
 }
 
 bool
 MessageChannel::Send(Message* aMsg)
 {
     if (aMsg->capacity() >= kMinTelemetryMessageSize) {
         Telemetry::Accumulate(Telemetry::IPC_MESSAGE_SIZE,
-                              nsCString(aMsg->name()), aMsg->capacity());
+                              nsDependentCString(aMsg->name()), aMsg->capacity());
     }
 
     CxxStackFrame frame(*this, OUT_MESSAGE, aMsg);
 
     nsAutoPtr<Message> msg(aMsg);
     AssertWorkerThread();
     mMonitor->AssertNotCurrentThreadOwns();
     if (MSG_ROUTING_NONE == msg->routing_id()) {
@@ -1054,17 +1054,17 @@ MessageChannel::ProcessPendingRequests(A
     }
 }
 
 bool
 MessageChannel::Send(Message* aMsg, Message* aReply)
 {
     if (aMsg->capacity() >= kMinTelemetryMessageSize) {
         Telemetry::Accumulate(Telemetry::IPC_MESSAGE_SIZE,
-                              nsCString(aMsg->name()), aMsg->capacity());
+                              nsDependentCString(aMsg->name()), aMsg->capacity());
     }
 
     nsAutoPtr<Message> msg(aMsg);
 
     // Sanity checks.
     AssertWorkerThread();
     mMonitor->AssertNotCurrentThreadOwns();
 
@@ -1239,16 +1239,20 @@ MessageChannel::Send(Message* aMsg, Mess
     MOZ_RELEASE_ASSERT(reply);
     MOZ_RELEASE_ASSERT(reply->is_reply(), "expected reply");
     MOZ_RELEASE_ASSERT(!reply->is_reply_error());
     MOZ_RELEASE_ASSERT(reply->seqno() == seqno);
     MOZ_RELEASE_ASSERT(reply->type() == replyType, "wrong reply type");
     MOZ_RELEASE_ASSERT(reply->is_sync());
 
     *aReply = Move(*reply);
+    if (aReply->capacity() >= kMinTelemetryMessageSize) {
+        Telemetry::Accumulate(Telemetry::IPC_REPLY_SIZE,
+                              nsDependentCString(aReply->name()), aReply->capacity());
+    }
     return true;
 }
 
 bool
 MessageChannel::Call(Message* aMsg, Message* aReply)
 {
     nsAutoPtr<Message> msg(aMsg);
     AssertWorkerThread();
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -10560,16 +10560,26 @@
     "bug_numbers": [1260908],
     "expires_in_version": "55",
     "kind": "exponential",
     "high": 8000000,
     "n_buckets": 50,
     "keyed": true,
     "description": "Measures the size of IPC messages by message name"
   },
+  "IPC_REPLY_SIZE": {
+    "alert_emails": ["wmccloskey@mozilla.com"],
+    "bug_numbers": [1264820],
+    "expires_in_version": "55",
+    "kind": "exponential",
+    "high": 8000000,
+    "n_buckets": 50,
+    "keyed": true,
+    "description": "Measures the size of IPC messages by message name"
+  },
   "MESSAGE_MANAGER_MESSAGE_SIZE": {
     "alert_emails": ["wmccloskey@mozilla.com"],
     "bug_numbers": [1260908],
     "expires_in_version": "55",
     "kind": "exponential",
     "high": 8000000,
     "n_buckets": 50,
     "keyed": true,