@@ -22,10 +22,6 @@ const _cookies: {[key: string]: number, ...} = {};
22
22
23
23
const PRINT_TO_CONSOLE : false = false ; // Type as false to prevent accidentally committing `true`;
24
24
25
- // This is the prefix for optional logging points/timespans as marks/measures via Performance API,
26
- // used to separate these internally from other marks/measures
27
- const WEB_PERFORMANCE_PREFIX = 'web_perf_' ;
28
-
29
25
export const getCurrentTimestamp : ( ) => number =
30
26
global . nativeQPLTimestamp ?? ( ( ) => global . performance . now ( ) ) ;
31
27
@@ -35,41 +31,6 @@ class PerformanceLogger implements IPerformanceLogger {
35
31
_points: { [ key : string ] : ?number } = { } ;
36
32
_pointExtras: { [ key : string ] : ?Extras , ...} = { } ;
37
33
_closed: boolean = false ;
38
- _isLoggingForWebPerformance: boolean = false ;
39
-
40
- // When `isLoggingForWebPerformance` is true, the data will be additionally logged via
41
- // Performance.mark/measure API, if available.
42
- constructor ( isLoggingForWebPerformance ? : boolean ) {
43
- this . _isLoggingForWebPerformance = isLoggingForWebPerformance === true ;
44
- }
45
-
46
- // NOTE: The Performance.mark/measure calls are wrapped here to ensure that
47
- // we are safe from the cases when the global 'peformance' object is still not yet defined.
48
- // It is only necessary in this file because of potential race conditions in the initialization
49
- // order between 'createPerformanceLogger' and 'setUpPerformance'.
50
- //
51
- // In most of the other cases this kind of check for `performance` being defined
52
- // wouldn't be necessary.
53
- _performanceMark ( key : string , startTime : number ) {
54
- if ( this . _isLoggingForWebPerformance ) {
55
- global . performance ?. mark ?. ( key , {
56
- startTime,
57
- } ) ;
58
- }
59
- }
60
-
61
- _performanceMeasure (
62
- key : string ,
63
- start : number | string ,
64
- end : number | string ,
65
- ) {
66
- if ( this . _isLoggingForWebPerformance ) {
67
- global . performance ?. measure ?. ( key , {
68
- start,
69
- end,
70
- } ) ;
71
- }
72
- }
73
34
74
35
addTimespan (
75
36
key : string ,
@@ -101,12 +62,6 @@ class PerformanceLogger implements IPerformanceLogger {
101
62
startExtras,
102
63
endExtras,
103
64
} ;
104
-
105
- this . _performanceMeasure (
106
- `${ WEB_PERFORMANCE_PREFIX } _${ key } ` ,
107
- startTime ,
108
- endTime ,
109
- ) ;
110
65
}
111
66
112
67
append ( performanceLogger : IPerformanceLogger ) {
@@ -221,8 +176,6 @@ class PerformanceLogger implements IPerformanceLogger {
221
176
if ( extras ) {
222
177
this . _pointExtras [ key ] = extras ;
223
178
}
224
-
225
- this . _performanceMark ( `${ WEB_PERFORMANCE_PREFIX } _${ key } ` , timestamp ) ;
226
179
}
227
180
228
181
removeExtra ( key : string ) : ?ExtraValue {
@@ -284,11 +237,6 @@ class PerformanceLogger implements IPerformanceLogger {
284
237
if ( PRINT_TO_CONSOLE ) {
285
238
infoLog ( 'PerformanceLogger.js' , 'start: ' + key ) ;
286
239
}
287
-
288
- this . _performanceMark (
289
- `${ WEB_PERFORMANCE_PREFIX } _timespan_start_${ key } ` ,
290
- timestamp ,
291
- ) ;
292
240
}
293
241
294
242
stopTimespan (
@@ -334,12 +282,6 @@ class PerformanceLogger implements IPerformanceLogger {
334
282
Systrace . endAsyncEvent ( key , _cookies [ key ] ) ;
335
283
delete _cookies [ key ] ;
336
284
}
337
-
338
- this . _performanceMeasure (
339
- `${ WEB_PERFORMANCE_PREFIX } _${ key } ` ,
340
- `${ WEB_PERFORMANCE_PREFIX } _timespan_start_${ key } ` ,
341
- timestamp ,
342
- ) ;
343
285
}
344
286
}
345
287
@@ -352,8 +294,6 @@ export type {Extras, ExtraValue, IPerformanceLogger, Timespan};
352
294
* various performance data such as timespans, points and extras.
353
295
* The loggers need to have minimal overhead since they're used in production.
354
296
*/
355
- export default function createPerformanceLogger (
356
- isLoggingForWebPerformance ?: boolean ,
357
- ) : IPerformanceLogger {
358
- return new PerformanceLogger ( isLoggingForWebPerformance ) ;
297
+ export default function createPerformanceLogger ( ) : IPerformanceLogger {
298
+ return new PerformanceLogger ( ) ;
359
299
}
0 commit comments