@@ -24,6 +24,8 @@ class RNPerfMetrics {
2424 readonly #consoleErrorMethod = 'error' ;
2525 #listeners: Set < RNReliabilityEventListener > = new Set ( ) ;
2626 #launchId: string | null = null ;
27+ #appId: string | null = null ;
28+ #entryPoint: EntryPoint = 'rn_inspector' ;
2729 #telemetryInfo: Object = { } ;
2830 // map of panel location to panel name
2931 #currentPanels: Map < PanelLocation , string > = new Map ( ) ;
@@ -120,11 +122,17 @@ class RNPerfMetrics {
120122 this . #launchId = launchId ;
121123 }
122124
125+ setAppId ( appId : string | null ) : void {
126+ this . #appId = appId ;
127+ }
128+
123129 setTelemetryInfo ( telemetryInfo : Object ) : void {
124130 this . #telemetryInfo = telemetryInfo ;
125131 }
126132
127133 entryPointLoadingStarted ( entryPoint : EntryPoint ) : void {
134+ this . #entryPoint = entryPoint ;
135+
128136 this . sendEvent ( {
129137 eventName : 'Entrypoint.LoadingStarted' ,
130138 entryPoint,
@@ -268,6 +276,8 @@ class RNPerfMetrics {
268276 const commonFields : CommonEventFields = {
269277 timestamp : getPerfTimestamp ( ) ,
270278 launchId : this . #launchId,
279+ appId : this . #appId,
280+ entryPoint : this . #entryPoint,
271281 telemetryInfo : this . #telemetryInfo,
272282 currentPanels : this . #currentPanels,
273283 } ;
@@ -298,15 +308,17 @@ function maybeWrapError(baseMessage: string, error: unknown): [string, Error] {
298308 return [ message , new Error ( message , { cause : error } ) ] ;
299309}
300310
311+ type EntryPoint = 'rn_fusebox' | 'rn_inspector' ;
312+
301313type CommonEventFields = Readonly < {
302314 timestamp : DOMHighResTimeStamp ,
303315 launchId : string | void | null ,
316+ appId : string | void | null ,
317+ entryPoint : EntryPoint ,
304318 telemetryInfo : Object ,
305319 currentPanels : Map < PanelLocation , string > ,
306320} > ;
307321
308- type EntryPoint = 'rn_fusebox' | 'rn_inspector' ;
309-
310322export type EntrypointLoadingStartedEvent = Readonly < {
311323 eventName : 'Entrypoint.LoadingStarted' ,
312324 entryPoint : EntryPoint ,
0 commit comments