mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +08:00
Introduce Perf Monitor
Summary: public Kill `RCTPerfStats` and introduce the new `RCTPerfMonitor`, including memory usage, JSC heap size, number of RN views in screen, FPS (both on UI and JS threads) and more to come. It removes all the previous traces that were previous spread across the bridge and the dev menu and moves everything to be more contained, so the whole thing can be safely striped in production. Reviewed By: nicklockwood Differential Revision: D2575158 fb-gh-sync-id: 6a6d0c4422adbddeeefddd32ec3409a7095ff2a9
This commit is contained in:
committed by
facebook-github-bot-7
parent
cae4761006
commit
9069bdf1c2
@@ -15,7 +15,6 @@
|
||||
#import "RCTEventDispatcher.h"
|
||||
#import "RCTKeyCommands.h"
|
||||
#import "RCTLog.h"
|
||||
#import "RCTPerfStats.h"
|
||||
#import "RCTProfile.h"
|
||||
#import "RCTRootView.h"
|
||||
#import "RCTSourceCode.h"
|
||||
@@ -182,22 +181,6 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
__weak RCTDevMenu *weakSelf = self;
|
||||
|
||||
[_extraMenuItems addObject:[RCTDevMenuItem toggleItemWithKey:@"showFPS"
|
||||
title:@"Show FPS Monitor"
|
||||
selectedTitle:@"Hide FPS Monitor"
|
||||
handler:^(BOOL showFPS)
|
||||
{
|
||||
RCTDevMenu *strongSelf = weakSelf;
|
||||
if (strongSelf) {
|
||||
strongSelf->_showFPS = showFPS;
|
||||
if (showFPS) {
|
||||
[strongSelf.bridge.perfStats show];
|
||||
} else {
|
||||
[strongSelf.bridge.perfStats hide];
|
||||
}
|
||||
}
|
||||
}]];
|
||||
|
||||
[_extraMenuItems addObject:[RCTDevMenuItem toggleItemWithKey:@"showInspector"
|
||||
title:@"Show Inspector"
|
||||
selectedTitle:@"Hide Inspector"
|
||||
|
||||
Reference in New Issue
Block a user