aboutsummaryrefslogtreecommitdiffstats
path: root/src/controller.c
diff options
context:
space:
mode:
authormoisseev <moiseev@mezonplus.ru>2020-08-05 18:04:35 +0300
committermoisseev <moiseev@mezonplus.ru>2020-08-05 18:04:35 +0300
commitcff0a94678a2da9378ced8b5da09d5a4464f165a (patch)
treede57505579a94730f9d0ff70a71eb0de2fbd020a /src/controller.c
parent1b0ed3b3a44bb9fec28a65e6624be09de78fa530 (diff)
downloadrspamd-cff0a94678a2da9378ced8b5da09d5a4464f165a.tar.gz
rspamd-cff0a94678a2da9378ced8b5da09d5a4464f165a.zip
[Minor] Extend /stat response
Diffstat (limited to 'src/controller.c')
-rw-r--r--src/controller.c8
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 (