From f46d15ef095d6b23c9be8be6d87ad7d3209851b9 Mon Sep 17 00:00:00 2001 From: Moon Date: Thu, 15 Jan 2026 14:30:05 +0900 Subject: [PATCH] =?UTF-8?q?GPU=EC=82=AC=EC=9A=A9=EC=9C=A8=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kamcoback/inference/dto/InferenceResultDto.java | 11 ++++++++--- .../Inference/MapSheetLearnRepositoryImpl.java | 5 ++++- 2 files changed, 12 insertions(+), 4 deletions(-) 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(