mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 22:37:50 +00:00
Bug 1121001 - Record a uitour ping when a tag is set, r=gfritzsche
--HG-- extra : rebase_source : 71e846e33d9e9bc4acf9c8ba1173bfaa00ca2d6b
This commit is contained in:
parent
08ceb34ed5
commit
45bc946f03
@ -12,6 +12,7 @@ Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Promise.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
Cu.import("resource://gre/modules/TelemetryController.jsm");
|
||||
|
||||
Cu.importGlobalProperties(["URL"]);
|
||||
|
||||
@ -1978,6 +1979,16 @@ const DAILY_DISCRETE_TEXT_FIELD = Metrics.Storage.FIELD_DAILY_DISCRETE_TEXT;
|
||||
*/
|
||||
const UITourHealthReport = {
|
||||
recordTreatmentTag: function(tag, value) {
|
||||
TelemetryController.submitExternalPing("uitour-tag",
|
||||
{
|
||||
version: 1,
|
||||
tagName: tag,
|
||||
tagValue: value,
|
||||
},
|
||||
{
|
||||
addClientId: true,
|
||||
addEnvironment: true,
|
||||
});
|
||||
#ifdef MOZ_SERVICES_HEALTHREPORT
|
||||
Task.spawn(function*() {
|
||||
let reporter = Cc["@mozilla.org/datareporting/service;1"]
|
||||
|
@ -8,6 +8,7 @@ let gContentAPI;
|
||||
let gContentWindow;
|
||||
|
||||
Components.utils.import("resource:///modules/UITour.jsm");
|
||||
Components.utils.import("resource://testing-common/TelemetryArchiveTesting.jsm", this);
|
||||
|
||||
function test() {
|
||||
UITourTest();
|
||||
@ -400,13 +401,24 @@ let tests = [
|
||||
});
|
||||
});
|
||||
},
|
||||
function test_treatment_tag(done) {
|
||||
taskify(function* test_treatment_tag(done) {
|
||||
let ac = new TelemetryArchiveTesting.Checker();
|
||||
yield ac.promiseInit();
|
||||
gContentAPI.setTreatmentTag("foobar", "baz");
|
||||
gContentAPI.getTreatmentTag("foobar", (data) => {
|
||||
is(data.value, "baz", "set and retrieved treatmentTag");
|
||||
done();
|
||||
ac.promiseFindPing("uitour-tag", [
|
||||
[["payload", "tagName"], "foobar"],
|
||||
[["payload", "tagValue"], "baz"],
|
||||
]).then((found) => {
|
||||
ok(found, "Telemetry ping submitted for setTreatmentTag");
|
||||
done();
|
||||
}, (err) => {
|
||||
ok(false, "Exeption finding uitour telemetry ping: " + err);
|
||||
done();
|
||||
});
|
||||
});
|
||||
},
|
||||
}),
|
||||
|
||||
// Make sure this test is last in the file so the appMenu gets left open and done will confirm it got tore down.
|
||||
taskify(function* cleanupMenus() {
|
||||
|
@ -31,6 +31,7 @@ Ping types
|
||||
* :doc:`main <main-ping>` - contains the information collected by Telemetry (Histograms, hang stacks, ...)
|
||||
* :doc:`saved-session <main-ping>` - has the same format as a main ping, but it contains the *"classic"* Telemetry payload with measurements covering the whole browser session. This is only a separate type to make storage of saved-session easier server-side. This is temporary and will be removed soon.
|
||||
* :doc:`crash <crash-ping>` - a ping that is captured and sent after Firefox crashes.
|
||||
* :doc:`uitour-ping` - a ping submitted via the UITour API
|
||||
* ``activation`` - *planned* - sent right after installation or profile creation
|
||||
* ``upgrade`` - *planned* - sent right after an upgrade
|
||||
* ``deletion`` - *planned* - on opt-out we may have to tell the server to delete user data
|
||||
|
24
toolkit/components/telemetry/docs/uitour-ping.rst
Normal file
24
toolkit/components/telemetry/docs/uitour-ping.rst
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
"uitour-tag" ping
|
||||
=================
|
||||
|
||||
This ping is submitted via the UITour setTreatmentTag API. It may be used by
|
||||
the tour to record what settings were made by a user or to track the result of
|
||||
A/B experiments.
|
||||
|
||||
The client ID is submitted with this ping.
|
||||
|
||||
Structure::
|
||||
|
||||
{
|
||||
version: 1,
|
||||
type: "uitour-tag",
|
||||
clientId: <string>,
|
||||
payload: {
|
||||
tagName: <string>,
|
||||
tagValue: <string>
|
||||
}
|
||||
}
|
||||
|
||||
See also: :doc:`common ping fields <common-ping>`
|
||||
|
Loading…
x
Reference in New Issue
Block a user