Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/en/seatunnel-engine/rest-api-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Please refer [security](security.md)
"unassignedSlot":"0",
"works":"1",
"runningJobs":"0",
"pendingJobs":"0",
"finishedJobs":"0",
"failedJobs":"0",
"cancelledJobs":"0"
Expand Down
1 change: 1 addition & 0 deletions docs/zh/seatunnel-engine/rest-api-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ seatunnel:
"unassignedSlot":"0",
"works":"1",
"runningJobs":"0",
"pendingJobs":"0",
"finishedJobs":"0",
"failedJobs":"0",
"cancelledJobs":"0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,8 @@ public void testOverview() {
.statusCode(200)
.body("projectVersion", notNullValue())
.body("totalSlot", equalTo("40"))
.body("workers", equalTo("2"));
.body("workers", equalTo("2"))
.body("pendingJobs", notNullValue());
given().get(
HOST
+ value
Expand All @@ -680,7 +681,8 @@ public void testOverview() {
.statusCode(200)
.body("projectVersion", notNullValue())
.body("totalSlot", equalTo("40"))
.body("workers", equalTo("2"));
.body("workers", equalTo("2"))
.body("pendingJobs", notNullValue());
});
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,10 @@ protected IMap<Long, HashMap<TaskLocation, SeaTunnelMetricsContext>> getMetricsI
return metricsImap;
}

public int getPendingJobCount() {
return pendingJobQueue.getJobIdMap().size();
}

@VisibleForTesting
public PeekBlockingQueue<PendingJobInfo> getPendingJobQueue() {
return pendingJobQueue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public static OverviewInfo getOverviewInfo(
overviewInfo.setTotalSlot(assignedSlots.size() + unassignedSlots.size());
overviewInfo.setUnassignedSlot(unassignedSlots.size());
overviewInfo.setWorkers(resourceManager.workerCount(tags));
overviewInfo.setPendingJobs(server.getCoordinatorService().getPendingJobCount());
overviewInfo.setRunningJobs(
nodeEngine.getHazelcastInstance().getMap(Constant.IMAP_RUNNING_JOB_INFO).size());
overviewInfo.setFailedJobs(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class OverviewInfo implements Serializable {
private String gitCommitAbbrev;
private int totalSlot;
private int unassignedSlot;
private long pendingJobs;
private long runningJobs;
private long finishedJobs;
private long failedJobs;
Expand Down