mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-19 03:05:53 +08:00
Add group count and aggregating task count in TaskView
This commit is contained in:
parent
6ec87cd434
commit
a0e80ca4da
@ -82,6 +82,8 @@ type queueStateSnapshot struct {
|
|||||||
MemoryUsage int64 `json:"memory_usage_bytes"`
|
MemoryUsage int64 `json:"memory_usage_bytes"`
|
||||||
// Total number of tasks in the queue.
|
// Total number of tasks in the queue.
|
||||||
Size int `json:"size"`
|
Size int `json:"size"`
|
||||||
|
// Totoal number of groups in the queue.
|
||||||
|
Groups int `json:"groups"`
|
||||||
// Latency of the queue in milliseconds.
|
// Latency of the queue in milliseconds.
|
||||||
LatencyMillisec int64 `json:"latency_msec"`
|
LatencyMillisec int64 `json:"latency_msec"`
|
||||||
// Latency duration string for display purpose.
|
// Latency duration string for display purpose.
|
||||||
@ -90,6 +92,7 @@ type queueStateSnapshot struct {
|
|||||||
// Number of tasks in each state.
|
// Number of tasks in each state.
|
||||||
Active int `json:"active"`
|
Active int `json:"active"`
|
||||||
Pending int `json:"pending"`
|
Pending int `json:"pending"`
|
||||||
|
Aggregating int `json:"aggregating"`
|
||||||
Scheduled int `json:"scheduled"`
|
Scheduled int `json:"scheduled"`
|
||||||
Retry int `json:"retry"`
|
Retry int `json:"retry"`
|
||||||
Archived int `json:"archived"`
|
Archived int `json:"archived"`
|
||||||
@ -117,6 +120,7 @@ func toQueueStateSnapshot(info *asynq.QueueInfo) *queueStateSnapshot {
|
|||||||
DisplayLatency: info.Latency.Round(10 * time.Millisecond).String(),
|
DisplayLatency: info.Latency.Round(10 * time.Millisecond).String(),
|
||||||
Active: info.Active,
|
Active: info.Active,
|
||||||
Pending: info.Pending,
|
Pending: info.Pending,
|
||||||
|
Aggregating: info.Aggregating,
|
||||||
Scheduled: info.Scheduled,
|
Scheduled: info.Scheduled,
|
||||||
Retry: info.Retry,
|
Retry: info.Retry,
|
||||||
Archived: info.Archived,
|
Archived: info.Archived,
|
||||||
|
2
go.mod
2
go.mod
@ -15,3 +15,5 @@ require (
|
|||||||
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
|
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
|
||||||
google.golang.org/protobuf v1.27.1 // indirect
|
google.golang.org/protobuf v1.27.1 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
|
replace github.com/hibiken/asynq => ../../../database/Redis/go/asynq
|
||||||
|
@ -254,11 +254,13 @@ export interface Queue {
|
|||||||
queue: string;
|
queue: string;
|
||||||
paused: boolean;
|
paused: boolean;
|
||||||
size: number;
|
size: number;
|
||||||
|
groups: number;
|
||||||
latency_msec: number;
|
latency_msec: number;
|
||||||
display_latency: string;
|
display_latency: string;
|
||||||
memory_usage_bytes: number;
|
memory_usage_bytes: number;
|
||||||
active: number;
|
active: number;
|
||||||
pending: number;
|
pending: number;
|
||||||
|
aggregating: number;
|
||||||
scheduled: number;
|
scheduled: number;
|
||||||
retry: number;
|
retry: number;
|
||||||
archived: number;
|
archived: number;
|
||||||
|
@ -65,6 +65,15 @@ function QueueInfoBanner(props: Props & ReduxProps) {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className={classes.bannerItem}>
|
||||||
|
<Typography variant="subtitle2" color="textPrimary" gutterBottom>
|
||||||
|
Task groups
|
||||||
|
</Typography>
|
||||||
|
<Typography color="textSecondary">
|
||||||
|
{queue ? queue.groups : "-"}
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className={classes.bannerItem}>
|
<div className={classes.bannerItem}>
|
||||||
<Typography variant="subtitle2" color="textPrimary" gutterBottom>
|
<Typography variant="subtitle2" color="textPrimary" gutterBottom>
|
||||||
Memory usage
|
Memory usage
|
||||||
|
@ -52,8 +52,10 @@ function mapStatetoProps(state: AppState, ownProps: Props) {
|
|||||||
queue: ownProps.queue,
|
queue: ownProps.queue,
|
||||||
paused: false,
|
paused: false,
|
||||||
size: 0,
|
size: 0,
|
||||||
|
groups: 0,
|
||||||
active: 0,
|
active: 0,
|
||||||
pending: 0,
|
pending: 0,
|
||||||
|
aggregating: 0,
|
||||||
scheduled: 0,
|
scheduled: 0,
|
||||||
retry: 0,
|
retry: 0,
|
||||||
archived: 0,
|
archived: 0,
|
||||||
@ -111,7 +113,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
},
|
},
|
||||||
search: {
|
search: {
|
||||||
position: "relative",
|
position: "relative",
|
||||||
width: "312px",
|
width: "280px",
|
||||||
borderRadius: "18px",
|
borderRadius: "18px",
|
||||||
backgroundColor: isDarkTheme(theme) ? "#303030" : theme.palette.grey[100],
|
backgroundColor: isDarkTheme(theme) ? "#303030" : theme.palette.grey[100],
|
||||||
"&:hover, &:focus": {
|
"&:hover, &:focus": {
|
||||||
@ -147,6 +149,11 @@ function TasksTable(props: Props & ReduxProps) {
|
|||||||
const chips = [
|
const chips = [
|
||||||
{ key: "active", label: "Active", count: currentStats.active },
|
{ key: "active", label: "Active", count: currentStats.active },
|
||||||
{ key: "pending", label: "Pending", count: currentStats.pending },
|
{ key: "pending", label: "Pending", count: currentStats.pending },
|
||||||
|
{
|
||||||
|
key: "aggregating",
|
||||||
|
label: "Aggregating",
|
||||||
|
count: currentStats.aggregating,
|
||||||
|
},
|
||||||
{ key: "scheduled", label: "Scheduled", count: currentStats.scheduled },
|
{ key: "scheduled", label: "Scheduled", count: currentStats.scheduled },
|
||||||
{ key: "retry", label: "Retry", count: currentStats.retry },
|
{ key: "retry", label: "Retry", count: currentStats.retry },
|
||||||
{ key: "archived", label: "Archived", count: currentStats.archived },
|
{ key: "archived", label: "Archived", count: currentStats.archived },
|
||||||
@ -218,6 +225,9 @@ function TasksTable(props: Props & ReduxProps) {
|
|||||||
totalTaskCount={currentStats.pending}
|
totalTaskCount={currentStats.pending}
|
||||||
/>
|
/>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
|
<TabPanel value="aggregating" selected={props.selected}>
|
||||||
|
<h3>TODO: GroupTable here</h3>
|
||||||
|
</TabPanel>
|
||||||
<TabPanel value="scheduled" selected={props.selected}>
|
<TabPanel value="scheduled" selected={props.selected}>
|
||||||
<ScheduledTasksTable
|
<ScheduledTasksTable
|
||||||
queue={props.queue}
|
queue={props.queue}
|
||||||
|
@ -38,6 +38,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
const validStatus = [
|
const validStatus = [
|
||||||
"active",
|
"active",
|
||||||
"pending",
|
"pending",
|
||||||
|
"aggregating",
|
||||||
"scheduled",
|
"scheduled",
|
||||||
"retry",
|
"retry",
|
||||||
"archived",
|
"archived",
|
||||||
|
Loading…
Reference in New Issue
Block a user