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:
Tadeu Zagallo
2015-10-30 16:51:48 -07:00
committed by facebook-github-bot-7
parent 3ee3041d68
commit 287e0e3c49
3 changed files with 118 additions and 15 deletions

View File

@@ -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);

View File

@@ -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(),
]];
}