Sets the maximum size of total data that can be stored for offline storage.
By default, mobile monitoring can collect a maximum of 100 megaBytes of offline storage. When a data payload fails to send because the device doesn't have an internet connection, it can be stored in the file system until an internet connection has been made. After a typical harvest payload has been successfully sent, all offline data is sent to New Relic and cleared from storage.
This method controls the maximum amount of offline storage that can be stored in the file system. When the size limit is reached, the New Relic mobile agent will discard the new payloads that couldn't be stored. This method lets you override the maximum size of that offline storage.
重要
Offline storage is disabled by default. To enable it, add the following feature flag:
NewRelic.enableFeature(FeatureFlag.OfflineStorage)
For details on adding feature flags, see Configure mobile monitoring settings.
Syntax
Java
NewRelic.setMaxOfflineStorageSize(int $megaBytes)
Kotlin
NewRelic.setMaxOfflineStorageSize(megaBytes: Int)
Parameters
Parameter | Type | Description |
---|---|---|
|
| Required. Maximum size in megaBytes that can be stored in the file system. |
Example
Here's an example to set max offline storage size to 1000:
Java
NewRelic.setMaxOfflineStorageSize(1000);
Kotlin
NewRelic.setMaxOfflineStorageSize(1000)
重要
Offline storage is disabled by default. To enable it, add the following feature flag:
NewRelic.enableFeatures(NRMAFeatureFlags.NRFeatureFlag_OfflineStorage)
For details on adding feature flags, see Configure mobile monitoring settings.
Syntax
Objective-C
+ (void) setMaxOfflineStorageSize:(unsigned int)size;
Swift
NewRelic.setMaxOfflineStorageSize(unsigned int $size)
Parameters
Parameter | Type | Description |
---|---|---|
|
| Required. Maximum size in megaBytes that can be stored in the file system. |
Examples
Objective-C
BOOL poolSizeSet = [NewRelic setMaxOfflineStorageSize:1000];
Swift
let poolSizeSet = NewRelic.setMaxOfflineStorageSize(1000)
重要
Offline storage is enabled by default. If you need to disable it, add the following feature flag:
offlineStorageEnabled: false
For details on adding feature flags, see Configure mobile monitoring settings.
Syntax
setMaxOfflineStorageSize(options: { megabytes: number; }) => void
Parameters
Parameter | Type | Description |
---|---|---|
|
| Required. Maximum size in megaBytes that can be stored in the file system. |
Example
NewRelicCapacitorPlugin.setMaxOfflineStorageSize({ megaBytes: 200 })
重要
Offline storage is enabled by default. If you need to disable it, add the following feature flag:
OFFLINE_STORAGE_ENABLED = "false"
For details on adding feature flags, see Configure mobile monitoring settings.
Syntax
setMaxOfflineStorageSize(megabytes: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
|
| Required. Maximum size in megaBytes that can be stored in the file system. |
Example
NewRelic.setMaxOfflineStorageSize(200);
重要
Offline storage is enabled by default. If you need to disable it, add the following feature flag:
offlineStorageEnabled: false
For details on adding feature flags, see Configure mobile monitoring settings.
Syntax
setMaxOfflineStorageSize(int megabytes): void;
Parameters
Parameter | Type | Description |
---|---|---|
|
| Required. Maximum size in megaBytes that can be stored in the file system. |
Example
CrossNewRelic.Current.SetMaxOfflineStorageSize(200);
重要
Offline storage is enabled by default. If you need to disable it, add the following feature flag:
offlineStorageEnabled: false
For details on adding feature flags, see Configure mobile monitoring settings.
Syntax
setMaxOfflineStorageSize(int megabytes): void;
Parameters
Parameter | Type | Description |
---|---|---|
|
| Required. Maximum size in megaBytes that can be stored in the file system. |
Example
NewrelicMobile.instance.setMaxOfflineStorageSize(200);
重要
Offline storage is enabled by default. If you need to disable it, add the following feature flag:
offlineStorageEnabled: false
For details on adding feature flags, see Configure mobile monitoring settings.
Syntax
setMaxOfflineStorageSize(megabytes: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
|
| Required. Maximum size in megaBytes that can be stored in the file system. |
Example
NewRelic.setMaxOfflineStorageSize(200);
重要
Offline storage is enabled by default. If you need to disable it, see Configure mobile monitoring settings.
Syntax
SetMaxOfflineStorageSize(int maxOfflineStorageSize): void;
Parameters
Parameter | Type | Description |
---|---|---|
|
| Required. Maximum size in megaBytes that can be stored in the file system. |
Example
NewRelicAgent.SetMaxOfflineStorageSize(200);
重要
Offline storage is enabled by default. If you need to disable it, add the following feature flag:
offlineStorageEnabled: false
For details on adding feature flags, see Configure mobile monitoring settings.
Syntax
SetMaxOfflineStorageSize(int megabytes): void;
Parameters
Parameter | Type | Description |
---|---|---|
|
| Required. Maximum size in megaBytes that can be stored in the file system.. |
Example
CrossNewRelicClient.Current.SetMaxOfflineStorageSize(200);