7e6b2fc4dc
- 将普通RAW基础处理批量调整为3000条 - 将RAW自适应拉取上限调整为5000条 - 将普通、告警及非标达梦批量写入上限调整为2000条 - 启动日志增加达梦实际批量配置输出 - 补充自适应分块和达梦批量写入测试 - 更新v4吞吐优化升级说明
31 lines
1.3 KiB
Java
31 lines
1.3 KiB
Java
package com.config;
|
|
|
|
import com.common.service.DmStandardizedBatchWriter;
|
|
import com.common.service.impl.SyslogNonNormalMessageServiceImpl;
|
|
import org.junit.jupiter.api.Test;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import java.io.InputStream;
|
|
import java.util.Properties;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
|
class DmBatchDefaultsTest {
|
|
@Test
|
|
void propertiesAndInjectionFallbacksBothDefaultTo2000() throws Exception {
|
|
Properties properties = new Properties();
|
|
try (InputStream input = getClass().getResourceAsStream("/application.properties")) {
|
|
properties.load(input);
|
|
}
|
|
assertEquals("${DM_STANDARDIZED_WRITE_BATCH_SIZE:2000}",
|
|
properties.getProperty("dm.standardized-write.batch-size"));
|
|
assertEquals("${DM_NON_NORMAL_WRITE_BATCH_SIZE:2000}",
|
|
properties.getProperty("dm.non-normal-write.batch-size"));
|
|
assertEquals("${dm.standardized-write.batch-size:2000}",
|
|
DmStandardizedBatchWriter.class.getDeclaredField("batchSize").getAnnotation(Value.class).value());
|
|
assertEquals("${dm.non-normal-write.batch-size:2000}",
|
|
SyslogNonNormalMessageServiceImpl.class.getDeclaredField("nonNormalBatchSize")
|
|
.getAnnotation(Value.class).value());
|
|
}
|
|
}
|