Skip to content

Commit

Permalink
Fix issue with buffer size initialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
jshaughn committed Oct 31, 2016
1 parent 5c55391 commit 2733c78
Showing 1 changed file with 12 additions and 0 deletions.
Expand Up @@ -109,6 +109,7 @@ public class InsertedDataSubscriber {
public void onMetricsServiceReady(@Observes @ServiceReady ServiceReadyEvent event) {
if (!Boolean.parseBoolean(disableMetricsForwardingProperty)) {
publishPeriod = getPublishPeriod();
publishBufferSize = getPublishBufferSize();
disablePublishFiltering = Boolean.parseBoolean(disablePublishFilteringProperty);
Observable<List<Metric<?>>> events;
events = event.getInsertedData()
Expand Down Expand Up @@ -206,4 +207,15 @@ private int getPublishPeriod() {
return Integer.parseInt(METRICS_PUBLISH_PERIOD.defaultValue());
}
}

private int getPublishBufferSize() {
try {
return Integer.parseInt(publishBufferSizeProperty);
} catch (NumberFormatException e) {
log.warnf("Invalid publish buffer size. Setting default value %s",
METRICS_PUBLISH_BUFFER_SIZE.defaultValue());
return Integer.parseInt(METRICS_PUBLISH_BUFFER_SIZE.defaultValue());
}
}

}

0 comments on commit 2733c78

Please sign in to comment.