优化图形补0、null机制,优化监控看板接口
mtr监控策略相关接口
This commit is contained in:
+24
-2
@@ -202,7 +202,7 @@ public class RmMonitorConfigServiceImpl implements IRmMonitorConfigService
|
||||
}
|
||||
// 批量插入
|
||||
if(!batchInsertList.isEmpty()){
|
||||
rmMonitorConfigDetailsMapper.batchInsertRmMonitorConfigDetails(batchInsertList);
|
||||
batchInsertInChunks(batchInsertList, rmMonitorConfig.getId());
|
||||
}
|
||||
}else{
|
||||
List<InitialSwitchInfoDetails> switchInfoDetailsList = initialSwitchInfoDetailsService.getMonitorViewDetails(rmMonitorConfig);
|
||||
@@ -229,11 +229,33 @@ public class RmMonitorConfigServiceImpl implements IRmMonitorConfigService
|
||||
}
|
||||
// 批量插入
|
||||
if(!batchInsertList.isEmpty()){
|
||||
rmMonitorConfigDetailsMapper.batchInsertRmMonitorConfigDetails(batchInsertList);
|
||||
batchInsertInChunks(batchInsertList, rmMonitorConfig.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private void batchInsertInChunks(List<RmMonitorConfigDetails> batchInsertList, Long monitorId) {
|
||||
if (batchInsertList == null || batchInsertList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int batchSize = 288; // 可配置化
|
||||
int totalSize = batchInsertList.size();
|
||||
|
||||
for (int i = 0; i < totalSize; i += batchSize) {
|
||||
int end = Math.min(i + batchSize, totalSize);
|
||||
List<RmMonitorConfigDetails> subList = batchInsertList.subList(i, end);
|
||||
|
||||
try {
|
||||
rmMonitorConfigDetailsMapper.batchInsertRmMonitorConfigDetails(subList);
|
||||
log.debug("监控配置 {}: 成功插入 {} 条记录,进度: {}/{}",
|
||||
monitorId, subList.size(), i/batchSize + 1,
|
||||
(totalSize + batchSize - 1) / batchSize);
|
||||
} catch (Exception e) {
|
||||
log.error("监控配置 {} 批次插入失败,范围: {}-{}", monitorId, i, end, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
@@ -31,6 +31,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="outBytes != null "> and out_bytes = #{outBytes}</if>
|
||||
<if test="inSpeed != null "> and in_speed = #{inSpeed}</if>
|
||||
<if test="outSpeed != null "> and out_speed = #{outSpeed}</if>
|
||||
<if test="startTime != null and startTime != ''"> and create_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user