From 44ec7ca57dd9241e178d65001105b7d100a7dd50 Mon Sep 17 00:00:00 2001 From: Dustin Sallings Date: Tue, 10 Mar 2009 08:35:34 -0700 Subject: Created a tool to show us the sizes of various data structures. --- sizes.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 sizes.c (limited to 'sizes.c') diff --git a/sizes.c b/sizes.c new file mode 100644 index 0000000..95a644c --- /dev/null +++ b/sizes.c @@ -0,0 +1,29 @@ +#include + +#include "memcached.h" + +static void display(const char *name, size_t size) { + printf("%s\t%d\n", name, (int)size); +} + +int main(int argc, char **argv) { + + display("Slab Stats", sizeof(struct slab_stats)); + display("Thread stats", + sizeof(struct thread_stats) + - (200 * sizeof(struct slab_stats))); + display("Global stats", sizeof(struct stats)); + display("Settings", sizeof(struct settings)); + display("Item (no cas)", sizeof(item)); + display("Item (cas)", sizeof(item) + sizeof(uint64_t)); + display("Libevent thread", + sizeof(LIBEVENT_THREAD) - sizeof(struct thread_stats)); + display("Connection", sizeof(conn)); + + printf("----------------------------------------\n"); + + display("libevent thread cumulative", sizeof(LIBEVENT_THREAD)); + display("Thread stats cumulative\t", sizeof(struct thread_stats)); + + return 0; +} -- cgit v1.2.1