Skip to content
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 @@ -1074,6 +1074,10 @@ public ConnectorPackageService getConnectorPackageService() {
return connectorPackageService;
}

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

@VisibleForTesting
protected IMap<Long, HashMap<TaskLocation, SeaTunnelMetricsContext>> getMetricsImap() {
return metricsImap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public static OverviewInfo getOverviewInfo(
.name()
.equals(JobStatus.FINISHED.toString()))
.count());
overviewInfo.setPendingJobs(server.getCoordinatorService().getPendingJobCount());

return overviewInfo;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class OverviewInfo implements Serializable {
private long runningJobs;
private long finishedJobs;
private long failedJobs;
private long pendingJobs;
private long cancelledJobs;
private int workers;
}