forked from j62/ctbrec
1
0
Fork 0

Add if state ments to conditionally execute log.trace

This commit is contained in:
0xb00bface 2021-01-23 17:00:47 +01:00
parent 8855591f0f
commit ce4a8fe24e
1 changed files with 6 additions and 2 deletions

View File

@ -36,7 +36,9 @@ public class ThreadPoolScaler {
if (average > 0.65 * coreSize) {
threadPool.setCorePoolSize(coreSize + 1);
downScaleCoolDown = now.plusSeconds(30);
LOG.trace("Adjusted scheduler pool size to {}", threadPool.getCorePoolSize());
if (LOG.isTraceEnabled()) {
LOG.trace("Adjusted scheduler pool size to {}", threadPool.getCorePoolSize());
}
} else if (average < 0.15 * coreSize) {
int newValue = Math.max(configuredPoolSize, coreSize - 1);
if (threadPool.getCorePoolSize() != newValue && now.isAfter(downScaleCoolDown)) {
@ -46,7 +48,9 @@ public class ThreadPoolScaler {
}
}
lastAdjustment = now;
LOG.trace("Thread pool size is {}", threadPool.getCorePoolSize());
if (LOG.isTraceEnabled()) {
LOG.trace("Thread pool size is {}", threadPool.getCorePoolSize());
}
}
}