4 #include <memcached/engine.h>
5 #include <memcached/genhash.h>
8 #define TK_OPS(C) C(get_hits) C(get_misses) C(cmd_set) C(incr_hits) \
9 C(incr_misses) C(decr_hits) C(decr_misses) \
10 C(delete_hits) C(delete_misses) C(evictions) \
11 C(cas_hits) C(cas_badval) C(cas_misses)
13 #define TK_MAX_VAL_LEN 250
16 #define TK(tk, op, key, nkey, ctime) { \
20 pthread_mutex_lock(&tk->mutex); \
21 topkey_item_t *tmp = topkeys_item_get_or_create( \
22 (tk), (key), (nkey), (ctime)); \
24 pthread_mutex_unlock(&tk->mutex); \
36 rel_time_t ctime, atime;
37 #define TK_CUR(name) int name;
45 pthread_mutex_t mutex;
53 topkey_item_t *topkeys_item_get_or_create(
topkeys_t *tk,
const void *key,
size_t nkey,
const rel_time_t ctime);
54 ENGINE_ERROR_CODE topkeys_stats(
topkeys_t *tk,
const void *cookie,
const rel_time_t current_time,
ADD_STAT add_stat);