mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-10-07 20:52:02 +08:00
Fetch DailyStats in Dashboard view
This commit is contained in:
@@ -60,6 +60,10 @@ export interface BatchKillTasksResponse {
|
||||
error_keys: string[];
|
||||
}
|
||||
|
||||
export interface ListQueueStatsResponse {
|
||||
stats: { [qname: string]: DailyStat[] };
|
||||
}
|
||||
|
||||
export interface Queue {
|
||||
queue: string;
|
||||
paused: boolean;
|
||||
@@ -75,6 +79,7 @@ export interface Queue {
|
||||
}
|
||||
|
||||
export interface DailyStat {
|
||||
queue: string;
|
||||
date: string;
|
||||
processed: number;
|
||||
failed: number;
|
||||
@@ -174,6 +179,14 @@ export async function resumeQueue(qname: string): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
export async function listQueueStats(): Promise<ListQueueStatsResponse> {
|
||||
const resp = await axios({
|
||||
method: "get",
|
||||
url: `${BASE_URL}/queue_stats`,
|
||||
});
|
||||
return resp.data;
|
||||
}
|
||||
|
||||
export async function listActiveTasks(
|
||||
qname: string,
|
||||
pageOpts?: PaginationOptions
|
||||
|
Reference in New Issue
Block a user