mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 04:38:02 +00:00
Bug 1800079 - Count PingCentre send failures r=nanj
Differential Revision: https://phabricator.services.mozilla.com/D161851
This commit is contained in:
parent
07bb461fac
commit
434ccfc6fb
@ -133,6 +133,7 @@ class PingCentre {
|
||||
}
|
||||
|
||||
return PingCentre._sendStandalonePing(endpoint, payload).catch(event => {
|
||||
Glean.pingCentre.sendFailures.add(1);
|
||||
Cu.reportError(
|
||||
`Structured Ingestion ping failure with error: ${event.type}`
|
||||
);
|
||||
|
@ -69,3 +69,18 @@ browser.engagement:
|
||||
- metrics
|
||||
no_lint:
|
||||
- BASELINE_PING
|
||||
|
||||
ping.centre:
|
||||
send_failures:
|
||||
type: counter
|
||||
description: |
|
||||
The number of PingCentre send failures.
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1800079
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1800079
|
||||
data_sensitivity:
|
||||
- technical
|
||||
notification_emails:
|
||||
- chutten@mozilla.com
|
||||
expires: 115
|
||||
|
@ -32,7 +32,7 @@ function _setUp() {
|
||||
sandbox.restore();
|
||||
}
|
||||
|
||||
add_task(function setup() {
|
||||
add_setup(function setup() {
|
||||
sandbox = sinon.createSandbox();
|
||||
_setUp();
|
||||
pingCentre = new PingCentre({ topic: "test_topic" });
|
||||
@ -43,6 +43,12 @@ add_task(function setup() {
|
||||
Services.prefs.clearUserPref(PingCentreConstants.FHR_UPLOAD_ENABLED_PREF);
|
||||
Services.prefs.clearUserPref(PingCentreConstants.LOGGING_PREF);
|
||||
});
|
||||
|
||||
// On Android, FOG is set up through head.js
|
||||
if (AppConstants.platform != "android") {
|
||||
do_get_profile();
|
||||
Services.fog.initializeFOG();
|
||||
}
|
||||
});
|
||||
|
||||
add_task(function test_enabled() {
|
||||
@ -141,3 +147,12 @@ add_task(function test_sendStructuredIngestionPing_success() {
|
||||
|
||||
Assert.equal(PingCentre._sendStandalonePing.callCount, 1, "Should be sent");
|
||||
});
|
||||
|
||||
add_task(async function test_sendStructuredIngestionPing_failure() {
|
||||
_setUp();
|
||||
sandbox.stub(PingCentre, "_sendStandalonePing").rejects();
|
||||
Assert.equal(undefined, Glean.pingCentre.sendFailures.testGetValue());
|
||||
await pingCentre.sendStructuredIngestionPing(FAKE_PING, FAKE_ENDPOINT);
|
||||
|
||||
Assert.equal(1, Glean.pingCentre.sendFailures.testGetValue());
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user