/
DTXRNBridgeCountersPlotController.m
75 lines (59 loc) · 1.53 KB
/
DTXRNBridgeCountersPlotController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//
// DTXRNBridgeCountersPlotController.m
// DetoxInstruments
//
// Created by Leo Natan (Wix) on 31/07/2017.
// Copyright © 2017 Wix. All rights reserved.
//
#import "DTXRNBridgeCountersPlotController.h"
#import "DTXRNBridgeCallsDataProvider.h"
@implementation DTXRNBridgeCountersPlotController
+ (Class)UIDataProviderClass
{
return [DTXRNBridgeCallsDataProvider class];
}
- (Class)classForPerformanceSamples
{
return [DTXReactNativePeroformanceSample class];
}
- (NSString *)displayName
{
return NSLocalizedString(@"Bridge Counters", @"");
}
- (NSString *)toolTip
{
return NSLocalizedString(@"The Bridge Counters instrument captures information about React Native bridge calls made by the profiled app.", @"");
}
- (NSImage*)displayIcon
{
return [NSImage imageNamed:@"counters"];
}
- (NSImage *)secondaryIcon
{
return [NSImage imageNamed:@"react"];
}
- (NSArray<NSString*>*)sampleKeys
{
return @[@"bridgeNToJSCallCountDelta", @"bridgeJSToNCallCountDelta"];
}
- (NSArray<NSColor*>*)plotColors
{
return @[[NSColor.systemPurpleColor colorWithAlphaComponent:1.0], [NSColor.systemOrangeColor colorWithAlphaComponent:1.0]];
}
- (NSArray<NSString*>*)plotTitles
{
return @[NSLocalizedString(@"Native to JavaScript", @""), NSLocalizedString(@"JavaScript to Native", @"")];
}
- (NSArray<NSString*>*)legendTitles
{
return @[NSLocalizedString(@"N → JS", @""), NSLocalizedString(@"JS → N", @"")];
}
- (BOOL)isStepped
{
return YES;
}
+ (NSFormatter*)formatterForDataPresentation
{
return [NSFormatter dtx_stringFormatter];
}
@end