diff --git a/include/proto/task.h b/include/proto/task.h
index 54418b64e..19aab6167 100644
--- a/include/proto/task.h
+++ b/include/proto/task.h
@@ -80,6 +80,8 @@
/* a few exported variables */
extern unsigned int nb_tasks; /* total number of tasks */
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 struct pool_head *pool2_task;
extern struct eb32_node *last_timer; /* optimization: last queued timer */
diff --git a/src/dumpstats.c b/src/dumpstats.c
index 990e51f89..fd38f95dd 100644
--- a/src/dumpstats.c
+++ b/src/dumpstats.c
@@ -235,6 +235,8 @@ int stats_dump_raw(struct session *s, struct buffer *rep, struct uri_auth *uri)
"CurrConns: %d\n"
"PipesUsed: %d\n"
"PipesFree: %d\n"
+ "Tasks: %d\n"
+ "Run_queue: %d\n"
"",
global.nbproc,
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_nofile,
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)
return 0;
@@ -468,6 +471,7 @@ int stats_dump_http(struct session *s, struct buffer *rep, struct uri_auth *uri)
"system limits : memmax = %s%s ; ulimit-n = %d
\n"
"maxsock = %d ; maxconn = %d ; maxpipes = %d
\n"
"current conns = %d ; current pipes = %d/%d
\n"
+ "Running tasks : %d/%d
\n"
"
active UP | " @@ -496,7 +500,8 @@ int stats_dump_http(struct session *s, struct buffer *rep, struct uri_auth *uri) global.rlimit_memmax ? " MB" : "", global.rlimit_nofile, 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) diff --git a/src/task.c b/src/task.c index 8374c1274..95a00faed 100644 --- a/src/task.c +++ b/src/task.c @@ -27,6 +27,8 @@ struct pool_head *pool2_task; unsigned int nb_tasks = 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 */ struct eb32_node *last_timer = NULL; /* optimization: last queued timer */ @@ -181,6 +183,8 @@ void process_runnable_tasks(int *next) unsigned int max_processed; int expire; + run_queue_cur = run_queue; /* keep a copy for reporting */ + nb_tasks_cur = nb_tasks; max_processed = run_queue; if (max_processed > 200) max_processed = 200;