diff --git a/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java b/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java index b8ea9831..123ce8d8 100644 --- a/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java +++ b/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java @@ -514,7 +514,8 @@ public class InferenceResultDto { @JsonIgnore private float cpu_system; @JsonIgnore private float memused; private Long kbmemused; - private float gpuUtil; + @JsonIgnore private float gpuMemUsed; + @JsonIgnore private float gpuMemTotal; // private String cpuStatusName; // private String memStatusName; @@ -526,6 +527,9 @@ public class InferenceResultDto { public float getCpuUseRate() { return this.cpu_user + this.cpu_system; } + public double getGpuUtil() { + return (this.gpuMemUsed / this.gpuMemTotal ) * 100.0; + } public String getServerStatus() { String enumId = "SAFETY"; @@ -549,7 +553,8 @@ public class InferenceResultDto { public String getGpuStatus() { String enumId = "SAFETY"; - if (this.gpuUtil >= 80) { + + if (this.getGpuUtil() >= 80L) { enumId = "CAUTION"; } return enumId; @@ -571,7 +576,7 @@ public class InferenceResultDto { } public String getGpuStatusName() { - if (this.gpuUtil >= 80) { + if (this.getGpuUtil() >= 80) { return ServerStatus.CAUTION.getText(); } return ServerStatus.SAFETY.getText(); diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetLearnRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetLearnRepositoryImpl.java index 8221a663..bd63e154 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetLearnRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetLearnRepositoryImpl.java @@ -135,7 +135,10 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto systemMetricEntity.cpuSystem, systemMetricEntity.memused, systemMetricEntity.kbmemused, - gpuMetricEntity.gpuUtil)) + //gpuMetricEntity.gpuUtil, + gpuMetricEntity.gpuMemUsed, + gpuMetricEntity.gpuMemTotal + )) .from(systemMetricEntity) .leftJoin(gpuMetricEntity) .on(