Browse Source

修改实验对比分页查询

dev-czh
cp3hnu 1 year ago
parent
commit
b3596a7342
2 changed files with 14 additions and 8 deletions
  1. +10
    -4
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/scheduling/ExperimentInstanceStatusTask.java
  2. +4
    -4
      ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ExperimentInsDaoMapper.xml

+ 10
- 4
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/scheduling/ExperimentInstanceStatusTask.java View File

@@ -46,7 +46,6 @@ public class ExperimentInstanceStatusTask {
experimentIns.setStatus("Failed");
}
//运行成功的实验实例记录指标数值
// if (Constant.Succeeded.equals(experimentIns.getStatus())) {
Map<String, Object> metricRecord = JacksonUtil.parseJSONStr2Map(experimentIns.getMetricRecord());
List<Map<String, Object>> trainMetricRecords = (List<Map<String, Object>>) metricRecord.get("train");
List<Map<String, Object>> evaluateMetricRecords = (List<Map<String, Object>>) metricRecord.get("evaluate");
@@ -92,10 +91,17 @@ public class ExperimentInstanceStatusTask {
}
}
}
metricValue.put("train", trainMetricValues);
metricValue.put("evaluate", evaluateMetricValues);
if (trainMetricValues.size() > 0) {
metricValue.put("train", trainMetricValues);
} else {
metricValue.put("train", null);
}
if (evaluateMetricValues.size() > 0) {
metricValue.put("evaluate", evaluateMetricValues);
} else {
metricValue.put("evaluate", null);
}
experimentIns.setMetricValue(JsonUtils.mapToJson(metricValue));
// }
experimentIns.setUpdateTime(new Date());
// 线程安全的添加操作
synchronized (experimentIds) {


+ 4
- 4
ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ExperimentInsDaoMapper.xml View File

@@ -256,10 +256,10 @@
where state = 1
and experiment_id = #{experimentId}
<if test="isTrain">
and not JSON_CONTAINS(metric_record, 'null', '$.train')
and not JSON_CONTAINS(metric_value, 'null', '$.train')
</if>
<if test="! isTrain">
and not JSON_CONTAINS(metric_record, 'null', '$.evaluate')
and not JSON_CONTAINS(metric_value, 'null', '$.evaluate')
</if>
</select>

@@ -272,10 +272,10 @@
where state = 1
and experiment_id = #{experimentId}
<if test="isTrain">
and not JSON_CONTAINS(metric_record, 'null', '$.train')
and not JSON_CONTAINS(metric_value, 'null', '$.train')
</if>
<if test="! isTrain">
and not JSON_CONTAINS(metric_record, 'null', '$.evaluate')
and not JSON_CONTAINS(metric_value, 'null', '$.evaluate')
</if>
</select>



Loading…
Cancel
Save