Merge remote-tracking branch 'origin/feat/infer_dev_260107' into feat/infer_dev_260107

This commit is contained in:
Moon
2026-01-12 21:09:11 +09:00
7 changed files with 97 additions and 96 deletions

View File

@@ -1,7 +1,6 @@
package com.kamco.cd.kamcoback.inference; package com.kamco.cd.kamcoback.inference;
import com.kamco.cd.kamcoback.config.api.ApiResponseDto; import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto;
@@ -241,8 +240,6 @@ public class InferenceResultApiController {
return ApiResponseDto.ok(inferenceResultService.getInferenceServerStatusList()); return ApiResponseDto.ok(inferenceResultService.getInferenceServerStatusList());
} }
@Operation(summary = "추론관리 진행현황 상세", description = "어드민 홈 > 추론관리 > 추론관리 > 진행현황 상세") @Operation(summary = "추론관리 진행현황 상세", description = "어드민 홈 > 추론관리 > 추론관리 > 진행현황 상세")
@ApiResponses( @ApiResponses(
value = { value = {

View File

@@ -247,18 +247,15 @@ public class InferenceResultDto {
private String model3VerStatus = "PROCCESING"; private String model3VerStatus = "PROCCESING";
private String model4VerStatusName = "진행중"; private String model4VerStatusName = "진행중";
public String getDetectOptionName() public String getDetectOptionName() {
{
if (this.detectOption.equals("EXCL")) return "추론제외"; if (this.detectOption.equals("EXCL")) return "추론제외";
return "이전 년도 도엽 사용"; return "이전 년도 도엽 사용";
} }
public String getMapSheetScopeName() public String getMapSheetScopeName() {
{
if (this.detectOption.equals("ALL")) return "전체"; if (this.detectOption.equals("ALL")) return "전체";
return "부분"; return "부분";
} }
} }
@Getter @Getter

View File

@@ -405,7 +405,8 @@ public class InferenceResultService {
public InferenceStatusDetailDto getInferenceStatus(UUID uuid) { public InferenceStatusDetailDto getInferenceStatus(UUID uuid) {
List<InferenceServerStatusDto> servers = inferenceResultCoreService.getInferenceServerStatusList(); List<InferenceServerStatusDto> servers =
inferenceResultCoreService.getInferenceServerStatusList();
String serverNames = ""; String serverNames = "";
for (InferenceServerStatusDto server : servers) { for (InferenceServerStatusDto server : servers) {
@@ -418,5 +419,4 @@ public class InferenceResultService {
return dto; return dto;
} }
} }

View File

@@ -1,13 +1,12 @@
package com.kamco.cd.kamcoback.postgres.repository.Inference; package com.kamco.cd.kamcoback.postgres.repository.Inference;
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto;
import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity; import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity;
import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.UUID; import java.util.UUID;
import java.util.List;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
public interface MapSheetLearnRepositoryCustom { public interface MapSheetLearnRepositoryCustom {

View File

@@ -2,11 +2,9 @@ package com.kamco.cd.kamcoback.postgres.repository.Inference;
import static com.kamco.cd.kamcoback.postgres.entity.QGpuMetricEntity.gpuMetricEntity; import static com.kamco.cd.kamcoback.postgres.entity.QGpuMetricEntity.gpuMetricEntity;
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity; import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
import static com.kamco.cd.kamcoback.postgres.entity.QModelMngEntity.modelMngEntity;
import static com.kamco.cd.kamcoback.postgres.entity.QSystemMetricEntity.systemMetricEntity; import static com.kamco.cd.kamcoback.postgres.entity.QSystemMetricEntity.systemMetricEntity;
import com.kamco.cd.kamcoback.common.utils.DateRange; import com.kamco.cd.kamcoback.common.utils.DateRange;
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto;
@@ -100,30 +98,37 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
BooleanBuilder builder = new BooleanBuilder(); BooleanBuilder builder = new BooleanBuilder();
List<Integer> latestIds = queryFactory List<Integer> latestIds =
queryFactory
.select(systemMetricEntity.id1.max()) .select(systemMetricEntity.id1.max())
.from(systemMetricEntity) .from(systemMetricEntity)
.groupBy(systemMetricEntity.serverName) .groupBy(systemMetricEntity.serverName)
.fetch(); .fetch();
List<Integer> latestGpuIds = queryFactory List<Integer> latestGpuIds =
queryFactory
.select(gpuMetricEntity.id1.max()) .select(gpuMetricEntity.id1.max())
.from(gpuMetricEntity) .from(gpuMetricEntity)
.groupBy(gpuMetricEntity.serverName) .groupBy(gpuMetricEntity.serverName)
.fetch(); .fetch();
List<InferenceServerStatusDto> foundContent = queryFactory List<InferenceServerStatusDto> foundContent =
.select(Projections.constructor( queryFactory
.select(
Projections.constructor(
InferenceServerStatusDto.class, InferenceServerStatusDto.class,
systemMetricEntity.serverName, systemMetricEntity.serverName,
systemMetricEntity.cpuUser, systemMetricEntity.cpuUser,
systemMetricEntity.cpuSystem, systemMetricEntity.cpuSystem,
systemMetricEntity.memused, systemMetricEntity.memused,
systemMetricEntity.kbmemused, systemMetricEntity.kbmemused,
gpuMetricEntity.gpuUtil gpuMetricEntity.gpuUtil))
))
.from(systemMetricEntity) .from(systemMetricEntity)
.leftJoin(gpuMetricEntity).on(gpuMetricEntity.id1.in(latestGpuIds) .leftJoin(gpuMetricEntity)
.on(
gpuMetricEntity
.id1
.in(latestGpuIds)
.and(gpuMetricEntity.serverName.eq(systemMetricEntity.serverName))) .and(gpuMetricEntity.serverName.eq(systemMetricEntity.serverName)))
.where(systemMetricEntity.id1.in(latestIds)) // In 절 사용 .where(systemMetricEntity.id1.in(latestIds)) // In 절 사용
.orderBy(systemMetricEntity.serverName.asc()) .orderBy(systemMetricEntity.serverName.asc())
@@ -142,8 +147,10 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
QModelMngEntity m2Model = new QModelMngEntity("m2Model"); QModelMngEntity m2Model = new QModelMngEntity("m2Model");
QModelMngEntity m3Model = new QModelMngEntity("m3Model"); QModelMngEntity m3Model = new QModelMngEntity("m3Model");
InferenceStatusDetailDto foundContent = queryFactory InferenceStatusDetailDto foundContent =
.select(Projections.constructor( queryFactory
.select(
Projections.constructor(
InferenceStatusDetailDto.class, InferenceStatusDetailDto.class,
mapSheetLearnEntity.title, mapSheetLearnEntity.title,
mapSheetLearnEntity.compareYyyy, mapSheetLearnEntity.compareYyyy,
@@ -155,16 +162,17 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
mapSheetLearnEntity.detectingCnt, mapSheetLearnEntity.detectingCnt,
m1Model.modelVer.as("model1Ver"), m1Model.modelVer.as("model1Ver"),
m2Model.modelVer.as("model2Ver"), m2Model.modelVer.as("model2Ver"),
m3Model.modelVer.as("model3Ver") m3Model.modelVer.as("model3Ver")))
))
.from(mapSheetLearnEntity) .from(mapSheetLearnEntity)
.leftJoin(m1Model).on(m1Model.uuid.eq(mapSheetLearnEntity.m1ModelUuid)) .leftJoin(m1Model)
.leftJoin(m2Model).on(m2Model.uuid.eq(mapSheetLearnEntity.m2ModelUuid)) .on(m1Model.uuid.eq(mapSheetLearnEntity.m1ModelUuid))
.leftJoin(m3Model).on(m3Model.uuid.eq(mapSheetLearnEntity.m3ModelUuid)) .leftJoin(m2Model)
.on(m2Model.uuid.eq(mapSheetLearnEntity.m2ModelUuid))
.leftJoin(m3Model)
.on(m3Model.uuid.eq(mapSheetLearnEntity.m3ModelUuid))
.where(mapSheetLearnEntity.uuid.eq(uuid)) .where(mapSheetLearnEntity.uuid.eq(uuid))
.fetchOne(); .fetchOne();
return foundContent; return foundContent;
} }
} }