summaryrefslogtreecommitdiff
path: root/devtools
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-12-05 11:37:04 +0000
committerMoonchild <moonchild@palemoon.org>2022-04-07 23:35:02 +0200
commitd3cc8bc1ae4e0815273c56f3858d979def03abd1 (patch)
treea94925a2abd719971f96a738c1c3413197d5a4ee /devtools
parent02afcba61492797f77d54bde3c919e59b2772036 (diff)
downloaduxp-d3cc8bc1ae4e0815273c56f3858d979def03abd1.tar.gz
Issue #21 - Remove calls to Services.telemetry and nsITelemetry
These calls would cause breakage without the supporting plumbing.
Diffstat (limited to 'devtools')
-rw-r--r--devtools/client/memory/telemetry.js36
-rw-r--r--devtools/client/shared/shim/Services.js2
-rw-r--r--devtools/client/shared/telemetry.js20
3 files changed, 3 insertions, 55 deletions
diff --git a/devtools/client/memory/telemetry.js b/devtools/client/memory/telemetry.js
index 1e55805d31..4540ee98ac 100644
--- a/devtools/client/memory/telemetry.js
+++ b/devtools/client/memory/telemetry.js
@@ -13,18 +13,12 @@ const { makeInfallible, immutableUpdate } = require("devtools/shared/DevToolsUti
const { labelDisplays, treeMapDisplays, censusDisplays } = require("./constants");
exports.countTakeSnapshot = makeInfallible(function () {
- const histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_TAKE_SNAPSHOT_COUNT");
- histogram.add(1);
}, "devtools/client/memory/telemetry#countTakeSnapshot");
exports.countImportSnapshot = makeInfallible(function () {
- const histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_IMPORT_SNAPSHOT_COUNT");
- histogram.add(1);
}, "devtools/client/memory/telemetry#countImportSnapshot");
exports.countExportSnapshot = makeInfallible(function () {
- const histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_EXPORT_SNAPSHOT_COUNT");
- histogram.add(1);
}, "devtools/client/memory/telemetry#countExportSnapshot");
const COARSE_TYPE = "Coarse Type";
@@ -43,25 +37,6 @@ const CUSTOM = "Custom";
* The display used with the census.
*/
exports.countCensus = makeInfallible(function ({ filter, diffing, display }) {
- let histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_INVERTED_CENSUS");
- histogram.add(!!display.inverted);
-
- histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_FILTER_CENSUS");
- histogram.add(!!filter);
-
- histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_DIFF_CENSUS");
- histogram.add(!!diffing);
-
- histogram = telemetry.getKeyedHistogramById("DEVTOOLS_MEMORY_BREAKDOWN_CENSUS_COUNT");
- if (display === censusDisplays.coarseType) {
- histogram.add(COARSE_TYPE);
- } else if (display === censusDisplays.allocationStack) {
- histogram.add(ALLOCATION_STACK);
- } else if (display === censusDisplays.invertedAllocationStack) {
- histogram.add(INVERTED_ALLOCATION_STACK);
- } else {
- histogram.add(CUSTOM);
- }
}, "devtools/client/memory/telemetry#countCensus");
/**
@@ -77,15 +52,4 @@ exports.countDiff = makeInfallible(function (opts) {
* The display used to label nodes in the dominator tree.
*/
exports.countDominatorTree = makeInfallible(function ({ display }) {
- let histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_DOMINATOR_TREE_COUNT");
- histogram.add(1);
-
- histogram = telemetry.getKeyedHistogramById("DEVTOOLS_MEMORY_BREAKDOWN_DOMINATOR_TREE_COUNT");
- if (display === labelDisplays.coarseType) {
- histogram.add(COARSE_TYPE);
- } else if (display === labelDisplays.allocationStack) {
- histogram.add(ALLOCATION_STACK);
- } else {
- histogram.add(CUSTOM);
- }
}, "devtools/client/memory/telemetry#countDominatorTree");
diff --git a/devtools/client/shared/shim/Services.js b/devtools/client/shared/shim/Services.js
index 8a83b67939..03edced47c 100644
--- a/devtools/client/shared/shim/Services.js
+++ b/devtools/client/shared/shim/Services.js
@@ -502,7 +502,7 @@ const Services = {
return window.navigator.appVersion;
},
- // This is only used by telemetry, which is disabled for the
+ // This was only used by telemetry, which is disabled for the
// content case. So, being totally wrong is ok.
get is64Bit() {
return true;
diff --git a/devtools/client/shared/telemetry.js b/devtools/client/shared/telemetry.js
index 547b1c07fe..7ff71b3b7e 100644
--- a/devtools/client/shared/telemetry.js
+++ b/devtools/client/shared/telemetry.js
@@ -266,15 +266,7 @@ Telemetry.prototype = {
* Value to store.
*/
log: function (histogramId, value) {
- if (histogramId) {
- try {
- let histogram = Services.telemetry.getHistogramById(histogramId);
- histogram.add(value);
- } catch (e) {
- dump("Warning: An attempt was made to write to the " + histogramId +
- " histogram, which is not defined in Histograms.json\n");
- }
- }
+ /* STUB */
},
/**
@@ -288,15 +280,7 @@ Telemetry.prototype = {
* Value to store.
*/
logKeyed: function (histogramId, key, value) {
- if (histogramId) {
- try {
- let histogram = Services.telemetry.getKeyedHistogramById(histogramId);
- histogram.add(key, value);
- } catch (e) {
- dump("Warning: An attempt was made to write to the " + histogramId +
- " histogram, which is not defined in Histograms.json\n");
- }
- }
+ /* STUB */
},
/**