3 * Author: Mingqiang Zhuang
5 * Created on February 10, 2009
7 * (c) Copyright 2009, Schooner Information Technology, Inc.
8 * http://www.schoonerinfotech.com/
24 #include "../config.h"
32 /* command line option */
39 OPT_EXECUTE_NUMBER
= 'x',
40 OPT_THREAD_NUMBER
= 'T',
44 OPT_GETS_DIVISION
= 'd',
52 OPT_FACEBOOK_TEST
= 'a',
53 OPT_SOCK_PER_CONN
= 'n',
54 OPT_BINARY_PROTOCOL
= 'B',
57 OPT_REP_WRITE_SRV
= 'p',
60 /* global statistic of response time */
61 typedef struct statistic
63 pthread_mutex_t stat_mutex
; /* synchronize the following members */
65 ms_stat_t get_stat
; /* statistics of get command */
66 ms_stat_t set_stat
; /* statistics of set command */
67 ms_stat_t total_stat
; /* statistics of both get and set commands */
70 /* global status statistic structure */
73 int32_t active_conns
; /* active connections */
74 uint64_t bytes_read
; /* read bytes */
75 uint64_t bytes_written
; /* written bytes */
76 uint64_t obj_bytes
; /* object bytes */
77 uint64_t pre_cmd_get
; /* previous total get command count */
78 uint64_t pre_cmd_set
; /* previous total set command count */
79 uint64_t cmd_get
; /* current total get command count */
80 uint64_t cmd_set
; /* current total set command count */
81 uint64_t get_misses
; /* total objects of get miss */
82 uint64_t vef_miss
; /* total objects of verification miss */
83 uint64_t vef_failed
; /* total objects of verification failed */
84 uint64_t unexp_unget
; /* total objects which is unexpired but not get */
85 uint64_t exp_get
; /* total objects which is expired but get */
86 uint64_t pkt_disorder
; /* disorder packages of UDP */
87 uint64_t pkt_drop
; /* packages dropped of UDP */
88 uint64_t udp_timeout
; /* how many times timeout of UDP happens */
92 typedef struct sync_lock
99 /* global variable structure */
100 typedef struct global
102 /* synchronize lock */
103 ms_sync_lock_t init_lock
;
104 ms_sync_lock_t run_lock
;
106 /* mutex for outputing error log synchronously when memslap crashes */
107 pthread_mutex_t quit_mutex
;
109 /* mutex for generating key prefix */
110 pthread_mutex_t seq_mutex
;
112 /* global synchronous flags for slap mode */
117 /* global structure */
118 ms_global_t ms_global
;
120 /* global stats information structure */
123 /* global statistic structure */
124 ms_statistic_t ms_statistic
;
130 #endif /* end of MS_MEMSLAP_H */