mdbm_stats.h
Go to the documentation of this file.
1 /* Copyright 2013 Yahoo! Inc. */
2 /* See LICENSE in the root of the distribution for licensing details. */
3 
4 #ifndef __MDBM3_STATS_H_
5 #define __MDBM3_STATS_H_
6 
7 #include <stdint.h>
8 
9 #include <mdbm.h>
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 #define MDBM_RSTATS_VERSION 0x53090004
16 #define MDBM_RSTATS_THIST_MAX (6*9+2)
17 
19  uint64_t num;
20  uint64_t num_error;
21  uint64_t sum_usec;
22  uint64_t num_lock_wait;
24 
26 };
28 
29 struct mdbm_rstats {
30  uint32_t version;
31  uint16_t flags;
32  uint16_t reserved0;
33 
34  uint32_t lock;
35  uint32_t reserved1;
36 
41 
46 };
47 typedef struct mdbm_rstats mdbm_rstats_t;
48 
49 #define MDBM_RSTATS_THIST 0x01
50 
51 struct mdbm_rstats_mem;
52 
53 int mdbm_reset_rstats (struct mdbm_rstats* rs);
54 int mdbm_init_rstats (MDBM* db, int flags);
55 int mdbm_open_rstats (const char* dbfilename, int flags,
56  struct mdbm_rstats_mem** mem, struct mdbm_rstats** rstats);
57 int mdbm_close_rstats (struct mdbm_rstats_mem* mem);
58 
59 void mdbm_diff_rstats (mdbm_rstats_t* base, mdbm_rstats_t* sample, mdbm_rstats_t* diff,
60  mdbm_rstats_t* new_base);
61 
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif /* __MDBM3_STATS_H_ */