Skip to content

Commit

Permalink
Cleaned up some unused stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
mbruin-NR committed Dec 20, 2023
1 parent 252780c commit 3f40154
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 0 additions & 2 deletions Agent/Analytics/Events/NRMAMobileEvent.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#import "NRMAMobileEvent.h"
#import "Constants.h"
#import "NewRelicInternalUtils.h"

static NSString* const kTimestampKey = @"Timestamp";
static NSString* const kSessionElapsedTimeKey = @"SessionElapsedTime";
Expand Down Expand Up @@ -57,7 +56,6 @@ - (id)JSONObject {
dict[kNRMA_RA_timestamp] = @(self.timestamp);
dict[kNRMA_RA_sessionElapsedTime] = @(self.sessionElapsedTimeSeconds);
dict[kNRMA_RA_eventType] = self.eventType;

return [NSDictionary dictionaryWithDictionary:dict];
}

Expand Down
1 change: 0 additions & 1 deletion Agent/Harvester/NRMAHarvesterConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#import "NRMAJSON.h"
#import "NRMAConnection.h"
#import "NRMAOfflineStorage.h"
#import "NRMAHarvestData.h"

#define kCOLLECTOR_CONNECT_URI @"/mobile/v4/connect"
#define kCOLLECTOR_DATA_URL @"/mobile/v3/data"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class UtilViewModel {
options.append(UtilOption(title: "Record Error", handler: { [self] in makeError()}))
options.append(UtilOption(title: "Record Handled Exception", handler: { triggerException.testing()}))
options.append(UtilOption(title: "Set UserID", handler: { [self] in changeUserID()}))
options.append(UtilOption(title: "Make 100 events", handler: { [self] in make100Events()}))
options.append(UtilOption(title: "Make 100 events every 10 seconds", handler: { [self] in startCustomEventTimer()}))
options.append(UtilOption(title: "Stop 100 events every 10 seconds", handler: { [self] in stopCustomEventTimer()}))
options.append(UtilOption(title: "Start Interaction Trace", handler: { [self] in startInteractionTrace()}))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,21 @@ -(void)testAgentStopSupportMetric {
XCTAssertEqualObjects(measurement.name, fullMetricName, @"Name is not generated properly.");
}

-(void)testOfflinePayloadSupportMetric {

[NRMASupportMetricHelper enqueueOfflinePayloadMetric:1];

[NRMASupportMetricHelper processDeferredMetrics];

[NRMATaskQueue synchronousDequeue];

XCTAssertTrue([helper.result isKindOfClass:[NRMANamedValueMeasurement class]], @"The result is not a named value.");

NRMANamedValueMeasurement* measurement = ((NRMANamedValueMeasurement*)helper.result);

NSString* fullMetricName = [NSString stringWithFormat: kNRMAOfflineSupportabilityFormatString, [NewRelicInternalUtils osName], [NewRelicInternalUtils stringFromNRMAApplicationPlatform:[NRMAAgentConfiguration connectionInformation].deviceInformation.platform], kNRMACollectorDest];
XCTAssertEqualObjects(measurement.name, fullMetricName, @"Name is not generated properly.");
XCTAssertTrue(([measurement.value isEqual: @1]), @"Value is not generated properly.");
}

@end

0 comments on commit 3f40154

Please sign in to comment.