log changing

This commit is contained in:
Anthony Stirling 2025-06-03 10:34:47 +01:00
parent 8d4f5f16cb
commit 95fbd4647d
4 changed files with 8 additions and 12 deletions

View File

@ -58,7 +58,7 @@ public class JobExecutorService {
// Parse session timeout and calculate effective timeout once during initialization
long sessionTimeoutMs = parseSessionTimeout(sessionTimeout);
this.effectiveTimeoutMs = Math.min(asyncRequestTimeoutMs, sessionTimeoutMs);
log.info(
log.debug(
"Job executor configured with effective timeout of {} ms", this.effectiveTimeoutMs);
}

View File

@ -52,13 +52,9 @@ public class JobQueue {
{
ExecutorService executor;
try {
// Try to use Virtual Threads (Java 21+)
executor = Executors.newVirtualThreadPerTaskExecutor();
log.info("Using Virtual Thread executor (Java 21+)");
} catch (NoSuchMethodError e) {
// Fall back to thread pool for Java < 21
executor = Executors.newCachedThreadPool();
log.info("Using cached thread pool executor (Java < 21)");
}
jobExecutor = executor;
}
@ -95,7 +91,7 @@ public class JobQueue {
@PostConstruct
public void initialize() {
log.info(
log.debug(
"Starting job queue with base capacity {}, min capacity {}",
baseQueueCapacity,
minQueueCapacity);

View File

@ -39,8 +39,8 @@ public class ResourceMonitor {
@Value("${stirling.resource.cpu.high-threshold:0.75}")
private double cpuHighThreshold = 0.75; // 75% usage is high
@Value("${stirling.resource.monitor.interval-ms:5000}")
private long monitorIntervalMs = 5000; // 5 seconds
@Value("${stirling.resource.monitor.interval-ms:60000}")
private long monitorIntervalMs = 60000; // 60 seconds
private final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
private final MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();
@ -117,7 +117,7 @@ public class ResourceMonitor {
@PostConstruct
public void initialize() {
log.info("Starting resource monitoring with interval of {}ms", monitorIntervalMs);
log.debug("Starting resource monitoring with interval of {}ms", monitorIntervalMs);
scheduler.scheduleAtFixedRate(
this::updateResourceMetrics, 0, monitorIntervalMs, TimeUnit.MILLISECONDS);
}
@ -203,13 +203,13 @@ public class ResourceMonitor {
m.setAccessible(true);
return (double) m.invoke(osMXBean);
} catch (Exception e2) {
log.warn(
log.trace(
"Could not get CPU load through reflection, assuming moderate load (0.5)");
return 0.5;
}
}
} catch (Exception e) {
log.warn("Could not get CPU load, assuming moderate load (0.5)");
log.trace("Could not get CPU load, assuming moderate load (0.5)");
return 0.5; // Default to moderate load
}
}

View File

@ -42,7 +42,7 @@ public class TaskManager {
10, // Interval
TimeUnit.MINUTES);
log.info(
log.debug(
"Task manager initialized with job result expiry of {} minutes",
jobResultExpiryMinutes);
}