Merge pull request '시스템 사용율 모니터링 기능 테스트' (#159) from feat/training_260303 into develop
Reviewed-on: #159
This commit was merged in pull request #159.
This commit is contained in:
@@ -127,10 +127,15 @@ public class SystemMonitorService {
|
|||||||
long totalDiff = total - prevTotal;
|
long totalDiff = total - prevTotal;
|
||||||
long idleDiff = idleAll - prevIdle;
|
long idleDiff = idleAll - prevIdle;
|
||||||
|
|
||||||
|
log.info("CPU raw total={}, idle={}", total, idleAll);
|
||||||
|
|
||||||
// 상태 업데이트
|
// 상태 업데이트
|
||||||
prevTotal = total;
|
prevTotal = total;
|
||||||
prevIdle = idleAll;
|
prevIdle = idleAll;
|
||||||
|
|
||||||
|
log.info("CPU prev total={}, prev idle={}", prevTotal, prevIdle);
|
||||||
|
log.info("CPU diff totalDiff={}, idleDiff={}", totalDiff, idleDiff);
|
||||||
|
|
||||||
// CPU 사용률 계산
|
// CPU 사용률 계산
|
||||||
return (1.0 - (double) idleDiff / totalDiff) * 100;
|
return (1.0 - (double) idleDiff / totalDiff) * 100;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user