feat:add global anchor hook to monitor all performance hook

This commit is contained in:
pengfei.zhou
2021-07-20 10:50:24 +08:00
committed by osborn
parent ba3635769a
commit 17e14e7119
16 changed files with 303 additions and 12 deletions

View File

@@ -54,6 +54,9 @@ + (instancetype)instance {
- (void)createContext:(DoricContext *)context script:(NSString *)script source:(NSString *)source {
context.contextId = [NSString stringWithFormat:@"%ld", (long) ++self.counter];
context.performanceProfile = [[DoricPerformanceProfile alloc] initWithName:context.contextId];
if (context.driver.registry.globalPerformanceAnchorHook) {
[context.performanceProfile addAnchorHook:context.driver.registry.globalPerformanceAnchorHook];
}
dispatch_sync(self.mapQueue, ^() {
[self.contextMapTable setObject:context forKey:context.contextId];
});