summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat_inlines.h
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2018-12-18 01:08:51 -0800
committerOle Trøan <otroan@employees.org>2018-12-20 15:12:11 +0000
commitfd0d50879f475a1b15cedb4ab49059a02c45ccfd (patch)
treecbb86dfe652ec5401492298335c9750cfad482b3 /src/plugins/nat/nat_inlines.h
parent775f73c6baaf9bc2283e7ab9752c81984823be99 (diff)
NAT: total users and sessions gauges (VPP-1484)
Change-Id: I41a82e21571d5c64d01af72cd88c3983afac26ed Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat_inlines.h')
-rw-r--r--src/plugins/nat/nat_inlines.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/nat/nat_inlines.h b/src/plugins/nat/nat_inlines.h
index 38cfc379245..db5063c412b 100644
--- a/src/plugins/nat/nat_inlines.h
+++ b/src/plugins/nat/nat_inlines.h
@@ -159,6 +159,8 @@ nat44_delete_user_with_no_session (snat_main_t * sm, snat_user_t * u,
pool_put_index (tsm->list_pool, u->sessions_per_user_list_head_index);
pool_put (tsm->users, u);
clib_bihash_add_del_8_8 (&tsm->user_hash, &kv, 0);
+ vlib_set_simple_counter (&sm->total_users, thread_index, 0,
+ pool_elts (tsm->users));
}
}
@@ -177,6 +179,8 @@ nat44_delete_session (snat_main_t * sm, snat_session_t * ses,
clib_dlist_remove (tsm->list_pool, ses->per_user_index);
pool_put_index (tsm->list_pool, ses->per_user_index);
pool_put (tsm->sessions, ses);
+ vlib_set_simple_counter (&sm->total_sessions, thread_index, 0,
+ pool_elts (tsm->sessions));
u_key.addr = ses->in2out.addr;
u_key.fib_index = ses->in2out.fib_index;