mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-06 05:31:44 +00:00
report static nodes in corerouters stats
This commit is contained in:
@@ -3101,6 +3101,7 @@ struct uwsgi_string_list *uwsgi_string_new_list(struct uwsgi_string_list **list,
|
||||
}
|
||||
uwsgi_string->next = NULL;
|
||||
uwsgi_string->custom = 0;
|
||||
uwsgi_string->custom2 = 0;
|
||||
|
||||
return uwsgi_string;
|
||||
}
|
||||
|
||||
@@ -970,6 +970,29 @@ void corerouter_send_stats(struct uwsgi_corerouter *ucr) {
|
||||
if (uwsgi_stats_list_close(us)) goto end0;
|
||||
if (uwsgi_stats_comma(us)) goto end0;
|
||||
|
||||
if (ucr->static_nodes) {
|
||||
if (uwsgi_stats_key(us , "static_nodes")) goto end0;
|
||||
if (uwsgi_stats_list_open(us)) goto end0;
|
||||
|
||||
struct uwsgi_string_list *usl = ucr->static_nodes;
|
||||
while(usl) {
|
||||
if (uwsgi_stats_object_open(us)) goto end0;
|
||||
if (uwsgi_stats_keyvaln_comma(us, "name", usl->value, usl->len)) goto end0;
|
||||
|
||||
if (uwsgi_stats_keylong_comma(us, "hits", (unsigned long long) usl->custom2)) goto end0;
|
||||
if (uwsgi_stats_keylong(us, "grace", (unsigned long long) usl->custom)) goto end0;
|
||||
|
||||
if (uwsgi_stats_object_close(us)) goto end0;
|
||||
usl = usl->next;
|
||||
if (usl) {
|
||||
if (uwsgi_stats_comma(us)) goto end0;
|
||||
}
|
||||
}
|
||||
|
||||
if (uwsgi_stats_list_close(us)) goto end0;
|
||||
if (uwsgi_stats_comma(us)) goto end0;
|
||||
}
|
||||
|
||||
if (ucr->has_subscription_sockets) {
|
||||
if (uwsgi_stats_key(us , "subscriptions")) goto end0;
|
||||
if (uwsgi_stats_list_open(us)) goto end0;
|
||||
|
||||
@@ -252,6 +252,7 @@ ssize_t fr_instance_connected(struct corerouter_session * cs) {
|
||||
cs->buffer_pos = 0;
|
||||
|
||||
// ok instance is connected, wait for write again
|
||||
if (cs->static_node) cs->static_node->custom2++;
|
||||
if (cs->un) cs->un->requests++;
|
||||
uwsgi_cr_hook_instance_write(cs, fr_instance_send_request_header);
|
||||
// return a value > 0
|
||||
|
||||
@@ -884,6 +884,7 @@ ssize_t hr_instance_connected(struct corerouter_session * cs) {
|
||||
return 1;
|
||||
}
|
||||
// ok instance is connected, wait for write again
|
||||
if (cs->static_node) cs->static_node->custom2++;
|
||||
if (cs->un) cs->un->requests++;
|
||||
uwsgi_cr_hook_instance_write(cs, hr_instance_send_request_header);
|
||||
// return a value > 0
|
||||
|
||||
@@ -209,6 +209,7 @@ ssize_t rr_instance_connected(struct corerouter_session * cs) {
|
||||
cs->buffer_pos = 0;
|
||||
|
||||
// ok instance is connected, begin...
|
||||
if (cs->static_node) cs->static_node->custom2++;
|
||||
if (cs->un) cs->un->requests++;
|
||||
|
||||
uwsgi_cr_hook_instance_write(cs, NULL);
|
||||
|
||||
Reference in New Issue
Block a user