추론소요시간

This commit is contained in:
Moon
2026-01-12 22:34:17 +09:00
parent 4376054562
commit d5a36cb381
2 changed files with 58 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.time.Duration;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.ZonedDateTime; import java.time.ZonedDateTime;
import java.util.Arrays; import java.util.Arrays;
@@ -210,6 +211,13 @@ public class InferenceResultDto {
private Long detectingCnt = 0L; private Long detectingCnt = 0L;
private Long detectingEndCnt = 0L; private Long detectingEndCnt = 0L;
@JsonFormatDttm private ZonedDateTime m1ModelStartDttm;
@JsonFormatDttm private ZonedDateTime m1ModelEndDttm;
@JsonFormatDttm private ZonedDateTime m2ModelStartDttm;
@JsonFormatDttm private ZonedDateTime m2ModelEndDttm;
@JsonFormatDttm private ZonedDateTime m3ModelStartDttm;
@JsonFormatDttm private ZonedDateTime m3ModelEndDttm;
private String model1Ver; private String model1Ver;
private String model2Ver; private String model2Ver;
private String model3Ver; private String model3Ver;
@@ -224,6 +232,12 @@ public class InferenceResultDto {
ZonedDateTime inferEndDttm, ZonedDateTime inferEndDttm,
Long detectingCnt, Long detectingCnt,
Long detectingEndCnt, Long detectingEndCnt,
ZonedDateTime m1ModelStartDttm,
ZonedDateTime m1ModelEndDttm,
ZonedDateTime m2ModelStartDttm,
ZonedDateTime m2ModelEndDttm,
ZonedDateTime m3ModelStartDttm,
ZonedDateTime m3ModelEndDttm,
String model1Ver, String model1Ver,
String model2Ver, String model2Ver,
String model3Ver) { String model3Ver) {
@@ -236,6 +250,12 @@ public class InferenceResultDto {
this.inferEndDttm = inferEndDttm; this.inferEndDttm = inferEndDttm;
this.detectingCnt = detectingCnt; this.detectingCnt = detectingCnt;
this.detectingEndCnt = detectingEndCnt; this.detectingEndCnt = detectingEndCnt;
this.m1ModelStartDttm = m1ModelStartDttm;
this.m1ModelEndDttm = m1ModelEndDttm;
this.m2ModelStartDttm = m2ModelStartDttm;
this.m2ModelEndDttm = m2ModelEndDttm;
this.m3ModelStartDttm = m3ModelStartDttm;
this.m3ModelEndDttm = m3ModelEndDttm;
this.model1Ver = model1Ver; this.model1Ver = model1Ver;
this.model2Ver = model2Ver; this.model2Ver = model2Ver;
this.model3Ver = model3Ver; this.model3Ver = model3Ver;
@@ -272,6 +292,42 @@ public class InferenceResultDto {
return (double) (this.detectingEndCnt / this.detectingCnt) * 100.0; return (double) (this.detectingEndCnt / this.detectingCnt) * 100.0;
} }
public String getM1DurationFormatted() {
if (this.m1ModelStartDttm == null || this.m1ModelEndDttm == null) {
return "00:00:00";
}
Duration duration = Duration.between(m1ModelStartDttm, m1ModelEndDttm);
long hours = duration.toHours();
long minutes = duration.toMinutesPart();
long seconds = duration.toSecondsPart();
return String.format("%02d:%02d:%02d", hours, minutes, seconds);
}
public String getM2DurationFormatted() {
if (this.m2ModelStartDttm == null || this.m2ModelEndDttm == null) {
return "00:00:00";
}
Duration duration = Duration.between(this.m2ModelStartDttm, this.m2ModelEndDttm);
long hours = duration.toHours();
long minutes = duration.toMinutesPart();
long seconds = duration.toSecondsPart();
return String.format("%02d:%02d:%02d", hours, minutes, seconds);
}
public String getM3DurationFormatted() {
if (this.m3ModelStartDttm == null || this.m3ModelEndDttm == null) {
return "00:00:00";
}
Duration duration = Duration.between(this.m3ModelStartDttm, this.m3ModelEndDttm);
long hours = duration.toHours();
long minutes = duration.toMinutesPart();
long seconds = duration.toSecondsPart();
return String.format("%02d:%02d:%02d", hours, minutes, seconds);
}
} }
@Getter @Getter

View File

@@ -172,9 +172,11 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
mapSheetLearnEntity.inferEndDttm, mapSheetLearnEntity.inferEndDttm,
mapSheetLearnEntity.detectingCnt, mapSheetLearnEntity.detectingCnt,
mapSheetLearnEntity.detectEndCnt, mapSheetLearnEntity.detectEndCnt,
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) .leftJoin(m1Model)
.on(m1Model.uuid.eq(mapSheetLearnEntity.m1ModelUuid)) .on(m1Model.uuid.eq(mapSheetLearnEntity.m1ModelUuid))