Re #77: Renamed LogBufferAgent and its thread (ReadingLogBufferAndSendingHttp) to LogShipper. Added option to configure time it sleeps between reading from log buffer to not hog CPU. Also now default is 25ms instead of hardcoded 1ms previously.

This commit is contained in:
tomasz.kowalczewski committed 2021-10-21 18:50:24 +02:00
1 parent 7883f4851f
commit 7ae613aae1
1 file changed
+12
@@ -74,6 +74,9 @@ public class LokiAppenderBuilder<B extends LokiAppenderBuilder<B>> extends Abstr
@PluginBuilderAttribute
private long batchWait = 5;
@PluginBuilderAttribute
private long logShipperIntervalMillis = 250;
@PluginBuilderAttribute
private int shutdownTimeoutSeconds = 10;
@@ -142,6 +145,7 @@ public class LokiAppenderBuilder<B extends LokiAppenderBuilder<B>> extends Abstr
TimeUnit.SECONDS.toMillis(batchWait),
bufferSizeBytes,
TimeUnit.SECONDS.toMillis(shutdownTimeoutSeconds),
logShipperIntervalMillis,
isUseOffHeapBuffer()
);
@@ -247,6 +251,14 @@ public class LokiAppenderBuilder<B extends LokiAppenderBuilder<B>> extends Abstr
this.batchWait = batchWait;
}
public long getLogShipperIntervalMillis() {
return logShipperIntervalMillis;
}
public void setLogShipperIntervalMillis(long logShipperIntervalMillis) {
this.logShipperIntervalMillis = logShipperIntervalMillis;
}
public int getShutdownTimeoutSeconds() {
return shutdownTimeoutSeconds;
}