fune/toolkit/components/normandy/lib/Uptake.jsm
Mark Banner 29ebe3f3a8 Bug 1478308 - Remove unnecessary ChromeUtils.imports in toolkit/ r=mikedeboer
MozReview-Commit-ID: 45Tfs2ZZ06r

--HG--
extra : rebase_source : f76738612cb5f78787e9fae8f8c563d5ff5f33d1
2018-07-25 11:00:35 +01:00

45 lines
1.6 KiB
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
ChromeUtils.defineModuleGetter(
this, "UptakeTelemetry", "resource://services-common/uptake-telemetry.js");
var EXPORTED_SYMBOLS = ["Uptake"];
const SOURCE_PREFIX = "normandy";
var Uptake = {
// Action uptake
ACTION_NETWORK_ERROR: UptakeTelemetry.STATUS.NETWORK_ERROR,
ACTION_PRE_EXECUTION_ERROR: UptakeTelemetry.STATUS.CUSTOM_1_ERROR,
ACTION_POST_EXECUTION_ERROR: UptakeTelemetry.STATUS.CUSTOM_2_ERROR,
ACTION_SERVER_ERROR: UptakeTelemetry.STATUS.SERVER_ERROR,
ACTION_SUCCESS: UptakeTelemetry.STATUS.SUCCESS,
// Per-recipe uptake
RECIPE_ACTION_DISABLED: UptakeTelemetry.STATUS.CUSTOM_1_ERROR,
RECIPE_EXECUTION_ERROR: UptakeTelemetry.STATUS.APPLY_ERROR,
RECIPE_INVALID_ACTION: UptakeTelemetry.STATUS.DOWNLOAD_ERROR,
RECIPE_SUCCESS: UptakeTelemetry.STATUS.SUCCESS,
// Uptake for the runner as a whole
RUNNER_INVALID_SIGNATURE: UptakeTelemetry.STATUS.SIGNATURE_ERROR,
RUNNER_NETWORK_ERROR: UptakeTelemetry.STATUS.NETWORK_ERROR,
RUNNER_SERVER_ERROR: UptakeTelemetry.STATUS.SERVER_ERROR,
RUNNER_SUCCESS: UptakeTelemetry.STATUS.SUCCESS,
reportRunner(status) {
UptakeTelemetry.report(`${SOURCE_PREFIX}/runner`, status);
},
reportRecipe(recipeId, status) {
UptakeTelemetry.report(`${SOURCE_PREFIX}/recipe/${recipeId}`, status);
},
reportAction(actionName, status) {
UptakeTelemetry.report(`${SOURCE_PREFIX}/action/${actionName}`, status);
},
};