Skip to content

Commit 3f40154

Browse files
committed
Cleaned up some unused stuff
1 parent 252780c commit 3f40154

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

Agent/Analytics/Events/NRMAMobileEvent.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#import "NRMAMobileEvent.h"
1010
#import "Constants.h"
11-
#import "NewRelicInternalUtils.h"
1211

1312
static NSString* const kTimestampKey = @"Timestamp";
1413
static NSString* const kSessionElapsedTimeKey = @"SessionElapsedTime";
@@ -57,7 +56,6 @@ - (id)JSONObject {
5756
dict[kNRMA_RA_timestamp] = @(self.timestamp);
5857
dict[kNRMA_RA_sessionElapsedTime] = @(self.sessionElapsedTimeSeconds);
5958
dict[kNRMA_RA_eventType] = self.eventType;
60-
6159
return [NSDictionary dictionaryWithDictionary:dict];
6260
}
6361

Agent/Harvester/NRMAHarvesterConnection.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#import "NRMAJSON.h"
1313
#import "NRMAConnection.h"
1414
#import "NRMAOfflineStorage.h"
15-
#import "NRMAHarvestData.h"
1615

1716
#define kCOLLECTOR_CONNECT_URI @"/mobile/v4/connect"
1817
#define kCOLLECTOR_DATA_URL @"/mobile/v3/data"

Test Harness/NRTestApp/NRTestApp/ViewModels/UtilViewModel.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class UtilViewModel {
3939
options.append(UtilOption(title: "Record Error", handler: { [self] in makeError()}))
4040
options.append(UtilOption(title: "Record Handled Exception", handler: { triggerException.testing()}))
4141
options.append(UtilOption(title: "Set UserID", handler: { [self] in changeUserID()}))
42+
options.append(UtilOption(title: "Make 100 events", handler: { [self] in make100Events()}))
4243
options.append(UtilOption(title: "Make 100 events every 10 seconds", handler: { [self] in startCustomEventTimer()}))
4344
options.append(UtilOption(title: "Stop 100 events every 10 seconds", handler: { [self] in stopCustomEventTimer()}))
4445
options.append(UtilOption(title: "Start Interaction Trace", handler: { [self] in startInteractionTrace()}))

Tests/Unit-Tests/NewRelicAgentTests/Uncategorized/NRMASupportMetricHelperTests.m

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,21 @@ -(void)testAgentStopSupportMetric {
7373
XCTAssertEqualObjects(measurement.name, fullMetricName, @"Name is not generated properly.");
7474
}
7575

76+
-(void)testOfflinePayloadSupportMetric {
77+
78+
[NRMASupportMetricHelper enqueueOfflinePayloadMetric:1];
79+
80+
[NRMASupportMetricHelper processDeferredMetrics];
81+
82+
[NRMATaskQueue synchronousDequeue];
83+
84+
XCTAssertTrue([helper.result isKindOfClass:[NRMANamedValueMeasurement class]], @"The result is not a named value.");
85+
86+
NRMANamedValueMeasurement* measurement = ((NRMANamedValueMeasurement*)helper.result);
87+
88+
NSString* fullMetricName = [NSString stringWithFormat: kNRMAOfflineSupportabilityFormatString, [NewRelicInternalUtils osName], [NewRelicInternalUtils stringFromNRMAApplicationPlatform:[NRMAAgentConfiguration connectionInformation].deviceInformation.platform], kNRMACollectorDest];
89+
XCTAssertEqualObjects(measurement.name, fullMetricName, @"Name is not generated properly.");
90+
XCTAssertTrue(([measurement.value isEqual: @1]), @"Value is not generated properly.");
91+
}
92+
7693
@end

0 commit comments

Comments
 (0)