diff options
author | Dustin Sallings <dustin@spy.net> | 2009-03-10 08:35:34 -0700 |
---|---|---|
committer | Dustin Sallings <dustin@spy.net> | 2009-03-10 12:59:07 -0700 |
commit | 44ec7ca57dd9241e178d65001105b7d100a7dd50 (patch) | |
tree | a5af9a50aae378db9344977265c1efd145df86aa /sizes.c | |
parent | a45621053bc744a1cfc4b2c3732e26b8046a9044 (diff) | |
download | memcached-44ec7ca57dd9241e178d65001105b7d100a7dd50.tar.gz |
Created a tool to show us the sizes of various data structures.
Diffstat (limited to 'sizes.c')
-rw-r--r-- | sizes.c | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -0,0 +1,29 @@ +#include <stdio.h> + +#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; +} |