Bug 1637318 - Add GC_BUDGET_MS_2 telemetry and mark GC_BUDGET_MS for expiry r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Fri, 15 May 2020 15:54:16 +0000
changeset 531284 9888d95d59ec4ea6ebb0a4988b5bb9ee3303b8b0
parent 531283 4f905a241359cbd5177b98121a4967581bba2832
child 531285 06a2edc40fb18ebba1b11508c5c52875c44d8192
push id37436
push userncsoregi@mozilla.com
push dateWed, 20 May 2020 21:30:50 +0000
treeherdermozilla-central@6c10970490f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1637318
milestone78.0a1
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
Bug 1637318 - Add GC_BUDGET_MS_2 telemetry and mark GC_BUDGET_MS for expiry r=sfink Depends on D75523 Differential Revision: https://phabricator.services.mozilla.com/D75524
js/src/gc/Statistics.cpp
js/src/jsfriendapi.h
js/xpconnect/src/XPCJSRuntime.cpp
toolkit/components/telemetry/Histograms.json
--- a/js/src/gc/Statistics.cpp
+++ b/js/src/gc/Statistics.cpp
@@ -1306,16 +1306,17 @@ void Statistics::endSlice() {
 void Statistics::sendSliceTelemetry(const SliceData& slice) {
   JSRuntime* runtime = gc->rt;
   TimeDuration sliceTime = slice.end - slice.start;
   runtime->addTelemetry(JS_TELEMETRY_GC_SLICE_MS, t(sliceTime));
 
   if (slice.budget.isTimeBudget()) {
     int64_t budget_ms = slice.budget.timeBudget.budget;
     runtime->addTelemetry(JS_TELEMETRY_GC_BUDGET_MS, budget_ms);
+    runtime->addTelemetry(JS_TELEMETRY_GC_BUDGET_MS_2, budget_ms);
     if (IsCurrentlyAnimating(runtime->lastAnimationTime, slice.end)) {
       runtime->addTelemetry(JS_TELEMETRY_GC_ANIMATION_MS, t(sliceTime));
     }
 
     // Record any phase that goes 1.5 times or 5ms over its budget.
     double longSliceThreshold = std::min(1.5 * budget_ms, budget_ms + 5.0);
     if (sliceTime.ToMilliseconds() > longSliceThreshold) {
       PhaseKind longest = LongestPhaseSelfTimeInMajorGC(slice.phaseTimes);
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -140,16 +140,17 @@ extern JS_FRIEND_API void JS_TraceObject
  * It's OK for these enum values to change as they will be mapped to a fixed
  * member of the mozilla::Telemetry::HistogramID enum by the callback.
  */
 enum {
   JS_TELEMETRY_GC_REASON,
   JS_TELEMETRY_GC_IS_ZONE_GC,
   JS_TELEMETRY_GC_MS,
   JS_TELEMETRY_GC_BUDGET_MS,
+  JS_TELEMETRY_GC_BUDGET_MS_2,
   JS_TELEMETRY_GC_BUDGET_OVERRUN,
   JS_TELEMETRY_GC_ANIMATION_MS,
   JS_TELEMETRY_GC_MAX_PAUSE_MS_2,
   JS_TELEMETRY_GC_PREPARE_MS,
   JS_TELEMETRY_GC_MARK_MS,
   JS_TELEMETRY_GC_SWEEP_MS,
   JS_TELEMETRY_GC_COMPACT_MS,
   JS_TELEMETRY_GC_MARK_ROOTS_MS,
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -2589,16 +2589,19 @@ static void AccumulateTelemetryCallback(
       Telemetry::Accumulate(Telemetry::GC_IS_COMPARTMENTAL, sample);
       break;
     case JS_TELEMETRY_GC_MS:
       Telemetry::Accumulate(Telemetry::GC_MS, sample);
       break;
     case JS_TELEMETRY_GC_BUDGET_MS:
       Telemetry::Accumulate(Telemetry::GC_BUDGET_MS, sample);
       break;
+    case JS_TELEMETRY_GC_BUDGET_MS_2:
+      Telemetry::Accumulate(Telemetry::GC_BUDGET_MS_2, sample);
+      break;
     case JS_TELEMETRY_GC_BUDGET_OVERRUN:
       Telemetry::Accumulate(Telemetry::GC_BUDGET_OVERRUN, sample);
       break;
     case JS_TELEMETRY_GC_ANIMATION_MS:
       Telemetry::Accumulate(Telemetry::GC_ANIMATION_MS, sample);
       break;
     case JS_TELEMETRY_GC_MAX_PAUSE_MS_2:
       Telemetry::Accumulate(Telemetry::GC_MAX_PAUSE_MS_2, sample);
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -676,22 +676,34 @@
     "n_buckets": 50,
     "bug_numbers": [1545093],
     "description": "Time from the beginning of the first slice to the end of the last slice (ms)"
   },
   "GC_BUDGET_MS": {
     "record_in_processes": ["main", "content"],
     "products": ["firefox", "fennec", "geckoview"],
     "alert_emails": ["dev-telemetry-gc-alerts@mozilla.org"],
-    "expires_in_version": "never",
+    "expires_in_version": "81",
     "kind": "linear",
     "high": 100,
     "n_buckets": 10,
     "description": "Requested GC slice budget (ms)"
   },
+  "GC_BUDGET_MS_2": {
+    "record_in_processes": ["main", "content"],
+    "products": ["firefox"],
+    "alert_emails": ["dev-telemetry-gc-alerts@mozilla.org", "jcoppeard@mozilla.com"],
+    "expires_in_version": "never",
+    "releaseChannelCollection": "opt-out",
+    "kind": "exponential",
+    "high": 200,
+    "n_buckets": 50,
+    "description": "Requested GC slice budget (ms)",
+    "bug_numbers": [1637318]
+  },
   "GC_ANIMATION_MS": {
     "record_in_processes": ["main", "content"],
     "products": ["firefox", "fennec", "geckoview"],
     "alert_emails": ["dev-telemetry-gc-alerts@mozilla.org", "jcoppeard@mozilla.com", "sdetar@mozilla.com"],
     "expires_in_version": "never",
     "releaseChannelCollection": "opt-out",
     "kind": "exponential",
     "high": 10000,