This is an automated email from the ASF dual-hosted git repository.
rickyma pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git
The following commit(s) were added to refs/heads/master by this push:
new 2b9593627 [MINOR] feat(dashboard/coordinator): Display total number of
applications in dashboard (#2031)
2b9593627 is described below
commit 2b959362781e6e59a6e82ae951cc3bb16ac288f6
Author: maobaolong <[email protected]>
AuthorDate: Mon Aug 12 15:52:01 2024 +0800
[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">
---
.../uniffle/coordinator/web/resource/ApplicationResource.java | 2 ++
dashboard/src/main/webapp/src/mock/applicationpage.js | 2 +-
dashboard/src/main/webapp/src/pages/ApplicationPage.vue | 10 ++++++++++
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git
a/coordinator/src/main/java/org/apache/uniffle/coordinator/web/resource/ApplicationResource.java
b/coordinator/src/main/java/org/apache/uniffle/coordinator/web/resource/ApplicationResource.java
index 88852a093..9839ec92e 100644
---
a/coordinator/src/main/java/org/apache/uniffle/coordinator/web/resource/ApplicationResource.java
+++
b/coordinator/src/main/java/org/apache/uniffle/coordinator/web/resource/ApplicationResource.java
@@ -36,6 +36,7 @@ import org.apache.uniffle.common.web.resource.BaseResource;
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;
@@ -51,6 +52,7 @@ public class ApplicationResource extends BaseResource {
() -> {
Map<String, Integer> appTotalityMap = Maps.newHashMap();
appTotalityMap.put("appTotality",
getApplicationManager().getAppIds().size());
+ appTotalityMap.put("appCurrent", (int)
CoordinatorMetrics.counterTotalAppNum.get());
return appTotalityMap;
});
}
diff --git a/dashboard/src/main/webapp/src/mock/applicationpage.js
b/dashboard/src/main/webapp/src/mock/applicationpage.js
index 27af165dd..6db75341e 100644
--- a/dashboard/src/main/webapp/src/mock/applicationpage.js
+++ b/dashboard/src/main/webapp/src/mock/applicationpage.js
@@ -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) {
diff --git a/dashboard/src/main/webapp/src/pages/ApplicationPage.vue
b/dashboard/src/main/webapp/src/pages/ApplicationPage.vue
index 9621dd05c..9290c5111 100644
--- a/dashboard/src/main/webapp/src/pages/ApplicationPage.vue
+++ b/dashboard/src/main/webapp/src/pages/ApplicationPage.vue
@@ -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>