[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:
Tadeu Zagallo
2015-06-03 05:38:21 -07:00
parent 10b13512b9
commit 158d8b64ff
4 changed files with 82 additions and 10 deletions

View File

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