summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/nxt_event_engine.h1
-rw-r--r--src/nxt_http_request.c2
-rw-r--r--src/nxt_router.c1
-rw-r--r--src/nxt_status.c5
-rw-r--r--src/nxt_status.h1
5 files changed, 9 insertions, 1 deletions
diff --git a/src/nxt_event_engine.h b/src/nxt_event_engine.h
index 4153742d..291ea749 100644
--- a/src/nxt_event_engine.h
+++ b/src/nxt_event_engine.h
@@ -486,6 +486,7 @@ struct nxt_event_engine_s {
nxt_atomic_uint_t accepted_conns_cnt;
nxt_atomic_uint_t idle_conns_cnt;
nxt_atomic_uint_t closed_conns_cnt;
+ nxt_atomic_uint_t requests_cnt;
nxt_queue_link_t link;
// STUB: router link
diff --git a/src/nxt_http_request.c b/src/nxt_http_request.c
index a16340de..943ad82d 100644
--- a/src/nxt_http_request.c
+++ b/src/nxt_http_request.c
@@ -278,6 +278,8 @@ nxt_http_request_create(nxt_task_t *task)
r->resp.content_length_n = -1;
r->state = &nxt_http_request_init_state;
+ task->thread->engine->requests_cnt++;
+
return r;
fail:
diff --git a/src/nxt_router.c b/src/nxt_router.c
index e7723a2d..f02bf3f2 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -967,6 +967,7 @@ nxt_router_status_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg)
report->accepted_conns += engine->accepted_conns_cnt;
report->idle_conns += engine->idle_conns_cnt;
report->closed_conns += engine->closed_conns_cnt;
+ report->requests += engine->requests_cnt;
} nxt_queue_loop;
diff --git a/src/nxt_status.c b/src/nxt_status.c
index 529f6ebb..12280019 100644
--- a/src/nxt_status.c
+++ b/src/nxt_status.c
@@ -23,6 +23,7 @@ nxt_status_get(nxt_status_report_t *report, nxt_mp_t *mp)
static nxt_str_t idle_str = nxt_string("idle");
static nxt_str_t closed_str = nxt_string("closed");
static nxt_str_t reqs_str = nxt_string("requests");
+ static nxt_str_t total_str = nxt_string("total");
static nxt_str_t apps_str = nxt_string("applications");
static nxt_str_t procs_str = nxt_string("processes");
static nxt_str_t run_str = nxt_string("running");
@@ -47,13 +48,15 @@ nxt_status_get(nxt_status_report_t *report, nxt_mp_t *mp)
nxt_conf_set_member_integer(obj, &idle_str, report->idle_conns, 2);
nxt_conf_set_member_integer(obj, &closed_str, report->closed_conns, 3);
- obj = nxt_conf_create_object(mp, 0);
+ obj = nxt_conf_create_object(mp, 1);
if (nxt_slow_path(obj == NULL)) {
return NULL;
}
nxt_conf_set_member(status, &reqs_str, obj, 1);
+ nxt_conf_set_member_integer(obj, &total_str, report->requests, 0);
+
apps = nxt_conf_create_object(mp, report->apps_count);
if (nxt_slow_path(obj == NULL)) {
return NULL;
diff --git a/src/nxt_status.h b/src/nxt_status.h
index b12eabcb..a99ac7d0 100644
--- a/src/nxt_status.h
+++ b/src/nxt_status.h
@@ -20,6 +20,7 @@ typedef struct {
uint64_t accepted_conns;
uint64_t idle_conns;
uint64_t closed_conns;
+ uint64_t requests;
size_t apps_count;
nxt_status_app_t apps[];