зеркало из https://github.com/mozilla/gecko-dev.git
Bug 751316 - fix sending addon histograms in telemetry pings; r=taras
This commit is contained in:
Родитель
97bec5048a
Коммит
a781b0fda0
|
@ -276,8 +276,13 @@ TelemetryPing.prototype = {
|
|||
let ahs = Telemetry.addonHistogramSnapshots;
|
||||
let ret = {};
|
||||
|
||||
for (let name in ahs) {
|
||||
ret[name] = this.convertHistogram(ahs[name]);
|
||||
for (let addonName in ahs) {
|
||||
addonHistograms = ahs[addonName];
|
||||
packedHistograms = {};
|
||||
for (let name in addonHistograms) {
|
||||
packedHistograms[name] = this.packHistogram(addonHistograms[name]);
|
||||
}
|
||||
ret[addonName] = packedHistograms;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -19,6 +19,8 @@ const SERVER = "http://localhost:4444";
|
|||
const IGNORE_HISTOGRAM = "test::ignore_me";
|
||||
const IGNORE_HISTOGRAM_TO_CLONE = "MEMORY_HEAP_ALLOCATED";
|
||||
const IGNORE_CLONED_HISTOGRAM = "test::ignore_me_also";
|
||||
const ADDON_NAME = "Telemetry test addon";
|
||||
const ADDON_HISTOGRAM = "addon-histogram";
|
||||
|
||||
const BinaryInputStream = Components.Constructor(
|
||||
"@mozilla.org/binaryinputstream;1",
|
||||
|
@ -64,6 +66,12 @@ function telemetryObserver(aSubject, aTopic, aData) {
|
|||
const TelemetryPing = Cc["@mozilla.org/base/telemetry-ping;1"].getService(Ci.nsIObserver);
|
||||
TelemetryPing.observe(histogramsFile, "test-save-histograms", gTestUUID);
|
||||
TelemetryPing.observe(histogramsFile, "test-load-histograms", null);
|
||||
|
||||
Telemetry.registerAddonHistogram(ADDON_NAME, ADDON_HISTOGRAM, 1, 5, 6,
|
||||
Telemetry.HISTOGRAM_LINEAR);
|
||||
h1 = Telemetry.getAddonHistogram(ADDON_NAME, ADDON_HISTOGRAM);
|
||||
h1.add(1);
|
||||
|
||||
telemetry_ping();
|
||||
}
|
||||
|
||||
|
@ -199,6 +207,11 @@ function checkHistograms(request, response) {
|
|||
do_check_true('MEMORY_JS_GC_HEAP' in payload.histograms); // UNITS_BYTES
|
||||
do_check_true('MEMORY_JS_COMPARTMENTS_SYSTEM' in payload.histograms); // UNITS_COUNT
|
||||
|
||||
// We should have included addon histograms.
|
||||
do_check_true("addonHistograms" in payload);
|
||||
do_check_true(ADDON_NAME in payload.addonHistograms);
|
||||
do_check_true(ADDON_HISTOGRAM in payload.addonHistograms[ADDON_NAME]);
|
||||
|
||||
do_check_true(("mainThread" in payload.slowSQL) &&
|
||||
("otherThreads" in payload.slowSQL));
|
||||
gFinished = true;
|
||||
|
|
Загрузка…
Ссылка в новой задаче