summaryrefslogtreecommitdiffstats
path: root/jdisc_http_service/src/test/java/com/yahoo
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2021-02-03 14:17:50 +0100
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2021-02-03 14:17:50 +0100
commit9bd5a12c87d0a92d37b2c75a9530e96e104b7291 (patch)
tree7873008e74a284c2d02b76d4d3f3a0da3ad41508 /jdisc_http_service/src/test/java/com/yahoo
parentb8b85fab6fe1fd0f4f2d3ea363e60c0f230a4e89 (diff)
Make queue size of log file handler configurable
Add new config parameter for connection log and request log. Scale queue size on vcpu in config model. Use LinkedBlockingQueue instead of ArrayBlockingQueue.
Diffstat (limited to 'jdisc_http_service/src/test/java/com/yahoo')
-rw-r--r--jdisc_http_service/src/test/java/com/yahoo/container/logging/LogFileHandlerTestCase.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/jdisc_http_service/src/test/java/com/yahoo/container/logging/LogFileHandlerTestCase.java b/jdisc_http_service/src/test/java/com/yahoo/container/logging/LogFileHandlerTestCase.java
index 013f42cd5b0..7ae46f50492 100644
--- a/jdisc_http_service/src/test/java/com/yahoo/container/logging/LogFileHandlerTestCase.java
+++ b/jdisc_http_service/src/test/java/com/yahoo/container/logging/LogFileHandlerTestCase.java
@@ -43,7 +43,7 @@ public class LogFileHandlerTestCase {
String pattern = root.getAbsolutePath() + "/logfilehandlertest.%Y%m%d%H%M%S";
long[] rTimes = {1000, 2000, 10000};
- LogFileHandler<String> h = new LogFileHandler<>(Compression.NONE, pattern, rTimes, null, new StringLogWriter());
+ LogFileHandler<String> h = new LogFileHandler<>(Compression.NONE, pattern, rTimes, null, 2048, new StringLogWriter());
long now = System.currentTimeMillis();
long millisPerDay = 60*60*24*1000;
long tomorrowDays = (now / millisPerDay) +1;
@@ -65,7 +65,7 @@ public class LogFileHandlerTestCase {
File logFile = temporaryFolder.newFile("testLogFileG1.txt");
//create logfilehandler
- LogFileHandler<String> h = new LogFileHandler<>(Compression.NONE, logFile.getAbsolutePath(), "0 5 ...", null, new StringLogWriter());
+ LogFileHandler<String> h = new LogFileHandler<>(Compression.NONE, logFile.getAbsolutePath(), "0 5 ...", null, 2048, new StringLogWriter());
//write log
h.publish("testDeleteFileFirst1");
@@ -78,7 +78,7 @@ public class LogFileHandlerTestCase {
File logFile = temporaryFolder.newFile("testLogFileG2.txt");
//create logfilehandler
- LogFileHandler<String> h = new LogFileHandler<>(Compression.NONE, logFile.getAbsolutePath(), "0 5 ...", null, new StringLogWriter());
+ LogFileHandler<String> h = new LogFileHandler<>(Compression.NONE, logFile.getAbsolutePath(), "0 5 ...", null, 2048, new StringLogWriter());
//write log
h.publish("testDeleteFileDuringLogging1");
@@ -104,7 +104,7 @@ public class LogFileHandlerTestCase {
}
};
LogFileHandler<String> handler = new LogFileHandler<>(
- Compression.NONE, root.getAbsolutePath() + "/logfilehandlertest.%Y%m%d%H%M%S%s", new long[]{0}, "symlink", new StringLogWriter());
+ Compression.NONE, root.getAbsolutePath() + "/logfilehandlertest.%Y%m%d%H%M%S%s", new long[]{0}, "symlink", 2048, new StringLogWriter());
String message = formatter.format(new LogRecord(Level.INFO, "test"));
handler.publishAndWait(message);
@@ -150,7 +150,7 @@ public class LogFileHandlerTestCase {
File root = temporaryFolder.newFolder("testcompression" + compression.name());
LogFileHandler<String> h = new LogFileHandler<>(
- compression, root.getAbsolutePath() + "/logfilehandlertest.%Y%m%d%H%M%S%s", new long[]{0}, null, new StringLogWriter());
+ compression, root.getAbsolutePath() + "/logfilehandlertest.%Y%m%d%H%M%S%s", new long[]{0}, null, 2048, new StringLogWriter());
int logEntries = 10000;
for (int i = 0; i < logEntries; i++) {
h.publish("test");