mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 13:51:26 +02:00
[MINOR] stats: indicate if a task is running in "show sess"
It's sometimes useful to know that a task is currently running.
This commit is contained in:
parent
922a806075
commit
8a5c626e73
@ -1176,16 +1176,20 @@ void stats_dump_sess_to_buffer(struct session *s, struct buffer *rep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
chunk_printf(&msg, sizeof(trash),
|
chunk_printf(&msg, sizeof(trash),
|
||||||
" si=(%d,%d) as=%d age=%s",
|
" si=(%d,%d) as=%d ts=%02x age=%s",
|
||||||
curr_sess->si[0].state, curr_sess->si[1].state,
|
curr_sess->si[0].state, curr_sess->si[1].state,
|
||||||
curr_sess->ana_state,
|
curr_sess->ana_state, curr_sess->task->state,
|
||||||
human_time(now.tv_sec - curr_sess->logs.tv_accept.tv_sec, 1));
|
human_time(now.tv_sec - curr_sess->logs.tv_accept.tv_sec, 1));
|
||||||
|
|
||||||
|
if (curr_sess->task->state & TASK_IN_RUNQUEUE)
|
||||||
|
chunk_printf(&msg, sizeof(trash), " run(nice=%d)\n", curr_sess->task->nice);
|
||||||
|
else
|
||||||
chunk_printf(&msg, sizeof(trash),
|
chunk_printf(&msg, sizeof(trash),
|
||||||
" exp=%s\n",
|
" exp=%s\n",
|
||||||
curr_sess->task->expire ?
|
curr_sess->task->expire ?
|
||||||
human_time(TICKS_TO_MS(tick_remain(now_ms, curr_sess->task->expire)),
|
human_time(TICKS_TO_MS(tick_remain(now_ms, curr_sess->task->expire)),
|
||||||
TICKS_TO_MS(1000)) : "never");
|
TICKS_TO_MS(1000))
|
||||||
|
: "never");
|
||||||
|
|
||||||
if (buffer_write_chunk(rep, &msg) >= 0) {
|
if (buffer_write_chunk(rep, &msg) >= 0) {
|
||||||
/* let's try again later */
|
/* let's try again later */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user