File tree 3 files changed +33
-2
lines changed
3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -32,3 +32,4 @@ memcached_dtrace.h
32
32
memcached- * .tar.gz
33
33
doc /protocol-binary-range.txt
34
34
doc /protocol-binary.txt
35
+ /sizes
Original file line number Diff line number Diff line change 1
- bin_PROGRAMS = memcached memcached-debug
1
+ bin_PROGRAMS = memcached memcached-debug sizes
2
2
pkginclude_HEADERS = protocol_binary.h
3
3
4
4
BUILT_SOURCES =
@@ -58,7 +58,8 @@ EXTRA_DIST = doc scripts TODO t memcached.spec memcached_dtrace.d
58
58
59
59
MOSTLYCLEANFILES = *.gcov *.gcno *.gcda *.tcov
60
60
61
- test : memcached-debug
61
+ test : memcached-debug sizes
62
+ $(srcdir ) /sizes
62
63
prove $(srcdir ) /t
63
64
@if test ` basename $( PROFILER) ` = " gcov" ; then \
64
65
for file in memcached_debug-* .gc?? ; do \
Original file line number Diff line number Diff line change
1
+ #include <stdio.h>
2
+
3
+ #include "memcached.h"
4
+
5
+ static void display (const char * name , size_t size ) {
6
+ printf ("%s\t%d\n" , name , (int )size );
7
+ }
8
+
9
+ int main (int argc , char * * argv ) {
10
+
11
+ display ("Slab Stats" , sizeof (struct slab_stats ));
12
+ display ("Thread stats" ,
13
+ sizeof (struct thread_stats )
14
+ - (200 * sizeof (struct slab_stats )));
15
+ display ("Global stats" , sizeof (struct stats ));
16
+ display ("Settings" , sizeof (struct settings ));
17
+ display ("Item (no cas)" , sizeof (item ));
18
+ display ("Item (cas)" , sizeof (item ) + sizeof (uint64_t ));
19
+ display ("Libevent thread" ,
20
+ sizeof (LIBEVENT_THREAD ) - sizeof (struct thread_stats ));
21
+ display ("Connection" , sizeof (conn ));
22
+
23
+ printf ("----------------------------------------\n" );
24
+
25
+ display ("libevent thread cumulative" , sizeof (LIBEVENT_THREAD ));
26
+ display ("Thread stats cumulative\t" , sizeof (struct thread_stats ));
27
+
28
+ return 0 ;
29
+ }
You can’t perform that action at this time.
0 commit comments