Skip to content

Commit

Permalink
+ changed default back buffer cap to 8192
Browse files Browse the repository at this point in the history
  • Loading branch information
q3769 committed May 8, 2023
1 parent d519e58 commit fd8f290
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<groupId>io.github.elf4j</groupId>
<artifactId>elf4j-engine</artifactId>
<version>8.0.1</version>
<version>8.0.2</version>
<packaging>jar</packaging>
<name>elf4j-engine</name>
<description>A stand-alone Java log engine implementing the ELF4J (Easy Logging Facade for Java) API</description>
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/elf4j/engine/NativeLoggerFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ public NativeLoggerFactory(@NonNull Class<?> serviceAccessClass) {
@NonNull LogService logService) {
this.defaultLoggerLevel = defaultLoggerLevel;
this.serviceAccessClass = serviceAccessClass;
this.nativeLoggers =
EnumSet.allOf(Level.class).stream().collect(toMap(Function.identity(), l -> new ConcurrentHashMap<>()));
this.nativeLoggers = EnumSet.allOf(Level.class)
.stream()
.collect(toMap(Function.identity(), level -> new ConcurrentHashMap<>()));
this.logService = logService;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ private ConseqLogEventProcessor(LogWriter logWriter, SequentialExecutor conseqEx
public static ConseqLogEventProcessor from(LogServiceConfiguration logServiceConfiguration) {
Properties properties = logServiceConfiguration.getProperties();
Integer workQueueCapacity = getWorkQueueCapacity(properties);
InternalLogger.INSTANCE.log(Level.INFO, "Log event work queue capacity: " + workQueueCapacity);
InternalLogger.INSTANCE.log(Level.INFO, "Buffer front: " + workQueueCapacity);
Integer concurrency = getConcurrency(properties);
InternalLogger.INSTANCE.log(Level.INFO, "Log process concurrency: " + concurrency);
InternalLogger.INSTANCE.log(Level.INFO, "Concurrency: " + concurrency);
SequentialExecutor conseqExecutor =
new ConseqExecutor.Builder().concurrency(concurrency).workQueueCapacity(workQueueCapacity).build();
return new ConseqLogEventProcessor(logServiceConfiguration.getLogServiceWriter(), conseqExecutor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
*/
@ToString
public class BufferedStandardOutput implements StandardOutput, Stoppable {
private static final int DEFAULT_BACK_BUFFER_CAPACITY = 256;
private static final int DEFAULT_BACK_BUFFER_CAPACITY = 8192;
private static final OutStreamType DEFAULT_OUT_STREAM_TYPE = OutStreamType.STDOUT;
private final OutStreamType outStreamType;
private final BlockingQueue<byte[]> buffer;
Expand All @@ -67,7 +67,7 @@ public class BufferedStandardOutput implements StandardOutput, Stoppable {
public BufferedStandardOutput(String stream, Integer bufferCapacity) {
this.outStreamType = stream == null ? DEFAULT_OUT_STREAM_TYPE : OutStreamType.valueOf(stream.toUpperCase());
bufferCapacity = bufferCapacity == null ? DEFAULT_BACK_BUFFER_CAPACITY : bufferCapacity;
InternalLogger.INSTANCE.log(Level.INFO, "Standard stream buffer capacity: " + bufferCapacity);
InternalLogger.INSTANCE.log(Level.INFO, "Buffer back: " + bufferCapacity);
this.buffer = bufferCapacity == 0 ? new SynchronousQueue<>() : new ArrayBlockingQueue<>(bufferCapacity);
this.stopped = false;
pollingBytesWriter = new PollingBytesWriter(bufferCapacity);
Expand Down

0 comments on commit fd8f290

Please sign in to comment.