mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
[ReactNative] Track bridge events' flow (timers fixed)
Summary:
@public
Use trace-viewer's flow events to link the bridge calls
Test Plan: {F22498582}
This commit is contained in:
@@ -180,4 +180,32 @@ void RCTProfileImmediateEvent(NSString *name, NSTimeInterval timestamp, NSString
|
||||
);
|
||||
}
|
||||
|
||||
NSNumber *_RCTProfileBeginFlowEvent(void)
|
||||
{
|
||||
static NSUInteger flowID = 0;
|
||||
|
||||
CHECK(@0);
|
||||
RCTProfileAddEvent(RCTProfileTraceEvents,
|
||||
@"name": @"flow",
|
||||
@"id": @(++flowID),
|
||||
@"cat": @"flow",
|
||||
@"ph": @"s",
|
||||
@"ts": RCTProfileTimestamp(CACurrentMediaTime()),
|
||||
);
|
||||
|
||||
return @(flowID);
|
||||
}
|
||||
|
||||
void _RCTProfileEndFlowEvent(NSNumber *flowID)
|
||||
{
|
||||
CHECK();
|
||||
RCTProfileAddEvent(RCTProfileTraceEvents,
|
||||
@"name": @"flow",
|
||||
@"id": flowID,
|
||||
@"cat": @"flow",
|
||||
@"ph": @"f",
|
||||
@"ts": RCTProfileTimestamp(CACurrentMediaTime()),
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user