mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 12:45:37 +08:00
Add RCTPerformanceLogger data to PerfMonitor
Summary: public Add information the times recorded by RCTPerformanceLogger to RCTPerfMonitor, tap the monitor to show a table view with the data. Reviewed By: jspahrsummers Differential Revision: D2595372 fb-gh-sync-id: dc3b73af71b6d7f258e4e5991116bbc6cedc21fb
This commit is contained in:
committed by
facebook-github-bot-7
parent
3ee3041d68
commit
287e0e3c49
@@ -26,3 +26,4 @@ void RCTPerformanceLoggerStart(RCTPLTag tag);
|
||||
void RCTPerformanceLoggerEnd(RCTPLTag tag);
|
||||
void RCTPerformanceLoggerSet(RCTPLTag tag, int64_t value);
|
||||
NSArray *RCTPerformanceLoggerOutput(void);
|
||||
NSArray *RCTPerformanceLoggerLabels(void);
|
||||
|
||||
@@ -56,6 +56,19 @@ NSArray *RCTPerformanceLoggerOutput(void)
|
||||
];
|
||||
}
|
||||
|
||||
NSArray *RCTPerformanceLoggerLabels(void)
|
||||
{
|
||||
return @[
|
||||
@"ScriptDownload",
|
||||
@"ScriptExecution",
|
||||
@"NativeModuleInit",
|
||||
@"NativeModulePrepareConfig",
|
||||
@"NativeModuleInjectConfig",
|
||||
@"TTI",
|
||||
@"BundleSize",
|
||||
];
|
||||
}
|
||||
|
||||
@interface RCTPerformanceLogger : NSObject <RCTBridgeModule>
|
||||
|
||||
@end
|
||||
@@ -88,15 +101,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
[_bridge enqueueJSCall:@"PerformanceLogger.addTimespans" args:@[
|
||||
RCTPerformanceLoggerOutput(),
|
||||
@[
|
||||
@"ScriptDownload",
|
||||
@"ScriptExecution",
|
||||
@"NativeModuleInit",
|
||||
@"NativeModulePrepareConfig",
|
||||
@"NativeModuleInjectConfig",
|
||||
@"TTI",
|
||||
@"BundleSize",
|
||||
],
|
||||
RCTPerformanceLoggerLabels(),
|
||||
]];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user