Bug 1381777 - Record how long we went over the time budget r=sfink data-r=bsmedberg

This commit is contained in:
Jon Coppeard 2017-07-19 09:37:18 +01:00
Родитель 1d3260f920
Коммит 4056892ff5
4 изменённых файлов: 24 добавлений и 0 удалений

Просмотреть файл

@ -995,6 +995,11 @@ Statistics::endSlice()
if (joinTime.ToMilliseconds() > budget_ms)
reportLongestPhaseInMajorGC(slice.parallelTimes, JS_TELEMETRY_GC_SLOW_TASK);
}
// Record how long we went over budget.
int64_t overrun = sliceTime.ToMicroseconds() - (1000 * budget_ms);
if (overrun > 0)
runtime->addTelemetry(JS_TELEMETRY_GC_BUDGET_OVERRUN, uint32_t(overrun));
}
sliceCount_++;

Просмотреть файл

@ -121,11 +121,18 @@ JS_TraceShapeCycleCollectorChildren(JS::CallbackTracer* trc, JS::GCCellPtr shape
extern JS_FRIEND_API(void)
JS_TraceObjectGroupCycleCollectorChildren(JS::CallbackTracer* trc, JS::GCCellPtr group);
/*
* Telemetry reasons passed to the accumulate telemetry callback.
*
* 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_OVERRUN,
JS_TELEMETRY_GC_ANIMATION_MS,
JS_TELEMETRY_GC_MAX_PAUSE_MS,
JS_TELEMETRY_GC_MAX_PAUSE_MS_2,

Просмотреть файл

@ -2554,6 +2554,9 @@ AccumulateTelemetryCallback(int id, uint32_t sample, const char* key)
case JS_TELEMETRY_GC_BUDGET_MS:
Telemetry::Accumulate(Telemetry::GC_BUDGET_MS, 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;

Просмотреть файл

@ -1199,6 +1199,15 @@
"n_buckets": 50,
"description": "Percent of GC slice done during idle time"
},
"GC_BUDGET_OVERRUN": {
"record_in_processes": ["main", "content"],
"alert_emails": ["dev-telemetry-gc-alerts@mozilla.org", "jcoppeard@mozilla.com"],
"expires_in_version": "never",
"kind": "exponential",
"high": 100000,
"n_buckets": 100,
"description": "How long a GC slice ran over its budget in microseconds"
},
"GEOLOCATION_ACCURACY_EXPONENTIAL": {
"record_in_processes": ["main", "content"],
"expires_in_version": "default",