Fetch servers info and show in ServersTable

This commit is contained in:
Ken Hibino
2020-12-31 07:02:54 -08:00
parent d78abcf584
commit 3f9e8820d9
6 changed files with 178 additions and 5 deletions

View File

@@ -32,6 +32,10 @@ export interface ListDeadTasksResponse {
stats: Queue;
}
export interface ListServersResponse {
servers: ServerInfo[];
}
export interface ListSchedulerEntriesResponse {
entries: SchedulerEntry[];
}
@@ -129,7 +133,20 @@ export interface DeadTask extends BaseTask {
}
export interface ServerInfo {
// TODO: fill this out
id: string;
host: string;
pid: number;
concurrency: number;
queue_priorities: { [qname: string]: number };
strict_priority_enabled: boolean;
start_time: string;
status: string;
active_workers: WorkerInfo[];
}
export interface WorkerInfo {
task: ActiveTask;
start_time: string;
}
export interface SchedulerEntry {
@@ -545,6 +562,14 @@ export async function runAllDeadTasks(qname: string): Promise<void> {
});
}
export async function listServers(): Promise<ListServersResponse> {
const resp = await axios({
method: "get",
url: `${BASE_URL}/servers`,
});
return resp.data;
}
export async function listSchedulerEntries(): Promise<ListSchedulerEntriesResponse> {
const resp = await axios({
method: "get",