File tree 5 files changed +35
-13
lines changed
5 files changed +35
-13
lines changed Original file line number Diff line number Diff line change 23
23
- (void )groupContextExample ;
24
24
- (void )gaugeMetricExample ;
25
25
- (void )notificationExample ;
26
+ - (void )customUAExample ;
26
27
27
28
@end
Original file line number Diff line number Diff line change @@ -164,6 +164,19 @@ - (void)gaugeMetricExample
164
164
}
165
165
166
166
167
+ /*
168
+ You can add a custom string the User Agent sent with all of the Librato requests
169
+ WARNING: Setting a custom UA will reset your client's connection so do not do this arbitrarily
170
+ */
171
+ - (void )customUAExample
172
+ {
173
+ Librato *l = LibratoDemoEventTracker.sharedInstance ;
174
+ l.customUserAgent = @" Demo UA" ;
175
+
176
+ [l submit: @{@" ua.custom.instances" : @1 }];
177
+ }
178
+
179
+
167
180
#pragma mark - Helpers
168
181
- (NSNumber *)randomNumber
169
182
{
Original file line number Diff line number Diff line change @@ -31,12 +31,6 @@ - (instancetype)init
31
31
return self;
32
32
}
33
33
34
- // TODO: Implelement
35
- - (NSString *)agentIdentifier
36
- {
37
- return @" " ;
38
- }
39
-
40
34
41
35
- (void )authenticateEmail : (NSString *)emailAddress APIKey : (NSString *)apiKey
42
36
{
Original file line number Diff line number Diff line change @@ -38,10 +38,12 @@ typedef void (^LibratoNotificationContext)(NSNotification *notification);
38
38
- (void )authenticateEmail : (NSString *)emailAddress APIKey : (NSString *)apiKey ;
39
39
- (NSString *)APIEndpoint ;
40
40
- (void )setAPIEndpoint : (NSString *)APIEndpoint ;
41
+ - (LibratoConnection *)connection ;
42
+ - (NSString *)customUserAgent ;
43
+ - (void )setCustomUserAgent : (NSString *)userAgent ;
41
44
- (NSString *)persistence ;
42
45
- (void )setPersistence : (NSString *)persistence ;
43
46
- (id <LibratoPersister>)persister ;
44
- - (LibratoConnection *)connection ;
45
47
- (void )getMetric : (NSString *)name options : (NSDictionary *)options ;
46
48
- (void )getMeasurements : (NSString *)named options : (NSDictionary *)options ;
47
49
- (void )updateMetricsNamed : (NSString *)name options : (NSDictionary *)options ;
Original file line number Diff line number Diff line change @@ -70,6 +70,24 @@ - (void)setAPIEndpoint:(NSString *)APIEndpoint
70
70
}
71
71
72
72
73
+ - (LibratoConnection *)connection
74
+ {
75
+ return self.client .connection ;
76
+ }
77
+
78
+
79
+ - (NSString *)customUserAgent
80
+ {
81
+ return self.client .customUserAgent ;
82
+ }
83
+
84
+
85
+ - (void )setCustomUserAgent : (NSString *)userAgent
86
+ {
87
+ self.client .customUserAgent = userAgent;
88
+ }
89
+
90
+
73
91
- (NSString *)persistence
74
92
{
75
93
return self.client .persistence ;
@@ -88,12 +106,6 @@ - (void)setPersistence:(NSString *)persistence
88
106
}
89
107
90
108
91
- - (LibratoConnection *)connection
92
- {
93
- return self.client .connection ;
94
- }
95
-
96
-
97
109
- (void )getMetric : (NSString *)name options : (NSDictionary *)options
98
110
{
99
111
[self .client getMetric: name options: options];
You can’t perform that action at this time.
0 commit comments