GPU사용율수정
This commit is contained in:
@@ -28,6 +28,7 @@ import com.querydsl.core.types.dsl.Expressions;
|
||||
import com.querydsl.core.types.dsl.NumberExpression;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import jakarta.persistence.EntityNotFoundException;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
@@ -118,9 +119,9 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
||||
.groupBy(systemMetricEntity.serverName)
|
||||
.fetch();
|
||||
|
||||
List<Integer> latestGpuIds =
|
||||
List<OffsetDateTime> latestGpuIds =
|
||||
queryFactory
|
||||
.select(gpuMetricEntity.id1.max())
|
||||
.select(gpuMetricEntity.timestamp.max())
|
||||
.from(gpuMetricEntity)
|
||||
.groupBy(gpuMetricEntity.serverName)
|
||||
.fetch();
|
||||
@@ -135,15 +136,15 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
||||
systemMetricEntity.cpuSystem,
|
||||
systemMetricEntity.memused,
|
||||
systemMetricEntity.kbmemused,
|
||||
//gpuMetricEntity.gpuUtil,
|
||||
gpuMetricEntity.gpuMemUsed,
|
||||
gpuMetricEntity.gpuMemTotal
|
||||
gpuMetricEntity.gpuUtil
|
||||
//gpuMetricEntity.gpuMemUsed,
|
||||
//gpuMetricEntity.gpuMemTotal
|
||||
))
|
||||
.from(systemMetricEntity)
|
||||
.leftJoin(gpuMetricEntity)
|
||||
.on(
|
||||
gpuMetricEntity
|
||||
.id1
|
||||
.timestamp
|
||||
.in(latestGpuIds)
|
||||
.and(gpuMetricEntity.serverName.eq(systemMetricEntity.serverName)))
|
||||
.where(systemMetricEntity.id1.in(latestIds)) // In 절 사용
|
||||
|
||||
Reference in New Issue
Block a user