Skip to content

Commit 2b95936

Browse files
authored
[MINOR] feat(dashboard/coordinator): Display total number of applications in dashboard (#2031)
### What changes are proposed in this pull request? Display the total number of applications in the dashboard and update the original `total app num` to `current app num`. ### Why are these changes needed? We want to view the number of running and completed applications from the beginning until now. ### Does this PR introduce _any_ user-facing changes? - Display the total number of applications in the dashboard - Update the original `total app num` to `current app num` ### How was this patch tested? Start the cluster, run a Spark application, and check the dashboard. <img width="683" alt="image" src="https://github.com/user-attachments/assets/e4aa1c93-b329-4891-844f-f89d29ee7a8b">
1 parent c92406f commit 2b95936

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

coordinator/src/main/java/org/apache/uniffle/coordinator/web/resource/ApplicationResource.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.apache.uniffle.common.web.resource.Response;
3737
import org.apache.uniffle.coordinator.AppInfo;
3838
import org.apache.uniffle.coordinator.ApplicationManager;
39+
import org.apache.uniffle.coordinator.metric.CoordinatorMetrics;
3940
import org.apache.uniffle.coordinator.web.vo.AppInfoVO;
4041
import org.apache.uniffle.coordinator.web.vo.UserAppNumVO;
4142

@@ -51,6 +52,7 @@ public Response<Map<String, Integer>> getAppTotality() {
5152
() -> {
5253
Map<String, Integer> appTotalityMap = Maps.newHashMap();
5354
appTotalityMap.put("appTotality", getApplicationManager().getAppIds().size());
55+
appTotalityMap.put("appCurrent", (int) CoordinatorMetrics.counterTotalAppNum.get());
5456
return appTotalityMap;
5557
});
5658
}

dashboard/src/main/webapp/src/mock/applicationpage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import Mock from 'mockjs'
1919

2020
Mock.mock(/\/app\/total/, 'get', function (options) {
21-
return { code: 0, data: { appTotality: 10 }, errMsg: 'success' }
21+
return { code: 0, data: { appTotality: 10, appCurrent: 10 }, errMsg: 'success' }
2222
})
2323

2424
Mock.mock(/\/app\/appInfos/, 'get', function (options) {

dashboard/src/main/webapp/src/pages/ApplicationPage.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@
2828
<div class="appcnt">{{ pageData.apptotal.appTotality }}</div>
2929
</el-card>
3030
</el-col>
31+
<el-col :span="4">
32+
<el-card class="box-card" shadow="hover">
33+
<template #header>
34+
<div class="card-header">
35+
<span class="cardtile">APPS CURRENT TOTAL</span>
36+
</div>
37+
</template>
38+
<div class="appcnt">{{ pageData.apptotal.appCurrent }}</div>
39+
</el-card>
40+
</el-col>
3141
</el-row>
3242
<el-divider />
3343
<el-tag>User App ranking</el-tag>

0 commit comments

Comments
 (0)