Skip to content

Commit

Permalink
[MINOR] feat(dashboard/coordinator): Display total number of applicat…
Browse files Browse the repository at this point in the history
…ions in dashboard (apache#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">
  • Loading branch information
maobaolong authored Aug 12, 2024
1 parent c92406f commit 2b95936
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.apache.uniffle.common.web.resource.Response;
import org.apache.uniffle.coordinator.AppInfo;
import org.apache.uniffle.coordinator.ApplicationManager;
import org.apache.uniffle.coordinator.metric.CoordinatorMetrics;
import org.apache.uniffle.coordinator.web.vo.AppInfoVO;
import org.apache.uniffle.coordinator.web.vo.UserAppNumVO;

Expand All @@ -51,6 +52,7 @@ public Response<Map<String, Integer>> getAppTotality() {
() -> {
Map<String, Integer> appTotalityMap = Maps.newHashMap();
appTotalityMap.put("appTotality", getApplicationManager().getAppIds().size());
appTotalityMap.put("appCurrent", (int) CoordinatorMetrics.counterTotalAppNum.get());
return appTotalityMap;
});
}
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/main/webapp/src/mock/applicationpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import Mock from 'mockjs'

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

Mock.mock(/\/app\/appInfos/, 'get', function (options) {
Expand Down
10 changes: 10 additions & 0 deletions dashboard/src/main/webapp/src/pages/ApplicationPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@
<div class="appcnt">{{ pageData.apptotal.appTotality }}</div>
</el-card>
</el-col>
<el-col :span="4">
<el-card class="box-card" shadow="hover">
<template #header>
<div class="card-header">
<span class="cardtile">APPS CURRENT TOTAL</span>
</div>
</template>
<div class="appcnt">{{ pageData.apptotal.appCurrent }}</div>
</el-card>
</el-col>
</el-row>
<el-divider />
<el-tag>User App ranking</el-tag>
Expand Down

0 comments on commit 2b95936

Please sign in to comment.