diff --git a/rollbar-java/src/main/java/com/rollbar/notifier/config/ConfigBuilder.java b/rollbar-java/src/main/java/com/rollbar/notifier/config/ConfigBuilder.java index cbf9fd1e..519b1a78 100644 --- a/rollbar-java/src/main/java/com/rollbar/notifier/config/ConfigBuilder.java +++ b/rollbar-java/src/main/java/com/rollbar/notifier/config/ConfigBuilder.java @@ -87,16 +87,11 @@ public class ConfigBuilder { protected boolean truncateLargePayloads; - private int maximumTelemetryData = DEFAULT_CAPACITY_FOR_TELEMETRY_EVENTS; + private int maximumTelemetryData = + RollbarTelemetryEventTracker.MAXIMUM_CAPACITY_FOR_TELEMETRY_EVENTS; private TelemetryEventTracker telemetryEventTracker; - private static final int MINIMUM_CAPACITY_FOR_TELEMETRY_EVENTS = 1; - - private static final int DEFAULT_CAPACITY_FOR_TELEMETRY_EVENTS = 10; - - private static final int MAXIMUM_CAPACITY_FOR_TELEMETRY_EVENTS = 50; - /** * Constructor with an access token. */ @@ -487,23 +482,13 @@ public ConfigBuilder truncateLargePayloads(boolean truncate) { /** *

- * Maximum Telemetry Events sent in a payload (This value can be between 1 and 50, exceed any of - * these thresholds and the closest will be taken). Default: 10. + * Maximum Telemetry Events sent in a payload. Default is + * {@value RollbarTelemetryEventTracker#MAXIMUM_CAPACITY_FOR_TELEMETRY_EVENTS}. *

* @param maximumTelemetryData max quantity of telemetry events sent. * @return the builder instance. */ public ConfigBuilder maximumTelemetryData(int maximumTelemetryData) { - if (maximumTelemetryData < MINIMUM_CAPACITY_FOR_TELEMETRY_EVENTS) { - this.maximumTelemetryData = MINIMUM_CAPACITY_FOR_TELEMETRY_EVENTS; - return this; - } - - if (maximumTelemetryData > MAXIMUM_CAPACITY_FOR_TELEMETRY_EVENTS) { - this.maximumTelemetryData = MAXIMUM_CAPACITY_FOR_TELEMETRY_EVENTS; - return this; - } - this.maximumTelemetryData = maximumTelemetryData; return this; } diff --git a/rollbar-java/src/main/java/com/rollbar/notifier/telemetry/RollbarTelemetryEventTracker.java b/rollbar-java/src/main/java/com/rollbar/notifier/telemetry/RollbarTelemetryEventTracker.java index bfa0ad0d..4aaf053e 100644 --- a/rollbar-java/src/main/java/com/rollbar/notifier/telemetry/RollbarTelemetryEventTracker.java +++ b/rollbar-java/src/main/java/com/rollbar/notifier/telemetry/RollbarTelemetryEventTracker.java @@ -17,6 +17,7 @@ * Default {@link TelemetryEventTracker}. */ public class RollbarTelemetryEventTracker implements TelemetryEventTracker { + public static final int MAXIMUM_CAPACITY_FOR_TELEMETRY_EVENTS = 100; private final int maximumTelemetryData; private final Queue telemetryEvents = new ConcurrentLinkedQueue<>(); private final Provider timestampProvider; @@ -27,7 +28,6 @@ public class RollbarTelemetryEventTracker implements TelemetryEventTracker { private static final String NETWORK_KEY_URL = "url"; private static final String NETWORK_KEY_STATUS_CODE = "status_code"; private static final int NO_CAPACITY = 0; - private static final int MAXIMUM_CAPACITY_FOR_TELEMETRY_EVENTS = 100; /** * Construct a {@link RollbarTelemetryEventTracker}. diff --git a/rollbar-java/src/test/java/com/rollbar/notifier/config/ConfigBuilderTest.java b/rollbar-java/src/test/java/com/rollbar/notifier/config/ConfigBuilderTest.java index a23aca01..b8199ee7 100644 --- a/rollbar-java/src/test/java/com/rollbar/notifier/config/ConfigBuilderTest.java +++ b/rollbar-java/src/test/java/com/rollbar/notifier/config/ConfigBuilderTest.java @@ -43,7 +43,7 @@ public class ConfigBuilderTest { static final String FRAMEWORK = "framework"; - private static final int DEFAULT_CAPACITY_FOR_TELEMETRY_EVENTS = 10; + private static final int DEFAULT_CAPACITY_FOR_TELEMETRY_EVENTS = 100; @Rule public MockitoRule rule = MockitoJUnit.rule(); diff --git a/rollbar-reactive-streams/src/main/java/com/rollbar/reactivestreams/notifier/config/ConfigBuilder.java b/rollbar-reactive-streams/src/main/java/com/rollbar/reactivestreams/notifier/config/ConfigBuilder.java index 10961f51..8deeb153 100644 --- a/rollbar-reactive-streams/src/main/java/com/rollbar/reactivestreams/notifier/config/ConfigBuilder.java +++ b/rollbar-reactive-streams/src/main/java/com/rollbar/reactivestreams/notifier/config/ConfigBuilder.java @@ -61,9 +61,9 @@ public final class ConfigBuilder { private boolean enabled; private DefaultLevels defaultLevels; private boolean truncateLargePayloads; - private int maximumTelemetryData = DEFAULT_CAPACITY_FOR_TELEMETRY_EVENTS; + private int maximumTelemetryData = + RollbarTelemetryEventTracker.MAXIMUM_CAPACITY_FOR_TELEMETRY_EVENTS; private TelemetryEventTracker telemetryEventTracker; - private static final int DEFAULT_CAPACITY_FOR_TELEMETRY_EVENTS = 10; /** @@ -471,9 +471,8 @@ public ConfigBuilder truncateLargePayloads(boolean truncate) { /** *

- * Maximum Telemetry Events sent in a payload (can be overwritten if the - * {@link TelemetryEventTracker} has thresholds like the {@link RollbarTelemetryEventTracker}). - * Default: 10. + * Maximum Telemetry Events sent in a payload. Default is + * {@value RollbarTelemetryEventTracker#MAXIMUM_CAPACITY_FOR_TELEMETRY_EVENTS}. *

* @param maximumTelemetryData max quantity of telemetry events sent. * @return the builder instance.