|
|
|
@ -133,7 +133,7 @@ void fpm_status_update_max_children_reached(struct fpm_shm_s *shm, unsigned int |
|
|
|
} |
|
|
|
/* }}} */ |
|
|
|
|
|
|
|
void fpm_status_update_activity(struct fpm_shm_s *shm, int idle, int active, int total, int clear_last_update) /* {{{ */ |
|
|
|
void fpm_status_update_activity(struct fpm_shm_s *shm, int idle, int active, int total, unsigned cur_lq, int max_lq, int clear_last_update) /* {{{ */ |
|
|
|
{ |
|
|
|
struct fpm_status_s status; |
|
|
|
|
|
|
|
@ -146,6 +146,8 @@ void fpm_status_update_activity(struct fpm_shm_s *shm, int idle, int active, int |
|
|
|
status.idle = idle; |
|
|
|
status.active = active; |
|
|
|
status.total = total; |
|
|
|
status.cur_lq = cur_lq; |
|
|
|
status.max_lq = max_lq; |
|
|
|
if (clear_last_update) { |
|
|
|
memset(&status.last_update, 0, sizeof(status.last_update)); |
|
|
|
} else { |
|
|
|
@ -164,14 +166,28 @@ static void fpm_status_handle_status_txt(struct fpm_status_s *status, char **out |
|
|
|
} |
|
|
|
|
|
|
|
spprintf(output, 0, |
|
|
|
"accepted conn: %lu\n" |
|
|
|
"pool: %s\n" |
|
|
|
"process manager: %s\n" |
|
|
|
"accepted conn: %lu\n" |
|
|
|
#if HAVE_FPM_LQ |
|
|
|
"listen queue len: %u\n" |
|
|
|
"max listen queue len: %d\n" |
|
|
|
#endif |
|
|
|
"idle processes: %d\n" |
|
|
|
"active processes: %d\n" |
|
|
|
"total processes: %d\n" |
|
|
|
"max children reached: %u\n", |
|
|
|
status->accepted_conn, fpm_status_pool, status->pm == PM_STYLE_STATIC ? "static" : "dynamic", status->idle, status->active, status->total, status->max_children_reached); |
|
|
|
fpm_status_pool, |
|
|
|
status->pm == PM_STYLE_STATIC ? "static" : "dynamic", |
|
|
|
status->accepted_conn, |
|
|
|
#if HAVE_FPM_LQ |
|
|
|
status->cur_lq, |
|
|
|
status->max_lq, |
|
|
|
#endif |
|
|
|
status->idle, |
|
|
|
status->active, |
|
|
|
status->total, |
|
|
|
status->max_children_reached); |
|
|
|
|
|
|
|
spprintf(content_type, 0, "Content-Type: text/plain"); |
|
|
|
} |
|
|
|
@ -185,15 +201,29 @@ static void fpm_status_handle_status_html(struct fpm_status_s *status, char **ou |
|
|
|
|
|
|
|
spprintf(output, 0, |
|
|
|
"<table>\n" |
|
|
|
"<tr><th>accepted conn</th><td>%lu</td></tr>\n" |
|
|
|
"<tr><th>pool</th><td>%s</td></tr>\n" |
|
|
|
"<tr><th>process manager</th><td>%s</td></tr>\n" |
|
|
|
"<tr><th>accepted conn</th><td>%lu</td></tr>\n" |
|
|
|
#if HAVE_FPM_LQ |
|
|
|
"<tr><th>listen queue len</th><td>%u</td></tr>\n" |
|
|
|
"<tr><th>max listen queue len</th><td>%d</td></tr>\n" |
|
|
|
#endif |
|
|
|
"<tr><th>idle processes</th><td>%d</td></tr>\n" |
|
|
|
"<tr><th>active processes</th><td>%d</td></tr>\n" |
|
|
|
"<tr><th>total processes</th><td>%d</td></tr>\n" |
|
|
|
"<tr><th>max children reached</th><td>%u</td></tr>\n" |
|
|
|
"</table>", |
|
|
|
status->accepted_conn, fpm_status_pool, status->pm == PM_STYLE_STATIC ? "static" : "dynamic", status->idle, status->active, status->total, status->max_children_reached); |
|
|
|
fpm_status_pool, |
|
|
|
status->pm == PM_STYLE_STATIC ? "static" : "dynamic", |
|
|
|
status->accepted_conn, |
|
|
|
#if HAVE_FPM_LQ |
|
|
|
status->cur_lq, |
|
|
|
status->max_lq, |
|
|
|
#endif |
|
|
|
status->idle, |
|
|
|
status->active, |
|
|
|
status->total, |
|
|
|
status->max_children_reached); |
|
|
|
|
|
|
|
spprintf(content_type, 0, "Content-Type: text/html"); |
|
|
|
} |
|
|
|
@ -207,15 +237,29 @@ static void fpm_status_handle_status_json(struct fpm_status_s *status, char **ou |
|
|
|
|
|
|
|
spprintf(output, 0, |
|
|
|
"{" |
|
|
|
"\"accepted conn\":%lu," |
|
|
|
"\"pool\":\"%s\"," |
|
|
|
"\"process manager\":\"%s\"," |
|
|
|
"\"accepted conn\":%lu," |
|
|
|
#if HAVE_FPM_LQ |
|
|
|
"\"listen queue len\":%u," |
|
|
|
"\"max listen queue len\":%d," |
|
|
|
#endif |
|
|
|
"\"idle processes\":%d," |
|
|
|
"\"active processes\":%d," |
|
|
|
"\"total processes\":%d," |
|
|
|
"\"max children reached\":%u" |
|
|
|
"}", |
|
|
|
status->accepted_conn, fpm_status_pool, status->pm == PM_STYLE_STATIC ? "static" : "dynamic", status->idle, status->active, status->total, status->max_children_reached); |
|
|
|
fpm_status_pool, |
|
|
|
status->pm == PM_STYLE_STATIC ? "static" : "dynamic", |
|
|
|
status->accepted_conn, |
|
|
|
#if HAVE_FPM_LQ |
|
|
|
status->cur_lq, |
|
|
|
status->max_lq, |
|
|
|
#endif |
|
|
|
status->idle, |
|
|
|
status->active, |
|
|
|
status->total, |
|
|
|
status->max_children_reached); |
|
|
|
|
|
|
|
spprintf(content_type, 0, "Content-Type: application/json"); |
|
|
|
} |
|
|
|
|