Skip to content

Commit

Permalink
Merge pull request #248 from rollbar/remove_oom
Browse files Browse the repository at this point in the history
Remove faulty Out of Memory detection
  • Loading branch information
matux authored Jan 17, 2023
2 parents 1fe2d01 + 4ebe06e commit 82fbdc0
Show file tree
Hide file tree
Showing 15 changed files with 5 additions and 1,001 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
static RollbarLevel const DEFAULT_CRASH_LEVEL = RollbarLevel_Error;
static NSUInteger const DEFAULT_MAX_REPORTS_PER_MINUTE = 60;
static RollbarCaptureIpType const DEFAULT_IP_CAPTURE_TYPE = RollbarCaptureIpType_Full;
static BOOL const DEFAULT_OOM_DETECTION = YES;

#if TARGET_OS_IPHONE
static NSString * const OPERATING_SYSTEM = @"ios";
Expand All @@ -23,7 +22,6 @@
static NSString * const DFK_CODE_VERSION = @"codeVersion";
static NSString * const DFK_FRAMEWORK = @"framework";
static NSString * const DFK_REQUEST_ID = @"requestId";
static NSString * const DFK_OOM_DETECTION = @"oomDetection";

#pragma mark - class implementation

Expand All @@ -37,8 +35,7 @@ - (instancetype)initWithLogLevel:(RollbarLevel)logLevel
captureIp:(RollbarCaptureIpType)captureIp
codeVersion:(nullable NSString *)codeVersion
framework:(nullable NSString *)framework
requestId:(nullable NSString *)requestId
enableOomDetection:(BOOL)enableOomDetection {
requestId:(nullable NSString *)requestId {

self = [super initWithDictionary:@{
DFK_LOG_LEVEL: [RollbarLevelUtil RollbarLevelToString:logLevel],
Expand All @@ -48,31 +45,10 @@ - (instancetype)initWithLogLevel:(RollbarLevel)logLevel
DFK_CODE_VERSION: codeVersion ? codeVersion : [NSNull null],
DFK_FRAMEWORK: framework ? framework : OPERATING_SYSTEM,
DFK_REQUEST_ID: requestId ? requestId : [NSNull null],
DFK_OOM_DETECTION: [NSNumber numberWithBool:enableOomDetection]
}];
return self;
}

- (instancetype)initWithLogLevel:(RollbarLevel)logLevel
crashLevel:(RollbarLevel)crashLevel
maximumReportsPerMinute:(NSUInteger)maximumReportsPerMinute
captureIp:(RollbarCaptureIpType)captureIp
codeVersion:(nullable NSString *)codeVersion
framework:(nullable NSString *)framework
requestId:(nullable NSString *)requestId {

self = [self initWithLogLevel:logLevel
crashLevel:crashLevel
maximumReportsPerMinute:maximumReportsPerMinute
captureIp:captureIp
codeVersion:codeVersion
framework:framework
requestId:requestId
enableOomDetection:DEFAULT_OOM_DETECTION
];
return self;
}

- (instancetype)initWithLogLevel:(RollbarLevel)logLevel
crashLevel:(RollbarLevel)crashLevel
maximumReportsPerMinute:(NSUInteger)maximumReportsPerMinute
Expand Down Expand Up @@ -185,13 +161,6 @@ - (nullable NSString *)requestId {
return [self getDataByKey:DFK_REQUEST_ID];
}

- (BOOL)enableOomDetection {

BOOL result = [self safelyGetBoolByKey:DFK_OOM_DETECTION
withDefault:DEFAULT_OOM_DETECTION];
return result;
}

@end

@implementation RollbarMutableLoggingOptions
Expand All @@ -215,7 +184,6 @@ -(instancetype)init {
@dynamic codeVersion;
@dynamic framework;
@dynamic requestId;
@dynamic enableOomDetection;

- (void)setLogLevel:(RollbarLevel)level {
NSString *levelString = [RollbarLevelUtil RollbarLevelToString:level];
Expand Down Expand Up @@ -260,11 +228,4 @@ - (void)setRequestId:(nullable NSString *)value {
[self setData:value byKey:DFK_REQUEST_ID];
}

- (void)setEnableOomDetection:(BOOL)value {

[self setBool:value
forKey:DFK_OOM_DETECTION
];
}

@end
191 changes: 0 additions & 191 deletions RollbarNotifier/Sources/RollbarNotifier/DTOs/RollbarSessionState.m

This file was deleted.

1 change: 0 additions & 1 deletion RollbarNotifier/Sources/RollbarNotifier/Rollbar.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#import "RollbarTelemetryOptions.h"
#import "RollbarTelemetryOptionsObserver.h"
#import "RollbarScrubbingOptions.h"
#import "RollbarSession.h"
#import "RollbarThread.h"
#import "RollbarLoggingOptions.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#import "RollbarLoggerProtocol.h"
#import "RollbarLogger.h"
#import "RollbarNotifierFiles.h"
#import "RollbarSession.h"
#import "RollbarTelemetry.h"
#import "RollbarCrashCollector.h"

Expand Down Expand Up @@ -46,10 +45,6 @@ - (nonnull instancetype)configureWith:(nonnull RollbarConfig *)config {
self.collector = [[RollbarCrashCollector alloc] init];
[self.collector collectCrashReports];

[[RollbarSession sharedInstance] enableOomMonitoring:config.loggingOptions.enableOomDetection withCrashCheck:^() {
return (BOOL)(self.collector.totalProcessedReports > 0);
}];

[[RollbarTelemetry sharedInstance] configureWithOptions:config.telemetry];

RollbarSdkLog(@"%@ is configured with this RollbarConfig instance: \n%@",
Expand Down
46 changes: 0 additions & 46 deletions RollbarNotifier/Sources/RollbarNotifier/RollbarSession.h

This file was deleted.

Loading

0 comments on commit 82fbdc0

Please sign in to comment.