Add if state ments to conditionally execute log.trace
This commit is contained in:
parent
8855591f0f
commit
ce4a8fe24e
|
@ -36,7 +36,9 @@ public class ThreadPoolScaler {
|
||||||
if (average > 0.65 * coreSize) {
|
if (average > 0.65 * coreSize) {
|
||||||
threadPool.setCorePoolSize(coreSize + 1);
|
threadPool.setCorePoolSize(coreSize + 1);
|
||||||
downScaleCoolDown = now.plusSeconds(30);
|
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) {
|
} else if (average < 0.15 * coreSize) {
|
||||||
int newValue = Math.max(configuredPoolSize, coreSize - 1);
|
int newValue = Math.max(configuredPoolSize, coreSize - 1);
|
||||||
if (threadPool.getCorePoolSize() != newValue && now.isAfter(downScaleCoolDown)) {
|
if (threadPool.getCorePoolSize() != newValue && now.isAfter(downScaleCoolDown)) {
|
||||||
|
@ -46,7 +48,9 @@ public class ThreadPoolScaler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lastAdjustment = now;
|
lastAdjustment = now;
|
||||||
LOG.trace("Thread pool size is {}", threadPool.getCorePoolSize());
|
if (LOG.isTraceEnabled()) {
|
||||||
|
LOG.trace("Thread pool size is {}", threadPool.getCorePoolSize());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue