diff options
author | Filip Tehlar <ftehlar@cisco.com> | 2023-03-14 08:50:28 +0100 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2023-03-22 19:43:56 +0000 |
commit | ac3c8dcb076245544e61dabb984d057167572276 (patch) | |
tree | 5647af082aa3227a6c428a290ce317e3a505ddc8 /src/vnet/session/session_node.c | |
parent | b53b88a08ef25031708d1e51960713845752c6f2 (diff) |
session: add session stats
Type: feature
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I02d9bb5292b32ffb1b2f05daccd8a7d5dba05125
Diffstat (limited to 'src/vnet/session/session_node.c')
-rw-r--r-- | src/vnet/session/session_node.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c index c61e89bf398..6011704c8d0 100644 --- a/src/vnet/session/session_node.c +++ b/src/vnet/session/session_node.c @@ -139,7 +139,7 @@ session_mq_listen_handler (session_worker_t *wrk, session_evt_elt_t *elt) a->sep_ext.ext_cfg = session_mq_get_ext_config (app, mp->ext_config); if ((rv = vnet_listen (a))) - clib_warning ("listen returned: %U", format_session_error, rv); + session_worker_stat_error_inc (wrk, rv, 1); app_wrk = application_get_worker (app, mp->wrk_index); mq_send_session_bound_cb (app_wrk->wrk_index, mp->context, a->handle, rv); @@ -178,6 +178,7 @@ session_mq_connect_one (session_connect_msg_t *mp) { vnet_connect_args_t _a, *a = &_a; app_worker_t *app_wrk; + session_worker_t *wrk; application_t *app; int rv; @@ -211,7 +212,8 @@ session_mq_connect_one (session_connect_msg_t *mp) if ((rv = vnet_connect (a))) { - clib_warning ("connect returned: %U", format_session_error, rv); + wrk = session_main_get_worker (vlib_get_thread_index ()); + session_worker_stat_error_inc (wrk, rv, 1); app_wrk = application_get_worker (app, mp->wrk_index); mq_send_session_connected_cb (app_wrk->wrk_index, mp->context, 0, rv); } @@ -320,7 +322,7 @@ session_mq_connect_uri_handler (session_worker_t *wrk, session_evt_elt_t *elt) a->app_index = app->app_index; if ((rv = vnet_connect_uri (a))) { - clib_warning ("connect_uri returned: %d", rv); + session_worker_stat_error_inc (wrk, rv, 1); app_wrk = application_get_worker (app, 0 /* default wrk only */ ); mq_send_session_connected_cb (app_wrk->wrk_index, mp->context, 0, rv); } @@ -402,7 +404,7 @@ session_mq_unlisten_handler (session_worker_t *wrk, session_evt_elt_t *elt) a->wrk_map_index = mp->wrk_index; if ((rv = vnet_unlisten (a))) - clib_warning ("unlisten returned: %d", rv); + session_worker_stat_error_inc (wrk, rv, 1); app_wrk = application_get_worker (app, a->wrk_map_index); if (!app_wrk) @@ -601,6 +603,7 @@ session_mq_worker_update_handler (void *data) session_event_t *evt; session_t *s; application_t *app; + int rv; app = application_lookup (mp->client_index); if (!app) @@ -637,7 +640,9 @@ session_mq_worker_update_handler (void *data) return; } - app_worker_own_session (app_wrk, s); + rv = app_worker_own_session (app_wrk, s); + if (rv) + session_stat_error_inc (rv, 1); /* * Send reply |