forked from memcached/memcached
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created a tool to show us the sizes of various data structures.
- Loading branch information
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,4 @@ memcached_dtrace.h | |
memcached-*.tar.gz | ||
doc/protocol-binary-range.txt | ||
doc/protocol-binary.txt | ||
/sizes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |