Backed out changeset bc61502be42e (bug 1313326)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 01 Mar 2017 19:47:09 +0100
changeset 345349 6a3af7c0213856d5c8fde04682d99ed2b82db3c1
parent 345348 c7b0d1ae6e34a99a2f088574865f8e952c50532d
child 345350 a756569e4a3c12b7ce5b34ddf9437f7ac64f64bc
push id31436
push userkwierso@gmail.com
push dateThu, 02 Mar 2017 01:18:52 +0000
treeherdermozilla-central@e91de6fb2b3d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1313326
milestone54.0a1
backs outbc61502be42e77e1dac46183c7a9075768f8292d
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset bc61502be42e (bug 1313326)
toolkit/components/telemetry/ipc/TelemetryIPCAccumulator.cpp
--- a/toolkit/components/telemetry/ipc/TelemetryIPCAccumulator.cpp
+++ b/toolkit/components/telemetry/ipc/TelemetryIPCAccumulator.cpp
@@ -33,22 +33,19 @@ namespace TelemetryIPCAccumulator = mozi
 
 // Sending each remote accumulation immediately places undue strain on the
 // IPC subsystem. Batch the remote accumulations for a period of time before
 // sending them all at once. This value was chosen as a balance between data
 // timeliness and performance (see bug 1218576)
 const uint32_t kBatchTimeoutMs = 2000;
 
 // To stop growing unbounded in memory while waiting for kBatchTimeoutMs to
-// drain the probe accumulation arrays, we request an immediate flush if the
-// arrays manage to reach certain high water mark of elements.
+// drain the g*Accumulations arrays, request an immediate flush if the arrays
+// manage to reach this high water mark of elements.
 const size_t kHistogramAccumulationsArrayHighWaterMark = 5 * 1024;
-// With the current limits, events cost us about 1100 bytes each.
-// This limits memory use to about 10MB.
-const size_t kEventsArrayHighWaterMark = 10000;
 
 // This timer is used for batching and sending child process accumulations to the parent.
 nsITimer* gIPCTimer = nullptr;
 mozilla::Atomic<bool, mozilla::Relaxed> gIPCTimerArmed(false);
 mozilla::Atomic<bool, mozilla::Relaxed> gIPCTimerArming(false);
 
 // This batches child process accumulations that should be sent to the parent.
 StaticAutoPtr<nsTArray<Accumulation>> gHistogramAccumulations;
@@ -182,28 +179,20 @@ void
 TelemetryIPCAccumulator::RecordChildEvent(double timestamp,
                                           const nsACString& category,
                                           const nsACString& method,
                                           const nsACString& object,
                                           const mozilla::Maybe<nsCString>& value,
                                           const nsTArray<mozilla::Telemetry::EventExtraEntry>& extra)
 {
   StaticMutexAutoLock locker(gTelemetryIPCAccumulatorMutex);
-
   if (!gChildEvents) {
     gChildEvents = new nsTArray<ChildEventData>();
   }
-
-  if (gChildEvents->Length() == kEventsArrayHighWaterMark) {
-    TelemetryIPCAccumulator::DispatchToMainThread(NS_NewRunnableFunction([]() -> void {
-      TelemetryIPCAccumulator::IPCTimerFired(nullptr, nullptr);
-    }));
-  }
-
-  // Store the event.
+  // Store the action.
   gChildEvents->AppendElement(ChildEventData{timestamp, nsCString(category),
                                              nsCString(method), nsCString(object),
                                              value,
                                              nsTArray<mozilla::Telemetry::EventExtraEntry>(extra)});
   ArmIPCTimer(locker);
 }
 
 // This method takes the lock only to double-buffer the batched telemetry.