feat(web): 增加指标采集进度显示

This commit is contained in:
v-zhangjc9
2024-10-14 10:51:10 +08:00
parent 7d33227d70
commit e15dd6289d
11 changed files with 417 additions and 197 deletions

View File

@@ -6,10 +6,16 @@ import com.lanyuanxiaoyao.service.common.entity.FlinkJob;
import com.lanyuanxiaoyao.service.common.utils.NameHelper;
import com.lanyuanxiaoyao.service.configuration.ExecutorProvider;
import com.lanyuanxiaoyao.service.configuration.entity.info.JobIdAndAlias;
import com.lanyuanxiaoyao.service.configuration.entity.monitor.MetricsProgress;
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnApplication;
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnRootQueue;
import com.lanyuanxiaoyao.service.configuration.entity.zookeeper.ZookeeperNode;
import com.lanyuanxiaoyao.service.forest.service.*;
import com.lanyuanxiaoyao.service.forest.service.InfoService;
import com.lanyuanxiaoyao.service.forest.service.MonitorService;
import com.lanyuanxiaoyao.service.forest.service.QueueService;
import com.lanyuanxiaoyao.service.forest.service.ScheduleService;
import com.lanyuanxiaoyao.service.forest.service.YarnService;
import com.lanyuanxiaoyao.service.forest.service.ZookeeperService;
import com.lanyuanxiaoyao.service.web.controller.base.AmisCrudResponse;
import com.lanyuanxiaoyao.service.web.controller.base.AmisMapResponse;
import com.lanyuanxiaoyao.service.web.controller.base.AmisResponse;
@@ -48,14 +54,16 @@ public class OverviewController extends BaseController {
private final QueueService queueService;
private final ScheduleService scheduleService;
private final ZookeeperService zookeeperService;
private final MonitorService monitorService;
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
public OverviewController(InfoService infoService, YarnService yarnService, QueueService queueService, ScheduleService scheduleService, ZookeeperService zookeeperService) {
public OverviewController(InfoService infoService, YarnService yarnService, QueueService queueService, ScheduleService scheduleService, ZookeeperService zookeeperService, MonitorService monitorService) {
this.infoService = infoService;
this.yarnService = yarnService;
this.queueService = queueService;
this.scheduleService = scheduleService;
this.zookeeperService = zookeeperService;
this.monitorService = monitorService;
}
@GetMapping("")
@@ -207,4 +215,12 @@ public class OverviewController extends BaseController {
.setData("unRunningTable", unRunningTable.size())
.setData("unRunningTableList", unRunningTable);
}
@GetMapping("monitor_progress")
public AmisMapResponse monitorProgress() {
return AmisCrudResponse.responseCrudData(
monitorService.progress()
.collect(p -> new MetricsProgress(p.getName(), p.getRunning(), p.getProgress()))
);
}
}

View File

@@ -1,6 +1,6 @@
const commonInfo = {
// baseUrl: 'http://132.126.207.130:35690/hudi_services/service_web',
baseUrl: '/hudi_services/service_web',
baseUrl: 'http://132.126.207.130:35690/hudi_services/service_web',
// baseUrl: '/hudi_services/service_web',
clusters: {
// hudi同步运行集群和yarn队列名称
sync: {

View File

@@ -408,26 +408,38 @@ function overviewTab() {
}
]
},
/*{type: 'divider'},
{type: 'divider'},
{
type: 'service',
api: '${base}/overview/schedule_times',
interval: 60000,
silentPolling: true,
body: [
'调度时间点',
type: 'crud',
title: '监控指标运行进度',
api: `\${base}/overview/monitor_progress`,
...crudCommonOptions(),
interval: 2000,
loadDataOnce: true,
columns: [
{
type: 'each',
name: 'items',
className: 'grid',
items: {
type: 'tag',
color: '${color}',
label: '${DATETOSTR(TIMESTAMP(time, \'x\'), \'HH:mm:ss\')}'
name: 'name',
label: '名称',
width: 120,
},
{
name: 'running',
label: '状态',
type: 'mapping',
width: 50,
map: {
'true': '运行中',
'false': '未运行',
}
}
},
{
label: '进度',
type: 'progress',
value: '${ROUND(progress * 100)}',
map: 'bg-primary',
},
]
}*/
}
]
}
}