File: sizes.c

package info (click to toggle)
memcached 1.6.38-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 6,236 kB
  • sloc: ansic: 62,114; perl: 12,301; sh: 4,546; makefile: 476; python: 402; xml: 59
file content (35 lines) | stat: -rw-r--r-- 1,175 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#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)
            - (MAX_NUMBER_OF_SLAB_CLASSES * 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));
#ifdef EXTSTORE
    display("extstore header", sizeof(item_hdr));
#endif
    display("Libevent thread",
            sizeof(LIBEVENT_THREAD) - sizeof(struct thread_stats));
    display("Connection", sizeof(conn));
    display("Response object", sizeof(mc_resp));
    display("Response bundle", sizeof(mc_resp_bundle));
    display("Response objects per bundle", MAX_RESP_PER_BUNDLE);

    printf("----------------------------------------\n");

    display("libevent thread cumulative", sizeof(LIBEVENT_THREAD));
    display("Thread stats cumulative\t", sizeof(struct thread_stats));

    return 0;
}