|
|
|
@@ -4,7 +4,10 @@ import com.alibaba.fastjson2.JSON; |
|
|
|
import com.ruoyi.platform.domain.ExperimentIns; |
|
|
|
import com.ruoyi.platform.service.AimService; |
|
|
|
import com.ruoyi.platform.service.ExperimentInsService; |
|
|
|
import com.ruoyi.platform.utils.*; |
|
|
|
import com.ruoyi.platform.utils.AIM64EncoderUtil; |
|
|
|
import com.ruoyi.platform.utils.HttpUtils; |
|
|
|
import com.ruoyi.platform.utils.JacksonUtil; |
|
|
|
import com.ruoyi.platform.utils.JsonUtils; |
|
|
|
import com.ruoyi.platform.vo.InsMetricInfoVo; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
@@ -27,13 +30,13 @@ public class AimServiceImpl implements AimService { |
|
|
|
private String aimProxyUrl; |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<InsMetricInfoVo> getExpTrainInfos(Integer experimentId) throws Exception { |
|
|
|
return getAimRunInfos(true, experimentId); |
|
|
|
public List<InsMetricInfoVo> getExpTrainInfos(Integer experimentId, String offset, int limit) throws Exception { |
|
|
|
return getAimRunInfos(true, experimentId, offset, limit); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<InsMetricInfoVo> getExpEvaluateInfos(Integer experimentId) throws Exception { |
|
|
|
return getAimRunInfos(false, experimentId); |
|
|
|
public List<InsMetricInfoVo> getExpEvaluateInfos(Integer experimentId, String offset, int limit) throws Exception { |
|
|
|
return getAimRunInfos(false, experimentId, offset, limit); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@@ -42,12 +45,18 @@ public class AimServiceImpl implements AimService { |
|
|
|
return aimUrl + "/metrics?select=" + decode; |
|
|
|
} |
|
|
|
|
|
|
|
private List<InsMetricInfoVo> getAimRunInfos(boolean isTrain, Integer experimentId) throws Exception { |
|
|
|
private List<InsMetricInfoVo> getAimRunInfos(boolean isTrain, Integer experimentId, String offset, int limit) throws Exception { |
|
|
|
String experimentName = "experiment-" + experimentId + "-train"; |
|
|
|
if (!isTrain) { |
|
|
|
experimentName = "experiment-" + experimentId + "-evaluate"; |
|
|
|
} |
|
|
|
String encodedUrlString = URLEncoder.encode("run.experiment==\"" + experimentName + "\"", "UTF-8"); |
|
|
|
|
|
|
|
StringBuffer query = new StringBuffer("run.experiment==\"" + experimentName + "\"" + "&limit=" + limit); |
|
|
|
if (StringUtils.isNotEmpty(offset)) { |
|
|
|
query.append("&offset=").append(offset); |
|
|
|
} |
|
|
|
|
|
|
|
String encodedUrlString = URLEncoder.encode(String.valueOf(query), "UTF-8"); |
|
|
|
String url = aimProxyUrl + "/api/runs/search/run?query=" + encodedUrlString; |
|
|
|
String s = HttpUtils.sendGet(url, null); |
|
|
|
List<Map<String, Object>> response = JacksonUtil.parseJSONStr2MapList(s); |
|
|
|
|