summaryrefslogtreecommitdiffstats
path: root/lib/hash.h
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-05-30 02:16:52 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-07-02 01:18:06 +0200
commit4db0cff16a1b16671384102f1876bebb7f481d89 (patch)
treed5d003e63905b0f647cbc798f25fbf7255199f96 /lib/hash.h
parentMerge pull request #771 from qlyoung/printf-madness (diff)
downloadfrr-4db0cff16a1b16671384102f1876bebb7f481d89.tar.xz
frr-4db0cff16a1b16671384102f1876bebb7f481d89.zip
lib: add statistics for hash tables
Adds a function that calculates various statistics on our implementation of a hash table. These are useful for evaluating performance. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/hash.h')
-rw-r--r--lib/hash.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/hash.h b/lib/hash.h
index bafb35a2a..15afc249a 100644
--- a/lib/hash.h
+++ b/lib/hash.h
@@ -64,6 +64,9 @@ struct hash
/* Backet alloc. */
unsigned long count;
+
+ /* hash name */
+ const char *name;
};
extern struct hash *hash_create (unsigned int (*) (void *),
@@ -87,4 +90,9 @@ extern void hash_free (struct hash *);
extern unsigned int string_hash_make (const char *);
+extern void hash_stats (struct hash *, double *, double *, int *, int *, int *, double *);
+extern void hash_cmd_init (void);
+extern void hash_register (struct hash *, const char *);
+extern void hash_unregister (struct hash *);
+
#endif /* _ZEBRA_HASH_H */