Merge pull request '시스템 사용율 모니터링 기능 테스트' (#158) from feat/training_260303 into develop
Reviewed-on: #158
This commit was merged in pull request #158.
This commit is contained in:
@@ -97,23 +97,32 @@ public class GpuDmonReader {
|
||||
|
||||
while ((line = br.readLine()) != null) {
|
||||
|
||||
// 헤더 라인 제거 (# 으로 시작)
|
||||
// 디버깅 로그
|
||||
log.info("RAW: [{}]", line);
|
||||
|
||||
// 헤더 제거
|
||||
if (line.startsWith("#")) continue;
|
||||
|
||||
// 공백 기준 분리
|
||||
String[] parts = line.trim().split("\\s+");
|
||||
line = line.trim();
|
||||
if (line.isEmpty()) continue;
|
||||
|
||||
// 최소 index, util 있어야 함
|
||||
if (parts.length < 3) continue;
|
||||
String[] parts = line.split("\\s+");
|
||||
|
||||
// GPU index 확인
|
||||
if (!parts[0].matches("\\d+")) continue;
|
||||
|
||||
// GPU index (0,1,2...)
|
||||
int index = Integer.parseInt(parts[0]);
|
||||
|
||||
// GPU 사용률 (%)
|
||||
int util = Integer.parseInt(parts[1]);
|
||||
int util = 0;
|
||||
try {
|
||||
util = Integer.parseInt(parts[1]); // sm 값
|
||||
} catch (Exception e) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 최신 값으로 덮어쓰기
|
||||
gpuUtilMap.put(index, util);
|
||||
// GPU 값 들어오는지 확인 디버깅
|
||||
log.info("GPU UPDATE → index={}, util={}", index, util);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,8 @@ public class SystemMonitorService {
|
||||
// =========================
|
||||
@Scheduled(fixedRate = 1000)
|
||||
public void collect() {
|
||||
// 디버깅용
|
||||
log.info("collect instance = {}", this);
|
||||
try {
|
||||
|
||||
// =====================
|
||||
|
||||
Reference in New Issue
Block a user