mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
[MINOR] stats: report number of tasks (active and running)
It may be useful for statistics purposes to report the number of tasks.
This commit is contained in:
parent
a461318f97
commit
c7bdf09f9f
@ -80,6 +80,8 @@
|
|||||||
/* a few exported variables */
|
/* a few exported variables */
|
||||||
extern unsigned int nb_tasks; /* total number of tasks */
|
extern unsigned int nb_tasks; /* total number of tasks */
|
||||||
extern unsigned int run_queue; /* run queue size */
|
extern unsigned int run_queue; /* run queue size */
|
||||||
|
extern unsigned int run_queue_cur;
|
||||||
|
extern unsigned int nb_tasks_cur;
|
||||||
extern unsigned int niced_tasks; /* number of niced tasks in the run queue */
|
extern unsigned int niced_tasks; /* number of niced tasks in the run queue */
|
||||||
extern struct pool_head *pool2_task;
|
extern struct pool_head *pool2_task;
|
||||||
extern struct eb32_node *last_timer; /* optimization: last queued timer */
|
extern struct eb32_node *last_timer; /* optimization: last queued timer */
|
||||||
|
@ -235,6 +235,8 @@ int stats_dump_raw(struct session *s, struct buffer *rep, struct uri_auth *uri)
|
|||||||
"CurrConns: %d\n"
|
"CurrConns: %d\n"
|
||||||
"PipesUsed: %d\n"
|
"PipesUsed: %d\n"
|
||||||
"PipesFree: %d\n"
|
"PipesFree: %d\n"
|
||||||
|
"Tasks: %d\n"
|
||||||
|
"Run_queue: %d\n"
|
||||||
"",
|
"",
|
||||||
global.nbproc,
|
global.nbproc,
|
||||||
relative_pid,
|
relative_pid,
|
||||||
@ -244,7 +246,8 @@ int stats_dump_raw(struct session *s, struct buffer *rep, struct uri_auth *uri)
|
|||||||
global.rlimit_memmax,
|
global.rlimit_memmax,
|
||||||
global.rlimit_nofile,
|
global.rlimit_nofile,
|
||||||
global.maxsock, global.maxconn, global.maxpipes,
|
global.maxsock, global.maxconn, global.maxpipes,
|
||||||
actconn, pipes_used, pipes_free
|
actconn, pipes_used, pipes_free,
|
||||||
|
nb_tasks_cur, run_queue_cur
|
||||||
);
|
);
|
||||||
if (buffer_write_chunk(rep, &msg) >= 0)
|
if (buffer_write_chunk(rep, &msg) >= 0)
|
||||||
return 0;
|
return 0;
|
||||||
@ -468,6 +471,7 @@ int stats_dump_http(struct session *s, struct buffer *rep, struct uri_auth *uri)
|
|||||||
"<b>system limits :</b> memmax = %s%s ; ulimit-n = %d<br>\n"
|
"<b>system limits :</b> memmax = %s%s ; ulimit-n = %d<br>\n"
|
||||||
"<b>maxsock = </b> %d ; <b>maxconn = </b> %d ; <b>maxpipes = </b> %d<br>\n"
|
"<b>maxsock = </b> %d ; <b>maxconn = </b> %d ; <b>maxpipes = </b> %d<br>\n"
|
||||||
"current conns = %d ; current pipes = %d/%d<br>\n"
|
"current conns = %d ; current pipes = %d/%d<br>\n"
|
||||||
|
"Running tasks : %d/%d<br>\n"
|
||||||
"</td><td align=\"center\" nowrap>\n"
|
"</td><td align=\"center\" nowrap>\n"
|
||||||
"<table class=\"lgd\"><tr>\n"
|
"<table class=\"lgd\"><tr>\n"
|
||||||
"<td class=\"active3\"> </td><td class=\"noborder\">active UP </td>"
|
"<td class=\"active3\"> </td><td class=\"noborder\">active UP </td>"
|
||||||
@ -496,7 +500,8 @@ int stats_dump_http(struct session *s, struct buffer *rep, struct uri_auth *uri)
|
|||||||
global.rlimit_memmax ? " MB" : "",
|
global.rlimit_memmax ? " MB" : "",
|
||||||
global.rlimit_nofile,
|
global.rlimit_nofile,
|
||||||
global.maxsock, global.maxconn, global.maxpipes,
|
global.maxsock, global.maxconn, global.maxpipes,
|
||||||
actconn, pipes_used, pipes_used+pipes_free
|
actconn, pipes_used, pipes_used+pipes_free,
|
||||||
|
run_queue_cur, nb_tasks_cur
|
||||||
);
|
);
|
||||||
|
|
||||||
if (s->data_ctx.stats.flags & STAT_HIDE_DOWN)
|
if (s->data_ctx.stats.flags & STAT_HIDE_DOWN)
|
||||||
|
@ -27,6 +27,8 @@ struct pool_head *pool2_task;
|
|||||||
|
|
||||||
unsigned int nb_tasks = 0;
|
unsigned int nb_tasks = 0;
|
||||||
unsigned int run_queue = 0;
|
unsigned int run_queue = 0;
|
||||||
|
unsigned int run_queue_cur = 0; /* copy of the run queue size */
|
||||||
|
unsigned int nb_tasks_cur = 0; /* copy of the tasks count */
|
||||||
unsigned int niced_tasks = 0; /* number of niced tasks in the run queue */
|
unsigned int niced_tasks = 0; /* number of niced tasks in the run queue */
|
||||||
struct eb32_node *last_timer = NULL; /* optimization: last queued timer */
|
struct eb32_node *last_timer = NULL; /* optimization: last queued timer */
|
||||||
|
|
||||||
@ -181,6 +183,8 @@ void process_runnable_tasks(int *next)
|
|||||||
unsigned int max_processed;
|
unsigned int max_processed;
|
||||||
int expire;
|
int expire;
|
||||||
|
|
||||||
|
run_queue_cur = run_queue; /* keep a copy for reporting */
|
||||||
|
nb_tasks_cur = nb_tasks;
|
||||||
max_processed = run_queue;
|
max_processed = run_queue;
|
||||||
if (max_processed > 200)
|
if (max_processed > 200)
|
||||||
max_processed = 200;
|
max_processed = 200;
|
||||||
|
Loading…
Reference in New Issue
Block a user