summaryrefslogtreecommitdiff
path: root/src/cache.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2008-12-22 12:45:58 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2008-12-22 12:45:58 +0100
commitf90efb777e087ed2c24af080cb033a256969e766 (patch)
tree57ca836f33159b79d445791c3c035c978f907e6c /src/cache.c
parentc7243650c18ec4317a0897e9b406193854955201 (diff)
downloadconntrack-tools-f90efb777e087ed2c24af080cb033a256969e766.tar.gz
conntrack-tools-f90efb777e087ed2c24af080cb033a256969e766.zip
cache_iterators: add total entries available in the cache to stats
This patch adds the total number of entries currently living in the cache. Currently, we have two type of entries, active and inactive. The inactive ones talk about an ended connection. This is useful for trouble-shooting if we hit enospc when adding new entries. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cache.c b/src/cache.c
index 5e7d738..6106d28 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -455,7 +455,7 @@ void cache_stats_extended(const struct cache *c, int fd)
int size;
size = snprintf(buf, sizeof(buf),
- "cache:%s\tactive connections:\t%12u\n"
+ "cache:%s\tactive/total entries:\t%12u/%12u\n"
"\tcreation OK:\t\t\t%12u\n"
"\tcreation failed:\t\t%12u\n"
"\t\tno memory available:\t%12u\n"
@@ -467,7 +467,7 @@ void cache_stats_extended(const struct cache *c, int fd)
"\tdeletion failed:\t\t%12u\n"
"\t\tentry not found:\t%12u\n",
c->name,
- c->stats.active,
+ c->stats.active, hashtable_counter(c->h),
c->stats.add_ok,
c->stats.add_fail,
c->stats.add_fail_enomem,