Repository: open-telemetry/opentelemetry-java
File: sdk-extensions/autoconfigure/src/testFullConfig/java/io/opentelemetry/sdk/autoconfigure/LoggerProviderConfigurationTest.java (Java)

Code before:
  void configureBatchLogRecordProcessor() {
    Map<String, String> properties = new HashMap<>();
    properties.put("otel.blrp.schedule.delay", "100000");
    properties.put("otel.blrp.max.queue.size", "2");
    properties.put("otel.blrp.max.export.batch.size", "2");
    properties.put("otel.blrp.export.timeout", "4");

    try (BatchLogRecordProcessor processor =
        LoggerProviderConfiguration.configureBatchLogRecordProcessor(
            DefaultConfigProperties.createFromMap(properties),
            SystemOutLogRecordExporter.create(),
            MeterProvider.noop())) {
      assertThat(processor)
          .extracting("worker")
          .satisfies(
              worker -> {
                assertThat(worker)
                    .extracting("scheduleDelayNanos")
                    .isEqualTo(TimeUnit.MILLISECONDS.toNanos(100000));
                assertThat(worker)
                    .extracting("exporterTimeoutNanos")
                    .isEqualTo(TimeUnit.MILLISECONDS.toNanos(4));
                assertThat(worker).extracting("maxExportBatchSize").isEqualTo(2);
                assertThat(worker)
                    .extracting("queue")
                    .isInstanceOfSatisfying(
                        Queue.class, queue -> assertThat(JcTools.capacity(queue)).isEqualTo(2));
                assertThat(worker)
                    .extracting("logRecordExporter")
                    .isInstanceOf(SystemOutLogRecordExporter.class);
              });
    }
  }
}


Review comment (performance):
BatchLogRecordProcessor uses ArrayBlockingQueue, so this test abstraction wasn't needed (probably a copy paste from similar test for BatchSpanProcessor):

https://github.com/open-telemetry/opentelemetry-java/blob/1e763b28f0b3266cbb3fd6ffbfd5a5bf5b622654/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/export/BatchLogRecordProcessor.java#L82

Code after:
    properties.put("otel.blrp.schedule.delay", "100000");
    properties.put("otel.blrp.max.queue.size", "2");
    properties.put("otel.blrp.max.export.batch.size", "2");
    properties.put("otel.blrp.export.timeout", "4");

    try (BatchLogRecordProcessor processor =
        LoggerProviderConfiguration.configureBatchLogRecordProcessor(
            DefaultConfigProperties.createFromMap(properties),
            SystemOutLogRecordExporter.create(),
            MeterProvider.noop())) {
      assertThat(processor)
          .extracting("worker")
          .satisfies(
              worker -> {
                assertThat(worker)
                    .extracting("scheduleDelayNanos")
                    .isEqualTo(TimeUnit.MILLISECONDS.toNanos(100000));
                assertThat(worker)
                    .extracting("exporterTimeoutNanos")
                    .isEqualTo(TimeUnit.MILLISECONDS.toNanos(4));
                assertThat(worker).extracting("maxExportBatchSize").isEqualTo(2);
                assertThat(worker)
                    .extracting("queue")
                    .isInstanceOfSatisfying(
                        ArrayBlockingQueue.class,
                        queue -> assertThat(queue.remainingCapacity()).isEqualTo(2));
                assertThat(worker)
                    .extracting("logRecordExporter")
                    .isInstanceOf(SystemOutLogRecordExporter.class);
              });
    }
  }
}