for #598: stop calling getCurrentPingData

See fa0f73fd6a
This commit is contained in:
groovecoder 2017-06-16 14:13:51 -05:00
parent 6533c74d0a
commit f9ca780dd3

View file

@ -6,6 +6,9 @@ const { storage } = require('sdk/simple-storage');
const { const {
TelemetryController TelemetryController
} = require('resource://gre/modules/TelemetryController.jsm'); } = require('resource://gre/modules/TelemetryController.jsm');
const {
TelemetryEnvironment
} = require ('resource://gre/modules/TelemetryEnvironment.jsm');
const { Request } = require('sdk/request'); const { Request } = require('sdk/request');
@ -44,9 +47,7 @@ function experimentPing(event) {
}); });
// TODO: DRY up this ping centre code here and in lib/Telemetry. // TODO: DRY up this ping centre code here and in lib/Telemetry.
const pcPing = TelemetryController.getCurrentPingData(); const environment = TelemetryEnvironment.currentEnvironment;
pcPing.type = 'testpilot';
pcPing.payload = payload;
const pcPayload = { const pcPayload = {
// 'method' is used by testpilot-metrics library. // 'method' is used by testpilot-metrics library.
// 'event' was used before that library existed. // 'event' was used before that library existed.
@ -54,10 +55,10 @@ function experimentPing(event) {
client_time: makeTimestamp(parsed.timestamp || timestamp), client_time: makeTimestamp(parsed.timestamp || timestamp),
addon_id: subject, addon_id: subject,
addon_version: addon.version, addon_version: addon.version,
firefox_version: pcPing.environment.build.version, firefox_version: environment.build.version,
os_name: pcPing.environment.system.os.name, os_name: environment.system.os.name,
os_version: pcPing.environment.system.os.version, os_version: environment.system.os.version,
locale: pcPing.environment.settings.locale, locale: environment.settings.locale,
// Note: these two keys are normally inserted by the ping-centre client. // Note: these two keys are normally inserted by the ping-centre client.
client_id: ClientID.getCachedClientID(), client_id: ClientID.getCachedClientID(),
topic: 'testpilot' topic: 'testpilot'