diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-05-30 00:16:52 +0000 | 
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-07-01 19:18:06 -0400 | 
| commit | 4db0cff16a1b16671384102f1876bebb7f481d89 (patch) | |
| tree | d5d003e63905b0f647cbc798f25fbf7255199f96 /lib/hash.h | |
| parent | 8186327f3d2a5028b55eab9a04c31b5ccd68afd1 (diff) | |
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.h | 8 | 
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/hash.h b/lib/hash.h index bafb35a2a3..15afc249ab 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 */  | 
