mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-28 12:45:27 +00:00
Bug 1120409 - nsITelemetry.histogramSnapshots will no longer return keyed histograms. r=gfritzsche
This commit is contained in:
parent
557f236c19
commit
7acf827c12
@ -2279,6 +2279,12 @@ TelemetryHistogram::CreateHistogramSnapshots(JSContext *cx,
|
||||
continue;
|
||||
}
|
||||
|
||||
mozilla::Telemetry::HistogramID id;
|
||||
nsresult rv = internal_GetHistogramEnumId(h->histogram_name().c_str(), &id);
|
||||
if (NS_WARN_IF(NS_FAILED(rv)) || gHistograms[id].keyed) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Histogram* original = h;
|
||||
#if !defined(MOZ_WIDGET_ANDROID)
|
||||
if (subsession) {
|
||||
|
@ -757,6 +757,14 @@ add_task(function* test_keyed_histogram_recording_enabled() {
|
||||
"Keyed histogram add should not record when recording is disabled");
|
||||
});
|
||||
|
||||
add_task(function* test_histogramSnapshots() {
|
||||
let keyed = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_COUNT");
|
||||
keyed.add("a", 1);
|
||||
|
||||
// Check that keyed histograms are not returned
|
||||
Assert.ok(!("TELEMETRY_TEST_KEYED_COUNT#a" in Telemetry.histogramSnapshots));
|
||||
});
|
||||
|
||||
add_task(function* test_datasets() {
|
||||
// Check that datasets work as expected.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user