Update common/src/main/java/stirling/software/common/service/ResourceMonitor.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Anthony Stirling 2025-06-19 13:23:20 +01:00 committed by GitHub
parent 76fcaeb94d
commit 083b68e2a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -172,8 +172,8 @@ public class ResourceMonitor {
if (oldStatus != newStatus) { if (oldStatus != newStatus) {
log.info("System resource status changed from {} to {}", oldStatus, newStatus); log.info("System resource status changed from {} to {}", oldStatus, newStatus);
log.info( log.info(
"Current metrics - CPU: {:.1f}%, Memory: {:.1f}%, Free Memory: {} MB", "Current metrics - CPU: {}%, Memory: {}%, Free Memory: {} MB",
cpuUsage * 100, memoryUsage * 100, freeMemory / (1024 * 1024)); String.format("%.1f", cpuUsage * 100), String.format("%.1f", memoryUsage * 100), freeMemory / (1024 * 1024));
} }
} catch (Exception e) { } catch (Exception e) {
log.error("Error updating resource metrics: {}", e.getMessage(), e); log.error("Error updating resource metrics: {}", e.getMessage(), e);