diff options
author | moisseev <moiseev@mezonplus.ru> | 2020-08-05 18:04:35 +0300 |
---|---|---|
committer | moisseev <moiseev@mezonplus.ru> | 2020-08-05 18:04:35 +0300 |
commit | cff0a94678a2da9378ced8b5da09d5a4464f165a (patch) | |
tree | de57505579a94730f9d0ff70a71eb0de2fbd020a /src/controller.c | |
parent | 1b0ed3b3a44bb9fec28a65e6624be09de78fa530 (diff) | |
download | rspamd-cff0a94678a2da9378ced8b5da09d5a4464f165a.tar.gz rspamd-cff0a94678a2da9378ced8b5da09d5a4464f165a.zip |
[Minor] Extend /stat response
Diffstat (limited to 'src/controller.c')
-rw-r--r-- | src/controller.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/controller.c b/src/controller.c index 9abd8f109..e3f810d0e 100644 --- a/src/controller.c +++ b/src/controller.c @@ -2567,6 +2567,7 @@ rspamd_controller_handle_stat_common ( struct rspamd_controller_session *session = conn_ent->ud; ucl_object_t *top, *sub; gint i; + int64_t uptime; guint64 spam = 0, ham = 0; rspamd_mempool_stat_t mem_st; struct rspamd_stat *stat, stat_copy; @@ -2598,6 +2599,13 @@ rspamd_controller_handle_stat_common ( task->http_conn = rspamd_http_connection_ref (conn_ent->conn);; task->sock = conn_ent->conn->fd; + ucl_object_insert_key (top, ucl_object_fromstring ( + RVERSION), "version", 0, false); + ucl_object_insert_key (top, ucl_object_fromstring ( + session->ctx->cfg->checksum), "config_id", 0, false); + uptime = ev_time () - session->ctx->start_time; + ucl_object_insert_key (top, ucl_object_fromint ( + uptime), "uptime", 0, false); ucl_object_insert_key (top, ucl_object_frombool (!session->is_enable), "read_only", 0, false); ucl_object_insert_key (top, ucl_object_fromint ( |