Commit a43cc7d8 authored by Julian Descottes's avatar Julian Descottes
Browse files

Bug 1530997 - Record additional extras in devtools.main runtime_connected event;r=daisuke,janerik

Differential Revision: https://phabricator.services.mozilla.com/D21373

--HG--
extra : moz-landing-system : lando
parent 6b134dd1
......@@ -103,6 +103,7 @@ function connectRuntime(id) {
deviceName: deviceDescription.deviceName,
icon,
name: deviceDescription.name,
os: deviceDescription.os,
type: runtime.type,
version: deviceDescription.version,
},
......
......@@ -74,7 +74,11 @@ function onConnectRuntimeSuccess(action, store) {
const runtime = Object.assign({}, storeRuntime, {
runtimeDetails: action.runtime.runtimeDetails,
});
recordEvent("runtime_connected", getRuntimeEventExtras(runtime));
const extras = Object.assign({}, getRuntimeEventExtras(runtime), {
"runtime_os": action.runtime.runtimeDetails.info.os,
"runtime_version": action.runtime.runtimeDetails.info.version,
});
recordEvent("runtime_connected", extras);
}
function onDisconnectRuntimeSuccess(action, store) {
......
......@@ -84,6 +84,7 @@ class ClientWrapper {
deviceName: description.deviceName,
isMultiE10s: description.isMultiE10s,
name: description.brandName,
os: description.os,
version: description.version,
};
}
......
......@@ -19,6 +19,12 @@ const runtimeInfo = {
// name of runtime such as "Firefox Nightly"
name: PropTypes.string.isRequired,
// operating system on which the runtime runs such as "Android", "Linux"
os: PropTypes.string.isRequired,
// runtime type, for instance "network", "usb" ...
type: PropTypes.string.isRequired,
// version of runtime
version: PropTypes.string.isRequired,
};
......
......@@ -98,6 +98,7 @@ skip-if = (os == 'linux' && bits == 32) # ADB start() fails on linux 32, see Bug
[browser_aboutdebugging_telemetry_inspect.js]
[browser_aboutdebugging_telemetry_navigate.js]
[browser_aboutdebugging_telemetry_runtime_actions.js]
[browser_aboutdebugging_telemetry_runtime_connected_details.js]
[browser_aboutdebugging_telemetry_runtime_updates.js]
[browser_aboutdebugging_telemetry_runtime_updates_multi.js]
[browser_aboutdebugging_telemetry_runtime_updates_network.js]
......
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/* import-globals-from helper-telemetry.js */
Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-telemetry.js", this);
const REMOTE_RUNTIME_ID = "remote-runtime";
const REMOTE_RUNTIME = "Remote Runtime";
const REMOTE_DEVICE = "Remote Device";
const REMOTE_VERSION = "12.0a1";
const REMOTE_OS = "SOME_OS";
/**
* Runtime connected events will log additional extras about the runtime connection that
* was established.
*/
add_task(async function() {
const mocks = new Mocks();
const usbClient = mocks.createUSBRuntime(REMOTE_RUNTIME_ID, {
deviceName: REMOTE_DEVICE,
name: REMOTE_RUNTIME,
shortName: REMOTE_RUNTIME,
});
usbClient.getDeviceDescription = () => {
return {
os: REMOTE_OS,
version: REMOTE_VERSION,
};
};
const { document, tab } = await openAboutDebugging();
mocks.emitUSBUpdate();
await connectToRuntime(REMOTE_DEVICE, document);
const evts = readAboutDebuggingEvents().filter(e => e.method === "runtime_connected");
is(evts.length, 1, "runtime_connected event logged when connecting to remote runtime");
const {
connection_type,
device_name,
runtime_name,
runtime_os,
runtime_version,
} = evts[0].extras;
is(connection_type, "usb", "Expected value for `connection_type` extra");
is(device_name, REMOTE_DEVICE, "Expected value for `device_name` extra");
is(runtime_name, REMOTE_RUNTIME, "Expected value for `runtime_name` extra");
is(runtime_os, REMOTE_OS, "Expected value for `runtime_os` extra");
is(runtime_version, REMOTE_VERSION, "Expected value for `runtime_version` extra");
await removeTab(tab);
});
......@@ -745,7 +745,7 @@ devtools.main:
session_id: The start time of the session in milliseconds since epoch (Unix Timestamp) e.g. 1396381378123.
runtime_connected:
objects: ["aboutdebugging"]
bug_numbers: [1521507]
bug_numbers: [1521507, 1530997]
notification_emails: ["dev-developer-tools@lists.mozilla.org", "hkirschner@mozilla.com"]
record_in_processes: ["main"]
description: Connection was established with a remote runtime in about:debugging
......@@ -756,6 +756,8 @@ devtools.main:
device_name: Name of the device on which the runtime is running (optional)
runtime_id: Random id generated to track events related to a single runtime
runtime_name: Name of the runtime
runtime_os: Operating system on which the runtime is running (eg Android or Linux)
runtime_version: Version of the runtime (eg 67.0a1)
session_id: The start time of the session in milliseconds since epoch (Unix Timestamp) e.g. 1396381378123.
runtime_disconnected:
objects: ["aboutdebugging"]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment