mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 764184 - Fix GC_REASON telemetry bucket count (r=froydnj)
--HG-- extra : rebase_source : 790f6727878f44e7cf424d9e32a85347416df625
This commit is contained in:
parent
2370b212ad
commit
222b385266
@ -236,6 +236,13 @@ class StatisticsSerializer
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* If this fails, then you can either delete this assertion and allow all
|
||||
* larger-numbered reasons to pile up in the last telemetry bucket, or switch
|
||||
* to GC_REASON_3 and bump the max value.
|
||||
*/
|
||||
JS_STATIC_ASSERT(gcreason::NUM_TELEMETRY_REASONS >= gcreason::NUM_REASONS);
|
||||
|
||||
static const char *
|
||||
ExplainReason(gcreason::Reason reason)
|
||||
{
|
||||
|
@ -603,7 +603,15 @@ enum Reason {
|
||||
GCREASONS(MAKE_REASON)
|
||||
#undef MAKE_REASON
|
||||
NO_REASON,
|
||||
NUM_REASONS
|
||||
NUM_REASONS,
|
||||
|
||||
/*
|
||||
* For telemetry, we want to keep a fixed max bucket size over time so we
|
||||
* don't have to switch histograms. 100 is conservative; as of this writing
|
||||
* there are 26. But the cost of extra buckets seems to be low while the
|
||||
* cost of switching histograms is high.
|
||||
*/
|
||||
NUM_TELEMETRY_REASONS = 100
|
||||
};
|
||||
|
||||
} /* namespace gcreason */
|
||||
|
@ -1857,7 +1857,7 @@ AccumulateTelemetryCallback(int id, uint32_t sample)
|
||||
{
|
||||
switch (id) {
|
||||
case JS_TELEMETRY_GC_REASON:
|
||||
Telemetry::Accumulate(Telemetry::GC_REASON, sample);
|
||||
Telemetry::Accumulate(Telemetry::GC_REASON_2, sample);
|
||||
break;
|
||||
case JS_TELEMETRY_GC_IS_COMPARTMENTAL:
|
||||
Telemetry::Accumulate(Telemetry::GC_IS_COMPARTMENTAL, sample);
|
||||
|
@ -11,7 +11,8 @@
|
||||
#include "mozilla/ModuleUtils.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "jsapi.h"
|
||||
#include "jsapi.h"
|
||||
#include "jsfriendapi.h"
|
||||
#include "nsStringGlue.h"
|
||||
#include "nsITelemetry.h"
|
||||
#include "nsIFile.h"
|
||||
|
@ -48,7 +48,7 @@ HISTOGRAM(FORGET_SKIPPABLE_MAX, 1, 10000, 50, EXPONENTIAL, "Max time spent on on
|
||||
/**
|
||||
* GC telemetry
|
||||
*/
|
||||
HISTOGRAM(GC_REASON, 1, 20, 20, LINEAR, "Reason (enum value) for initiating a GC")
|
||||
HISTOGRAM_ENUMERATED_VALUES(GC_REASON_2, js::gcreason::NUM_TELEMETRY_REASONS, "Reason (enum value) for initiating a GC")
|
||||
HISTOGRAM_BOOLEAN(GC_IS_COMPARTMENTAL, "Is it a compartmental GC?")
|
||||
HISTOGRAM(GC_MS, 1, 10000, 50, EXPONENTIAL, "Time spent running JS GC (ms)")
|
||||
HISTOGRAM(GC_MARK_MS, 1, 10000, 50, EXPONENTIAL, "Time spent running JS GC mark phase (ms)")
|
||||
|
@ -159,7 +159,12 @@ function compareHistograms(h1, h2) {
|
||||
|
||||
function test_histogramFrom() {
|
||||
// Test one histogram of each type.
|
||||
let names = ["CYCLE_COLLECTOR", "GC_REASON", "GC_RESET", "TELEMETRY_TEST_FLAG"];
|
||||
let names = [
|
||||
"CYCLE_COLLECTOR", // EXPONENTIAL
|
||||
"GC_REASON_2", // LINEAR
|
||||
"GC_RESET", // BOOLEAN
|
||||
"TELEMETRY_TEST_FLAG" // FLAG
|
||||
];
|
||||
|
||||
for each (let name in names) {
|
||||
let [min, max, bucket_count] = [1, INT_MAX - 1, 10]
|
||||
|
Loading…
Reference in New Issue
Block a user