Skip to content

Commit

Permalink
Re #77: Improved property naming (logShipperIntervalMillis -> logShip…
Browse files Browse the repository at this point in the history
…perWakeupIntervalMillis) and implemented missing Logback part.
  • Loading branch information
tkowalcz committed Oct 21, 2021
1 parent 7ae613a commit bca115e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/pl/tkowalcz/tjahzi/TjahziInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public LoggingSystem createLoggingSystem(
long batchSizeBytes,
long batchWaitMillis,
int bufferSizeBytes,
long logShipperIntervalMillis,
long logShipperWakeupIntervalMillis,
long shutdownTimeoutMillis,
boolean offHeap
) {
Expand Down Expand Up @@ -54,7 +54,7 @@ public LoggingSystem createLoggingSystem(
);

AgentRunner runner = new AgentRunner(
new SleepingMillisIdleStrategy(logShipperIntervalMillis),
new SleepingMillisIdleStrategy(logShipperWakeupIntervalMillis),
monitoringModule::addAgentError,
null,
agent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class LokiAppenderBuilder<B extends LokiAppenderBuilder<B>> extends Abstr
private long batchWait = 5;

@PluginBuilderAttribute
private long logShipperIntervalMillis = 250;
private long logShipperWakeupIntervalMillis = 250;

@PluginBuilderAttribute
private int shutdownTimeoutSeconds = 10;
Expand Down Expand Up @@ -145,7 +145,7 @@ public LokiAppender build() {
TimeUnit.SECONDS.toMillis(batchWait),
bufferSizeBytes,
TimeUnit.SECONDS.toMillis(shutdownTimeoutSeconds),
logShipperIntervalMillis,
logShipperWakeupIntervalMillis,
isUseOffHeapBuffer()
);

Expand Down Expand Up @@ -251,12 +251,12 @@ public void setBatchWait(long batchWait) {
this.batchWait = batchWait;
}

public long getLogShipperIntervalMillis() {
return logShipperIntervalMillis;
public long getLogShipperWakeupIntervalMillis() {
return logShipperWakeupIntervalMillis;
}

public void setLogShipperIntervalMillis(long logShipperIntervalMillis) {
this.logShipperIntervalMillis = logShipperIntervalMillis;
public void setLogShipperWakeupIntervalMillis(long logShipperWakeupIntervalMillis) {
this.logShipperWakeupIntervalMillis = logShipperWakeupIntervalMillis;
}

public int getShutdownTimeoutSeconds() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public abstract class LokiAppenderConfigurator extends UnsynchronizedAppenderBas
private long batchSize = 10_2400;
private long batchWait = 5;
private long shutdownTimeoutSeconds = 10;
private long logShipperWakeupIntervalMillis = 250;

private int maxRequestsInFlight = 100;

Expand Down Expand Up @@ -120,6 +121,14 @@ public void setShutdownTimeoutSeconds(long shutdownTimeoutSeconds) {
this.shutdownTimeoutSeconds = shutdownTimeoutSeconds;
}

public long getLogShipperWakeupIntervalMillis() {
return logShipperWakeupIntervalMillis;
}

public void setLogShipperWakeupIntervalMillis(long logShipperWakeupIntervalMillis) {
this.logShipperWakeupIntervalMillis = logShipperWakeupIntervalMillis;
}

public int getMaxRequestsInFlight() {
return maxRequestsInFlight;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public LoggingSystem createAppender() {
TimeUnit.SECONDS.toMillis(configurator.getBatchWait()),
bufferSizeBytes,
TimeUnit.SECONDS.toMillis(configurator.getShutdownTimeoutSeconds()),
configurator.getLogShipperWakeupIntervalMillis(),
configurator.isUseOffHeapBuffer()
);
}
Expand Down

0 comments on commit bca115e

Please sign in to comment.