From 8f9bf100e1a2438685a148714b4aef8bbd5aa3a3 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Tue, 12 Jun 2018 13:18:51 +0300 Subject: [PATCH] MXS-1918 Remove HASHTABLE from dcb.cc --- include/maxscale/dcb.h | 1 - server/core/dcb.cc | 32 -------------------------------- 2 files changed, 33 deletions(-) diff --git a/include/maxscale/dcb.h b/include/maxscale/dcb.h index 39e4a98bf..12e1bd031 100644 --- a/include/maxscale/dcb.h +++ b/include/maxscale/dcb.h @@ -245,7 +245,6 @@ void dListDCBs(DCB *); /* List all DCBs in the system */ void dListClients(DCB *); /* List al the client DCBs */ const char *gw_dcb_state2string(dcb_state_t); /* DCB state to string */ void dcb_printf(DCB *, const char *, ...) __attribute__((format(printf, 2, 3))); /* DCB version of printf */ -void dcb_hashtable_stats(DCB *, void *); /**< Print statisitics */ int dcb_add_callback(DCB *, DCB_REASON, int (*)(struct dcb *, DCB_REASON, void *), void *); int dcb_remove_callback(DCB *, DCB_REASON, int (*)(struct dcb *, DCB_REASON, void *), void *); int dcb_count_by_usage(DCB_USAGE); /* Return counts of DCBs */ diff --git a/server/core/dcb.cc b/server/core/dcb.cc index 26088c882..2a55779e4 100644 --- a/server/core/dcb.cc +++ b/server/core/dcb.cc @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -1740,37 +1739,6 @@ dcb_printf(DCB *dcb, const char *fmt, ...) dcb->func.write(dcb, buf); } -/** - * Print hash table statistics to a DCB - * - * @param dcb The DCB to send the information to - * @param table The hash table - */ -void dcb_hashtable_stats( - DCB *dcb, - void *table) -{ - int total; - int longest; - int hashsize; - - total = 0; - longest = 0; - - hashtable_get_stats(table, &hashsize, &total, &longest); - - dcb_printf(dcb, - "Hashtable: %p, size %d\n", - table, - hashsize); - - dcb_printf(dcb, "\tNo. of entries: %d\n", total); - dcb_printf(dcb, - "\tAverage chain length: %.1f\n", - (hashsize == 0 ? (float)hashsize : (float)total / hashsize)); - dcb_printf(dcb, "\tLongest chain length: %d\n", longest); -} - /** * Write data to a DCB socket through an SSL structure. The SSL structure is * linked from the DCB. All communication is encrypted and done via the SSL