Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions front_end/core/host/RNPerfMetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class RNPerfMetrics {
readonly #consoleErrorMethod = 'error';
#listeners: Set<RNReliabilityEventListener> = new Set();
#launchId: string|null = null;
#telemetryInfo: Object = {};
// map of panel location to panel name
#currentPanels: Map<PanelLocation, string> = new Map();

Expand Down Expand Up @@ -119,6 +120,10 @@ class RNPerfMetrics {
this.#launchId = launchId;
}

setTelemetryInfo(telemetryInfo: Object): void {
this.#telemetryInfo = telemetryInfo;
}

entryPointLoadingStarted(entryPoint: EntryPoint): void {
this.sendEvent({
eventName: 'Entrypoint.LoadingStarted',
Expand Down Expand Up @@ -263,6 +268,7 @@ class RNPerfMetrics {
const commonFields: CommonEventFields = {
timestamp: getPerfTimestamp(),
launchId: this.#launchId,
telemetryInfo: this.#telemetryInfo,
currentPanels: this.#currentPanels,
};

Expand Down Expand Up @@ -295,6 +301,7 @@ function maybeWrapError(baseMessage: string, error: unknown): [string, Error] {
type CommonEventFields = Readonly<{
timestamp: DOMHighResTimeStamp,
launchId: string | void | null,
telemetryInfo: Object,
currentPanels: Map<PanelLocation, string>,
}>;

Expand Down
1 change: 1 addition & 0 deletions front_end/entrypoints/rn_fusebox/rn_fusebox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import type * as Sources from '../../panels/sources/sources.js';
Host.rnPerfMetrics.registerPerfMetricsGlobalPostMessageHandler();
Host.rnPerfMetrics.registerGlobalErrorReporting();
Host.rnPerfMetrics.setLaunchId(Root.Runtime.Runtime.queryParam('launchId'));
Host.rnPerfMetrics.setTelemetryInfo(JSON.parse(Root.Runtime.Runtime.queryParam('telemetryInfo') || '{}'));
Host.rnPerfMetrics.entryPointLoadingStarted('rn_fusebox');

const UIStrings = {
Expand Down
1 change: 1 addition & 0 deletions front_end/entrypoints/rn_inspector/rn_inspector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import * as Host from '../../core/host/host.js';
*/
Host.rnPerfMetrics.registerPerfMetricsGlobalPostMessageHandler();
Host.rnPerfMetrics.setLaunchId(Root.Runtime.Runtime.queryParam('launchId'));
Host.rnPerfMetrics.setTelemetryInfo(JSON.parse(Root.Runtime.Runtime.queryParam('telemetryInfo') || '{}'));
Host.rnPerfMetrics.entryPointLoadingStarted('rn_inspector');

RNExperiments.RNExperimentsImpl.setIsReactNativeEntryPoint(true);
Expand Down
Loading