This repository has been archived by the owner on Jun 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [iOS] more info use new protocol WXApmProtocol to record weex page performance record stage (download -> success/falied -> renderStart -> fsRenderTime -> interactionTime -> destroy) record property , such as wxInstanceType(page/embed) ,wxParentPage(for embed) ... record stats : wxBundleSize、wxMaxDeepVDomLayer、wxCellUnReUseCount reord event : gc、press home and so on (not impl now) deprecated WXMonitor more performance point add WXApmGeneratorImpl (WXApmProtocol impl case ) in demo
- Loading branch information
1 parent
6e680c2
commit 539621f
Showing
28 changed files
with
810 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#import <Foundation/Foundation.h> | ||
#import "WXApmProtocol.h" | ||
|
||
@interface WXApmGeneratorImpl : NSObject <WXApmGeneratorProtocol> | ||
|
||
@end |
12 changes: 12 additions & 0 deletions
12
ios/playground/WeexDemo/extend/handler/WXApmGeneratorImpl.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#import "WXApmGeneratorImpl.h" | ||
#import "WXApmImpl.h" | ||
|
||
@implementation WXApmGeneratorImpl | ||
|
||
- (id<WXApmProtocol>)gengratorApmInstance:(NSString *) type | ||
{ | ||
id<WXApmProtocol> instance = [[WXApmImpl alloc] init]; | ||
return instance; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#import <Foundation/Foundation.h> | ||
#import "WXApmProtocol.h" | ||
|
||
@interface WXApmImpl : NSObject <WXApmProtocol> | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
|
||
#import "WXApmImpl.h" | ||
#import "WXUtility.h" | ||
|
||
@interface WXApmImpl() | ||
@property(nonatomic,strong) NSMutableDictionary<NSString*,NSNumber*>* stageMap; | ||
@property(nonatomic,strong) NSMutableDictionary<NSString*,id>* propertyMap; | ||
@property(nonatomic,strong) NSMutableDictionary<NSString*,NSNumber*>* statisticMap; | ||
@property(nonatomic,strong) NSMutableDictionary<NSString*,id>* eventMap; | ||
|
||
@end | ||
|
||
@implementation WXApmImpl | ||
|
||
- (instancetype)init | ||
{ | ||
self = [super init]; | ||
if (self) { | ||
_stageMap = [[NSMutableDictionary alloc] init]; | ||
_propertyMap = [[NSMutableDictionary alloc] init]; | ||
_statisticMap = [[NSMutableDictionary alloc] init]; | ||
_eventMap = [[NSMutableDictionary alloc] init]; | ||
} | ||
return self; | ||
} | ||
|
||
|
||
- (void) onStart:(NSString *)instanceId topic:(NSString *)topic | ||
{ | ||
|
||
} | ||
|
||
- (void) onEnd | ||
{ | ||
[self _printApmInfo]; | ||
} | ||
|
||
- (void) onEvent:(NSString *)name withValue:(id)value | ||
{ | ||
[self.eventMap setObject:value forKey:name]; | ||
} | ||
|
||
- (void) onStage:(NSString *)name withValue:(long)timestamp | ||
{ | ||
[self.stageMap setObject:[NSNumber numberWithLong:timestamp] forKey:name]; | ||
} | ||
|
||
- (void) addProperty:(NSString *)name withValue:(id)value | ||
{ | ||
[self.propertyMap setObject:value forKey:name]; | ||
} | ||
|
||
- (void) addStatistic:(NSString *)name withValue:(double)value | ||
{ | ||
[self.statisticMap setObject:[NSNumber numberWithDouble:value] forKey:name]; | ||
} | ||
|
||
- (void) addBiz:(NSString *)bizID withValue:(NSDictionary *)properties | ||
{ | ||
|
||
} | ||
|
||
- (void) addBizAbTest:(NSString *)bizID withValue:(NSDictionary *)abTest | ||
{ | ||
|
||
} | ||
|
||
- (void) addBizStage:(NSString *)bizID withValue:(NSDictionary *)stage | ||
{ | ||
|
||
} | ||
|
||
- (void) onSubProcedureBegin:(NSString *)subProcedureName | ||
{ | ||
|
||
} | ||
|
||
- (void) onSubProcedureEndFailed:(NSString *)subProcedureName | ||
{ | ||
|
||
} | ||
|
||
- (void) onSubProcedureEndSucceed:(NSString *)subProcedureName | ||
{ | ||
|
||
} | ||
|
||
- (void)pauseApmRecord { | ||
|
||
} | ||
|
||
|
||
- (void)resumeApmRecord { | ||
|
||
} | ||
|
||
|
||
- (void) _printApmInfo | ||
{ | ||
NSDictionary* InfoMap = @{ | ||
@"stage":self.stageMap, | ||
@"property":self.propertyMap, | ||
@"statistic":self.statisticMap, | ||
@"event":self.eventMap | ||
}; | ||
NSString* jsonStr = [WXUtility JSONString:InfoMap]; | ||
NSLog(@"wxApmForInstance :%@",jsonStr); | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.