~ubuntu-branches/ubuntu/precise/memcached/precise

« back to all changes in this revision

Viewing changes to sizes.c

  • Committer: Bazaar Package Importer
  • Author(s): David Martínez Moreno
  • Date: 2009-10-16 15:09:43 UTC
  • mfrom: (1.3.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20091016150943-l96biwf7siwdt1ci
Tags: upstream-1.4.2
Import upstream version 1.4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
}