GPU사용율수정

This commit is contained in:
Moon
2026-01-15 14:30:05 +09:00
parent 94077377f2
commit f46d15ef09
2 changed files with 12 additions and 4 deletions

View File

@@ -514,7 +514,8 @@ public class InferenceResultDto {
@JsonIgnore private float cpu_system; @JsonIgnore private float cpu_system;
@JsonIgnore private float memused; @JsonIgnore private float memused;
private Long kbmemused; private Long kbmemused;
private float gpuUtil; @JsonIgnore private float gpuMemUsed;
@JsonIgnore private float gpuMemTotal;
// private String cpuStatusName; // private String cpuStatusName;
// private String memStatusName; // private String memStatusName;
@@ -526,6 +527,9 @@ public class InferenceResultDto {
public float getCpuUseRate() { public float getCpuUseRate() {
return this.cpu_user + this.cpu_system; return this.cpu_user + this.cpu_system;
} }
public double getGpuUtil() {
return (this.gpuMemUsed / this.gpuMemTotal ) * 100.0;
}
public String getServerStatus() { public String getServerStatus() {
String enumId = "SAFETY"; String enumId = "SAFETY";
@@ -549,7 +553,8 @@ public class InferenceResultDto {
public String getGpuStatus() { public String getGpuStatus() {
String enumId = "SAFETY"; String enumId = "SAFETY";
if (this.gpuUtil >= 80) {
if (this.getGpuUtil() >= 80L) {
enumId = "CAUTION"; enumId = "CAUTION";
} }
return enumId; return enumId;
@@ -571,7 +576,7 @@ public class InferenceResultDto {
} }
public String getGpuStatusName() { public String getGpuStatusName() {
if (this.gpuUtil >= 80) { if (this.getGpuUtil() >= 80) {
return ServerStatus.CAUTION.getText(); return ServerStatus.CAUTION.getText();
} }
return ServerStatus.SAFETY.getText(); return ServerStatus.SAFETY.getText();

View File

@@ -135,7 +135,10 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
systemMetricEntity.cpuSystem, systemMetricEntity.cpuSystem,
systemMetricEntity.memused, systemMetricEntity.memused,
systemMetricEntity.kbmemused, systemMetricEntity.kbmemused,
gpuMetricEntity.gpuUtil)) //gpuMetricEntity.gpuUtil,
gpuMetricEntity.gpuMemUsed,
gpuMetricEntity.gpuMemTotal
))
.from(systemMetricEntity) .from(systemMetricEntity)
.leftJoin(gpuMetricEntity) .leftJoin(gpuMetricEntity)
.on( .on(