Commit d20bc095 authored by Yoni Fogel's avatar Yoni Fogel

refs #6286 Add infrastructure to use column names for info schema

git-svn-id: file:///svn/toku/tokudb@54506 c7de825b-a66e-492c-adef-691d508d4ae1
parent a6fda96b
...@@ -643,6 +643,7 @@ int main (int argc, char *const argv[] __attribute__((__unused__))) { ...@@ -643,6 +643,7 @@ int main (int argc, char *const argv[] __attribute__((__unused__))) {
printf("typedef struct __toku_engine_status_row {\n"); printf("typedef struct __toku_engine_status_row {\n");
printf(" const char * keyname; // info schema key, should not change across revisions without good reason \n"); printf(" const char * keyname; // info schema key, should not change across revisions without good reason \n");
printf(" const char * columnname; // column for mysql, e.g. information_schema.global_status. TOKUDB_ will automatically be prefixed.\n");
printf(" const char * legend; // the text that will appear at user interface \n"); printf(" const char * legend; // the text that will appear at user interface \n");
printf(" toku_engine_status_display_type type; // how to interpret the value \n"); printf(" toku_engine_status_display_type type; // how to interpret the value \n");
printf(" toku_engine_status_include_type include; // which kinds of callers should get read this row?\n"); printf(" toku_engine_status_include_type include; // which kinds of callers should get read this row?\n");
......
...@@ -40,27 +40,27 @@ static CACHETABLE_STATUS_S ct_status; ...@@ -40,27 +40,27 @@ static CACHETABLE_STATUS_S ct_status;
// Note, toku_cachetable_get_status() is below, after declaration of cachetable. // Note, toku_cachetable_get_status() is below, after declaration of cachetable.
#define STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(ct_status, k, t, "cachetable: " l, inc) #define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(ct_status, k, c, t, "cachetable: " l, inc)
static void static void
status_init(void) { status_init(void) {
// Note, this function initializes the keyname, type, and legend fields. // Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler. // Value fields are initialized to zero by compiler.
STATUS_INIT(CT_MISS, UINT64, "miss", TOKU_ENGINE_STATUS); STATUS_INIT(CT_MISS, nullptr, UINT64, "miss", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_MISSTIME, UINT64, "miss time", TOKU_ENGINE_STATUS); STATUS_INIT(CT_MISSTIME, nullptr, UINT64, "miss time", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_PREFETCHES, UINT64, "prefetches", TOKU_ENGINE_STATUS); STATUS_INIT(CT_PREFETCHES, nullptr, UINT64, "prefetches", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_SIZE_CURRENT, UINT64, "size current", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS); STATUS_INIT(CT_SIZE_CURRENT, nullptr, UINT64, "size current", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS);
STATUS_INIT(CT_SIZE_LIMIT, UINT64, "size limit", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS); STATUS_INIT(CT_SIZE_LIMIT, nullptr, UINT64, "size limit", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS);
STATUS_INIT(CT_SIZE_WRITING, UINT64, "size writing", TOKU_ENGINE_STATUS); STATUS_INIT(CT_SIZE_WRITING, nullptr, UINT64, "size writing", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_SIZE_NONLEAF, UINT64, "size nonleaf", TOKU_ENGINE_STATUS); STATUS_INIT(CT_SIZE_NONLEAF, nullptr, UINT64, "size nonleaf", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_SIZE_LEAF, UINT64, "size leaf", TOKU_ENGINE_STATUS); STATUS_INIT(CT_SIZE_LEAF, nullptr, UINT64, "size leaf", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_SIZE_ROLLBACK, UINT64, "size rollback", TOKU_ENGINE_STATUS); STATUS_INIT(CT_SIZE_ROLLBACK, nullptr, UINT64, "size rollback", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_SIZE_CACHEPRESSURE, UINT64, "size cachepressure", TOKU_ENGINE_STATUS); STATUS_INIT(CT_SIZE_CACHEPRESSURE, nullptr, UINT64, "size cachepressure", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_EVICTIONS, UINT64, "evictions", TOKU_ENGINE_STATUS); STATUS_INIT(CT_EVICTIONS, nullptr, UINT64, "evictions", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_CLEANER_EXECUTIONS, UINT64, "cleaner executions", TOKU_ENGINE_STATUS); STATUS_INIT(CT_CLEANER_EXECUTIONS, nullptr, UINT64, "cleaner executions", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_CLEANER_PERIOD, UINT64, "cleaner period", TOKU_ENGINE_STATUS); STATUS_INIT(CT_CLEANER_PERIOD, nullptr, UINT64, "cleaner period", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_CLEANER_ITERATIONS, UINT64, "cleaner iterations", TOKU_ENGINE_STATUS); STATUS_INIT(CT_CLEANER_ITERATIONS, nullptr, UINT64, "cleaner iterations", TOKU_ENGINE_STATUS);
ct_status.initialized = true; ct_status.initialized = true;
} }
#undef STATUS_INIT #undef STATUS_INIT
......
...@@ -60,25 +60,25 @@ ...@@ -60,25 +60,25 @@
static CHECKPOINT_STATUS_S cp_status; static CHECKPOINT_STATUS_S cp_status;
#define STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(cp_status, k, t, "checkpoint: " l, inc) #define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(cp_status, k, c, t, "checkpoint: " l, inc)
static void static void
status_init(void) { status_init(void) {
// Note, this function initializes the keyname, type, and legend fields. // Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler. // Value fields are initialized to zero by compiler.
STATUS_INIT(CP_PERIOD, UINT64, "period", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS); STATUS_INIT(CP_PERIOD, nullptr, UINT64, "period", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS);
STATUS_INIT(CP_FOOTPRINT, UINT64, "footprint", TOKU_ENGINE_STATUS); STATUS_INIT(CP_FOOTPRINT, nullptr, UINT64, "footprint", TOKU_ENGINE_STATUS);
STATUS_INIT(CP_TIME_LAST_CHECKPOINT_BEGIN, UNIXTIME, "last checkpoint began ", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS); STATUS_INIT(CP_TIME_LAST_CHECKPOINT_BEGIN, nullptr, UNIXTIME, "last checkpoint began ", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS);
STATUS_INIT(CP_TIME_LAST_CHECKPOINT_BEGIN_COMPLETE, UNIXTIME, "last complete checkpoint began ", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS); STATUS_INIT(CP_TIME_LAST_CHECKPOINT_BEGIN_COMPLETE, nullptr, UNIXTIME, "last complete checkpoint began ", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS);
STATUS_INIT(CP_TIME_LAST_CHECKPOINT_END, UNIXTIME, "last complete checkpoint ended", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS); STATUS_INIT(CP_TIME_LAST_CHECKPOINT_END, nullptr, UNIXTIME, "last complete checkpoint ended", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS);
STATUS_INIT(CP_LAST_LSN, UINT64, "last complete checkpoint LSN", TOKU_ENGINE_STATUS); STATUS_INIT(CP_LAST_LSN, nullptr, UINT64, "last complete checkpoint LSN", TOKU_ENGINE_STATUS);
STATUS_INIT(CP_CHECKPOINT_COUNT, UINT64, "checkpoints taken ", TOKU_ENGINE_STATUS); STATUS_INIT(CP_CHECKPOINT_COUNT, nullptr, UINT64, "checkpoints taken ", TOKU_ENGINE_STATUS);
STATUS_INIT(CP_CHECKPOINT_COUNT_FAIL, UINT64, "checkpoints failed", TOKU_ENGINE_STATUS); STATUS_INIT(CP_CHECKPOINT_COUNT_FAIL, nullptr, UINT64, "checkpoints failed", TOKU_ENGINE_STATUS);
STATUS_INIT(CP_WAITERS_NOW, UINT64, "waiters now", TOKU_ENGINE_STATUS); STATUS_INIT(CP_WAITERS_NOW, nullptr, UINT64, "waiters now", TOKU_ENGINE_STATUS);
STATUS_INIT(CP_WAITERS_MAX, UINT64, "waiters max", TOKU_ENGINE_STATUS); STATUS_INIT(CP_WAITERS_MAX, nullptr, UINT64, "waiters max", TOKU_ENGINE_STATUS);
STATUS_INIT(CP_CLIENT_WAIT_ON_MO, UINT64, "non-checkpoint client wait on mo lock", TOKU_ENGINE_STATUS); STATUS_INIT(CP_CLIENT_WAIT_ON_MO, nullptr, UINT64, "non-checkpoint client wait on mo lock", TOKU_ENGINE_STATUS);
STATUS_INIT(CP_CLIENT_WAIT_ON_CS, UINT64, "non-checkpoint client wait on cs lock", TOKU_ENGINE_STATUS); STATUS_INIT(CP_CLIENT_WAIT_ON_CS, nullptr, UINT64, "non-checkpoint client wait on cs lock", TOKU_ENGINE_STATUS);
cp_status.initialized = true; cp_status.initialized = true;
} }
#undef STATUS_INIT #undef STATUS_INIT
......
...@@ -18,42 +18,42 @@ ...@@ -18,42 +18,42 @@
*/ */
static FT_FLUSHER_STATUS_S ft_flusher_status; static FT_FLUSHER_STATUS_S ft_flusher_status;
#define STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(ft_flusher_status, k, t, "brt flusher: " l, inc) #define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(ft_flusher_status, k, c, t, "brt flusher: " l, inc)
#define STATUS_VALUE(x) ft_flusher_status.status[x].value.num #define STATUS_VALUE(x) ft_flusher_status.status[x].value.num
void toku_ft_flusher_status_init(void) { void toku_ft_flusher_status_init(void) {
// Note, this function initializes the keyname, type, and legend fields. // Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler. // Value fields are initialized to zero by compiler.
STATUS_INIT(FT_FLUSHER_CLEANER_TOTAL_NODES, UINT64, "total nodes potentially flushed by cleaner thread", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_CLEANER_TOTAL_NODES, nullptr, UINT64, "total nodes potentially flushed by cleaner thread", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_CLEANER_H1_NODES, UINT64, "height-one nodes flushed by cleaner thread", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_CLEANER_H1_NODES, nullptr, UINT64, "height-one nodes flushed by cleaner thread", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_CLEANER_HGT1_NODES, UINT64, "height-greater-than-one nodes flushed by cleaner thread", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_CLEANER_HGT1_NODES, nullptr, UINT64, "height-greater-than-one nodes flushed by cleaner thread", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_CLEANER_EMPTY_NODES, UINT64, "nodes cleaned which had empty buffers", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_CLEANER_EMPTY_NODES, nullptr, UINT64, "nodes cleaned which had empty buffers", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_CLEANER_NODES_DIRTIED, UINT64, "nodes dirtied by cleaner thread", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_CLEANER_NODES_DIRTIED, nullptr, UINT64, "nodes dirtied by cleaner thread", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_CLEANER_MAX_BUFFER_SIZE, UINT64, "max bytes in a buffer flushed by cleaner thread", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_CLEANER_MAX_BUFFER_SIZE, nullptr, UINT64, "max bytes in a buffer flushed by cleaner thread", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_CLEANER_MIN_BUFFER_SIZE, UINT64, "min bytes in a buffer flushed by cleaner thread", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_CLEANER_MIN_BUFFER_SIZE, nullptr, UINT64, "min bytes in a buffer flushed by cleaner thread", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_CLEANER_TOTAL_BUFFER_SIZE, UINT64, "total bytes in buffers flushed by cleaner thread", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_CLEANER_TOTAL_BUFFER_SIZE, nullptr, UINT64, "total bytes in buffers flushed by cleaner thread", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_CLEANER_MAX_BUFFER_WORKDONE, UINT64, "max workdone in a buffer flushed by cleaner thread", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_CLEANER_MAX_BUFFER_WORKDONE, nullptr, UINT64, "max workdone in a buffer flushed by cleaner thread", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_CLEANER_MIN_BUFFER_WORKDONE, UINT64, "min workdone in a buffer flushed by cleaner thread", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_CLEANER_MIN_BUFFER_WORKDONE, nullptr, UINT64, "min workdone in a buffer flushed by cleaner thread", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_CLEANER_TOTAL_BUFFER_WORKDONE, UINT64, "total workdone in buffers flushed by cleaner thread", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_CLEANER_TOTAL_BUFFER_WORKDONE, nullptr, UINT64, "total workdone in buffers flushed by cleaner thread", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_CLEANER_NUM_LEAF_MERGES_STARTED, UINT64, "times cleaner thread tries to merge a leaf", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_CLEANER_NUM_LEAF_MERGES_STARTED, nullptr, UINT64, "times cleaner thread tries to merge a leaf", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_CLEANER_NUM_LEAF_MERGES_RUNNING, UINT64, "cleaner thread leaf merges in progress", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_CLEANER_NUM_LEAF_MERGES_RUNNING, nullptr, UINT64, "cleaner thread leaf merges in progress", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_CLEANER_NUM_LEAF_MERGES_COMPLETED, UINT64, "cleaner thread leaf merges successful", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_CLEANER_NUM_LEAF_MERGES_COMPLETED, nullptr, UINT64, "cleaner thread leaf merges successful", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_CLEANER_NUM_DIRTIED_FOR_LEAF_MERGE, UINT64, "nodes dirtied by cleaner thread leaf merges", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_CLEANER_NUM_DIRTIED_FOR_LEAF_MERGE, nullptr, UINT64, "nodes dirtied by cleaner thread leaf merges", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_FLUSH_TOTAL, UINT64, "total number of flushes done by flusher threads or cleaner threads", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_FLUSH_TOTAL, nullptr, UINT64, "total number of flushes done by flusher threads or cleaner threads", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_FLUSH_IN_MEMORY, UINT64, "number of in memory flushes", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_FLUSH_IN_MEMORY, nullptr, UINT64, "number of in memory flushes", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_FLUSH_NEEDED_IO, UINT64, "number of flushes that read something off disk", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_FLUSH_NEEDED_IO, nullptr, UINT64, "number of flushes that read something off disk", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_FLUSH_CASCADES, UINT64, "number of flushes that triggered another flush in child", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_FLUSH_CASCADES, nullptr, UINT64, "number of flushes that triggered another flush in child", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_FLUSH_CASCADES_1, UINT64, "number of flushes that triggered 1 cascading flush", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_FLUSH_CASCADES_1, nullptr, UINT64, "number of flushes that triggered 1 cascading flush", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_FLUSH_CASCADES_2, UINT64, "number of flushes that triggered 2 cascading flushes", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_FLUSH_CASCADES_2, nullptr, UINT64, "number of flushes that triggered 2 cascading flushes", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_FLUSH_CASCADES_3, UINT64, "number of flushes that triggered 3 cascading flushes", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_FLUSH_CASCADES_3, nullptr, UINT64, "number of flushes that triggered 3 cascading flushes", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_FLUSH_CASCADES_4, UINT64, "number of flushes that triggered 4 cascading flushes", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_FLUSH_CASCADES_4, nullptr, UINT64, "number of flushes that triggered 4 cascading flushes", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_FLUSH_CASCADES_5, UINT64, "number of flushes that triggered 5 cascading flushes", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_FLUSH_CASCADES_5, nullptr, UINT64, "number of flushes that triggered 5 cascading flushes", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_FLUSH_CASCADES_GT_5, UINT64, "number of flushes that triggered over 5 cascading flushes", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_FLUSH_CASCADES_GT_5, nullptr, UINT64, "number of flushes that triggered over 5 cascading flushes", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_SPLIT_LEAF, UINT64, "leaf node splits", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_SPLIT_LEAF, nullptr, UINT64, "leaf node splits", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_SPLIT_NONLEAF, UINT64, "nonleaf node splits", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_SPLIT_NONLEAF, nullptr, UINT64, "nonleaf node splits", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_MERGE_LEAF, UINT64, "leaf node merges", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_MERGE_LEAF, nullptr, UINT64, "leaf node merges", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_MERGE_NONLEAF, UINT64, "nonleaf node merges", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_MERGE_NONLEAF, nullptr, UINT64, "nonleaf node merges", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_BALANCE_LEAF, UINT64, "leaf node balances", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FLUSHER_BALANCE_LEAF, nullptr, UINT64, "leaf node balances", TOKU_ENGINE_STATUS);
STATUS_VALUE(FT_FLUSHER_CLEANER_MIN_BUFFER_SIZE) = UINT64_MAX; STATUS_VALUE(FT_FLUSHER_CLEANER_MIN_BUFFER_SIZE) = UINT64_MAX;
STATUS_VALUE(FT_FLUSHER_CLEANER_MIN_BUFFER_WORKDONE) = UINT64_MAX; STATUS_VALUE(FT_FLUSHER_CLEANER_MIN_BUFFER_WORKDONE) = UINT64_MAX;
......
...@@ -33,17 +33,17 @@ struct hot_flusher_extra { ...@@ -33,17 +33,17 @@ struct hot_flusher_extra {
static FT_HOT_STATUS_S hot_status; static FT_HOT_STATUS_S hot_status;
#define STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(hot_status, k, t, "hot: " l, inc) #define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(hot_status, k, c, t, "hot: " l, inc)
#define STATUS_VALUE(x) hot_status.status[x].value.num #define STATUS_VALUE(x) hot_status.status[x].value.num
void void
toku_ft_hot_status_init(void) toku_ft_hot_status_init(void)
{ {
STATUS_INIT(FT_HOT_NUM_STARTED, UINT64, "operations ever started", TOKU_ENGINE_STATUS); STATUS_INIT(FT_HOT_NUM_STARTED, nullptr, UINT64, "operations ever started", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_HOT_NUM_COMPLETED, UINT64, "operations successfully completed", TOKU_ENGINE_STATUS); STATUS_INIT(FT_HOT_NUM_COMPLETED, nullptr, UINT64, "operations successfully completed", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_HOT_NUM_ABORTED, UINT64, "operations aborted", TOKU_ENGINE_STATUS); STATUS_INIT(FT_HOT_NUM_ABORTED, nullptr, UINT64, "operations aborted", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_HOT_MAX_ROOT_FLUSH_COUNT, UINT64, "max number of flushes from root ever required to optimize a tree", TOKU_ENGINE_STATUS); STATUS_INIT(FT_HOT_MAX_ROOT_FLUSH_COUNT, nullptr, UINT64, "max number of flushes from root ever required to optimize a tree", TOKU_ENGINE_STATUS);
hot_status.initialized = true; hot_status.initialized = true;
} }
......
...@@ -146,7 +146,7 @@ static const uint32_t this_version = FT_LAYOUT_VERSION; ...@@ -146,7 +146,7 @@ static const uint32_t this_version = FT_LAYOUT_VERSION;
*/ */
static FT_STATUS_S ft_status; static FT_STATUS_S ft_status;
#define STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(ft_status, k, t, "brt: " l, inc) #define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(ft_status, k, c, t, "brt: " l, inc)
static toku_mutex_t ft_open_close_lock; static toku_mutex_t ft_open_close_lock;
...@@ -155,126 +155,126 @@ status_init(void) ...@@ -155,126 +155,126 @@ status_init(void)
{ {
// Note, this function initializes the keyname, type, and legend fields. // Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler. // Value fields are initialized to zero by compiler.
STATUS_INIT(FT_UPDATES, PARCOUNT, "dictionary updates", TOKU_ENGINE_STATUS); STATUS_INIT(FT_UPDATES, nullptr, PARCOUNT, "dictionary updates", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_UPDATES_BROADCAST, PARCOUNT, "dictionary broadcast updates", TOKU_ENGINE_STATUS); STATUS_INIT(FT_UPDATES_BROADCAST, nullptr, PARCOUNT, "dictionary broadcast updates", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_DESCRIPTOR_SET, PARCOUNT, "descriptor set", TOKU_ENGINE_STATUS); STATUS_INIT(FT_DESCRIPTOR_SET, nullptr, PARCOUNT, "descriptor set", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_MSN_DISCARDS, PARCOUNT, "messages ignored by leaf due to msn", TOKU_ENGINE_STATUS); STATUS_INIT(FT_MSN_DISCARDS, nullptr, PARCOUNT, "messages ignored by leaf due to msn", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_TOTAL_RETRIES, PARCOUNT, "total search retries due to TRY_AGAIN", TOKU_ENGINE_STATUS); STATUS_INIT(FT_TOTAL_RETRIES, nullptr, PARCOUNT, "total search retries due to TRY_AGAIN", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_SEARCH_TRIES_GT_HEIGHT, PARCOUNT, "searches requiring more tries than the height of the tree", TOKU_ENGINE_STATUS); STATUS_INIT(FT_SEARCH_TRIES_GT_HEIGHT, nullptr, PARCOUNT, "searches requiring more tries than the height of the tree", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_SEARCH_TRIES_GT_HEIGHTPLUS3, PARCOUNT, "searches requiring more tries than the height of the tree plus three", TOKU_ENGINE_STATUS); STATUS_INIT(FT_SEARCH_TRIES_GT_HEIGHTPLUS3, nullptr, PARCOUNT, "searches requiring more tries than the height of the tree plus three", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_CREATE_LEAF, PARCOUNT, "leaf nodes created", TOKU_ENGINE_STATUS); STATUS_INIT(FT_CREATE_LEAF, nullptr, PARCOUNT, "leaf nodes created", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_CREATE_NONLEAF, PARCOUNT, "nonleaf nodes created", TOKU_ENGINE_STATUS); STATUS_INIT(FT_CREATE_NONLEAF, nullptr, PARCOUNT, "nonleaf nodes created", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_DESTROY_LEAF, PARCOUNT, "leaf nodes destroyed", TOKU_ENGINE_STATUS); STATUS_INIT(FT_DESTROY_LEAF, nullptr, PARCOUNT, "leaf nodes destroyed", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_DESTROY_NONLEAF, PARCOUNT, "nonleaf nodes destroyed", TOKU_ENGINE_STATUS); STATUS_INIT(FT_DESTROY_NONLEAF, nullptr, PARCOUNT, "nonleaf nodes destroyed", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_MSG_BYTES_IN, PARCOUNT, "bytes of messages injected at root (all trees)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_MSG_BYTES_IN, nullptr, PARCOUNT, "bytes of messages injected at root (all trees)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_MSG_BYTES_OUT, PARCOUNT, "bytes of messages flushed from h1 nodes to leaves", TOKU_ENGINE_STATUS); STATUS_INIT(FT_MSG_BYTES_OUT, nullptr, PARCOUNT, "bytes of messages flushed from h1 nodes to leaves", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_MSG_BYTES_CURR, PARCOUNT, "bytes of messages currently in trees (estimate)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_MSG_BYTES_CURR, nullptr, PARCOUNT, "bytes of messages currently in trees (estimate)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_MSG_NUM, PARCOUNT, "messages injected at root", TOKU_ENGINE_STATUS); STATUS_INIT(FT_MSG_NUM, nullptr, PARCOUNT, "messages injected at root", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_MSG_NUM_BROADCAST, PARCOUNT, "broadcast messages injected at root", TOKU_ENGINE_STATUS); STATUS_INIT(FT_MSG_NUM_BROADCAST, nullptr, PARCOUNT, "broadcast messages injected at root", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NUM_BASEMENTS_DECOMPRESSED_NORMAL, PARCOUNT, "basements decompressed as a target of a query", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_BASEMENTS_DECOMPRESSED_NORMAL, nullptr, PARCOUNT, "basements decompressed as a target of a query", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NUM_BASEMENTS_DECOMPRESSED_AGGRESSIVE, PARCOUNT, "basements decompressed for prelocked range", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_BASEMENTS_DECOMPRESSED_AGGRESSIVE, nullptr, PARCOUNT, "basements decompressed for prelocked range", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NUM_BASEMENTS_DECOMPRESSED_PREFETCH, PARCOUNT, "basements decompressed for prefetch", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_BASEMENTS_DECOMPRESSED_PREFETCH, nullptr, PARCOUNT, "basements decompressed for prefetch", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NUM_BASEMENTS_DECOMPRESSED_WRITE, PARCOUNT, "basements decompressed for write", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_BASEMENTS_DECOMPRESSED_WRITE, nullptr, PARCOUNT, "basements decompressed for write", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NUM_MSG_BUFFER_DECOMPRESSED_NORMAL, PARCOUNT, "buffers decompressed as a target of a query", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_MSG_BUFFER_DECOMPRESSED_NORMAL, nullptr, PARCOUNT, "buffers decompressed as a target of a query", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NUM_MSG_BUFFER_DECOMPRESSED_AGGRESSIVE, PARCOUNT, "buffers decompressed for prelocked range", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_MSG_BUFFER_DECOMPRESSED_AGGRESSIVE, nullptr, PARCOUNT, "buffers decompressed for prelocked range", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NUM_MSG_BUFFER_DECOMPRESSED_PREFETCH, PARCOUNT, "buffers decompressed for prefetch", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_MSG_BUFFER_DECOMPRESSED_PREFETCH, nullptr, PARCOUNT, "buffers decompressed for prefetch", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NUM_MSG_BUFFER_DECOMPRESSED_WRITE, PARCOUNT, "buffers decompressed for write", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_MSG_BUFFER_DECOMPRESSED_WRITE, nullptr, PARCOUNT, "buffers decompressed for write", TOKU_ENGINE_STATUS);
// Eviction statistics: // Eviction statistics:
STATUS_INIT(FT_FULL_EVICTIONS_LEAF, PARCOUNT, "leaf node full evictions", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FULL_EVICTIONS_LEAF, nullptr, PARCOUNT, "leaf node full evictions", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FULL_EVICTIONS_LEAF_BYTES, PARCOUNT, "leaf node full evictions (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FULL_EVICTIONS_LEAF_BYTES, nullptr, PARCOUNT, "leaf node full evictions (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FULL_EVICTIONS_NONLEAF, PARCOUNT, "nonleaf node full evictions", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FULL_EVICTIONS_NONLEAF, nullptr, PARCOUNT, "nonleaf node full evictions", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FULL_EVICTIONS_NONLEAF_BYTES, PARCOUNT, "nonleaf node full evictions (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_FULL_EVICTIONS_NONLEAF_BYTES, nullptr, PARCOUNT, "nonleaf node full evictions (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_PARTIAL_EVICTIONS_LEAF, PARCOUNT, "leaf node partial evictions", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PARTIAL_EVICTIONS_LEAF, nullptr, PARCOUNT, "leaf node partial evictions", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_PARTIAL_EVICTIONS_LEAF_BYTES, PARCOUNT, "leaf node partial evictions (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PARTIAL_EVICTIONS_LEAF_BYTES, nullptr, PARCOUNT, "leaf node partial evictions (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_PARTIAL_EVICTIONS_NONLEAF, PARCOUNT, "nonleaf node partial evictions", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PARTIAL_EVICTIONS_NONLEAF, nullptr, PARCOUNT, "nonleaf node partial evictions", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_PARTIAL_EVICTIONS_NONLEAF_BYTES, PARCOUNT, "nonleaf node partial evictions (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PARTIAL_EVICTIONS_NONLEAF_BYTES, nullptr, PARCOUNT, "nonleaf node partial evictions (bytes)", TOKU_ENGINE_STATUS);
// Disk read statistics: // Disk read statistics:
// //
// Pivots: For queries, prefetching, or writing. // Pivots: For queries, prefetching, or writing.
STATUS_INIT(FT_NUM_PIVOTS_FETCHED_QUERY, PARCOUNT, "pivots fetched for query", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_PIVOTS_FETCHED_QUERY, nullptr, PARCOUNT, "pivots fetched for query", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_BYTES_PIVOTS_FETCHED_QUERY, PARCOUNT, "pivots fetched for query (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_BYTES_PIVOTS_FETCHED_QUERY, nullptr, PARCOUNT, "pivots fetched for query (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_TOKUTIME_PIVOTS_FETCHED_QUERY, TOKUTIME, "pivots fetched for query (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_TOKUTIME_PIVOTS_FETCHED_QUERY, nullptr, TOKUTIME, "pivots fetched for query (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NUM_PIVOTS_FETCHED_PREFETCH, PARCOUNT, "pivots fetched for prefetch", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_PIVOTS_FETCHED_PREFETCH, nullptr, PARCOUNT, "pivots fetched for prefetch", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_BYTES_PIVOTS_FETCHED_PREFETCH, PARCOUNT, "pivots fetched for prefetch (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_BYTES_PIVOTS_FETCHED_PREFETCH, nullptr, PARCOUNT, "pivots fetched for prefetch (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_TOKUTIME_PIVOTS_FETCHED_PREFETCH, TOKUTIME, "pivots fetched for prefetch (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_TOKUTIME_PIVOTS_FETCHED_PREFETCH, nullptr, TOKUTIME, "pivots fetched for prefetch (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NUM_PIVOTS_FETCHED_WRITE, PARCOUNT, "pivots fetched for write", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_PIVOTS_FETCHED_WRITE, nullptr, PARCOUNT, "pivots fetched for write", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_BYTES_PIVOTS_FETCHED_WRITE, PARCOUNT, "pivots fetched for write (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_BYTES_PIVOTS_FETCHED_WRITE, nullptr, PARCOUNT, "pivots fetched for write (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_TOKUTIME_PIVOTS_FETCHED_WRITE, TOKUTIME, "pivots fetched for write (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_TOKUTIME_PIVOTS_FETCHED_WRITE, nullptr, TOKUTIME, "pivots fetched for write (seconds)", TOKU_ENGINE_STATUS);
// Basements: For queries, aggressive fetching in prelocked range, prefetching, or writing. // Basements: For queries, aggressive fetching in prelocked range, prefetching, or writing.
STATUS_INIT(FT_NUM_BASEMENTS_FETCHED_NORMAL, PARCOUNT, "basements fetched as a target of a query", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_BASEMENTS_FETCHED_NORMAL, nullptr, PARCOUNT, "basements fetched as a target of a query", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_BYTES_BASEMENTS_FETCHED_NORMAL, PARCOUNT, "basements fetched as a target of a query (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_BYTES_BASEMENTS_FETCHED_NORMAL, nullptr, PARCOUNT, "basements fetched as a target of a query (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_TOKUTIME_BASEMENTS_FETCHED_NORMAL, TOKUTIME, "basements fetched as a target of a query (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_TOKUTIME_BASEMENTS_FETCHED_NORMAL, nullptr, TOKUTIME, "basements fetched as a target of a query (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NUM_BASEMENTS_FETCHED_AGGRESSIVE, PARCOUNT, "basements fetched for prelocked range", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_BASEMENTS_FETCHED_AGGRESSIVE, nullptr, PARCOUNT, "basements fetched for prelocked range", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_BYTES_BASEMENTS_FETCHED_AGGRESSIVE, PARCOUNT, "basements fetched for prelocked range (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_BYTES_BASEMENTS_FETCHED_AGGRESSIVE, nullptr, PARCOUNT, "basements fetched for prelocked range (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_TOKUTIME_BASEMENTS_FETCHED_AGGRESSIVE, TOKUTIME, "basements fetched for prelocked range (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_TOKUTIME_BASEMENTS_FETCHED_AGGRESSIVE, nullptr, TOKUTIME, "basements fetched for prelocked range (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NUM_BASEMENTS_FETCHED_PREFETCH, PARCOUNT, "basements fetched for prefetch", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_BASEMENTS_FETCHED_PREFETCH, nullptr, PARCOUNT, "basements fetched for prefetch", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_BYTES_BASEMENTS_FETCHED_PREFETCH, PARCOUNT, "basements fetched for prefetch (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_BYTES_BASEMENTS_FETCHED_PREFETCH, nullptr, PARCOUNT, "basements fetched for prefetch (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_TOKUTIME_BASEMENTS_FETCHED_PREFETCH, TOKUTIME, "basements fetched for prefetch (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_TOKUTIME_BASEMENTS_FETCHED_PREFETCH, nullptr, TOKUTIME, "basements fetched for prefetch (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NUM_BASEMENTS_FETCHED_WRITE, PARCOUNT, "basements fetched for write", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_BASEMENTS_FETCHED_WRITE, nullptr, PARCOUNT, "basements fetched for write", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_BYTES_BASEMENTS_FETCHED_WRITE, PARCOUNT, "basements fetched for write (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_BYTES_BASEMENTS_FETCHED_WRITE, nullptr, PARCOUNT, "basements fetched for write (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_TOKUTIME_BASEMENTS_FETCHED_WRITE, TOKUTIME, "basements fetched for write (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_TOKUTIME_BASEMENTS_FETCHED_WRITE, nullptr, TOKUTIME, "basements fetched for write (seconds)", TOKU_ENGINE_STATUS);
// Buffers: For queries, aggressive fetching in prelocked range, prefetching, or writing. // Buffers: For queries, aggressive fetching in prelocked range, prefetching, or writing.
STATUS_INIT(FT_NUM_MSG_BUFFER_FETCHED_NORMAL, PARCOUNT, "buffers fetched as a target of a query", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_MSG_BUFFER_FETCHED_NORMAL, nullptr, PARCOUNT, "buffers fetched as a target of a query", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_BYTES_MSG_BUFFER_FETCHED_NORMAL, PARCOUNT, "buffers fetched as a target of a query (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_BYTES_MSG_BUFFER_FETCHED_NORMAL, nullptr, PARCOUNT, "buffers fetched as a target of a query (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_TOKUTIME_MSG_BUFFER_FETCHED_NORMAL, TOKUTIME, "buffers fetched as a target of a query (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_TOKUTIME_MSG_BUFFER_FETCHED_NORMAL, nullptr, TOKUTIME, "buffers fetched as a target of a query (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NUM_MSG_BUFFER_FETCHED_AGGRESSIVE, PARCOUNT, "buffers fetched for prelocked range", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_MSG_BUFFER_FETCHED_AGGRESSIVE, nullptr, PARCOUNT, "buffers fetched for prelocked range", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_BYTES_MSG_BUFFER_FETCHED_AGGRESSIVE, PARCOUNT, "buffers fetched for prelocked range (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_BYTES_MSG_BUFFER_FETCHED_AGGRESSIVE, nullptr, PARCOUNT, "buffers fetched for prelocked range (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_TOKUTIME_MSG_BUFFER_FETCHED_AGGRESSIVE, TOKUTIME, "buffers fetched for prelocked range (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_TOKUTIME_MSG_BUFFER_FETCHED_AGGRESSIVE, nullptr, TOKUTIME, "buffers fetched for prelocked range (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NUM_MSG_BUFFER_FETCHED_PREFETCH, PARCOUNT, "buffers fetched for prefetch", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_MSG_BUFFER_FETCHED_PREFETCH, nullptr, PARCOUNT, "buffers fetched for prefetch", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_BYTES_MSG_BUFFER_FETCHED_PREFETCH, PARCOUNT, "buffers fetched for prefetch (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_BYTES_MSG_BUFFER_FETCHED_PREFETCH, nullptr, PARCOUNT, "buffers fetched for prefetch (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_TOKUTIME_MSG_BUFFER_FETCHED_PREFETCH, TOKUTIME, "buffers fetched for prefetch (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_TOKUTIME_MSG_BUFFER_FETCHED_PREFETCH, nullptr, TOKUTIME, "buffers fetched for prefetch (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NUM_MSG_BUFFER_FETCHED_WRITE, PARCOUNT, "buffers fetched for write", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NUM_MSG_BUFFER_FETCHED_WRITE, nullptr, PARCOUNT, "buffers fetched for write", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_BYTES_MSG_BUFFER_FETCHED_WRITE, PARCOUNT, "buffers fetched for write (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_BYTES_MSG_BUFFER_FETCHED_WRITE, nullptr, PARCOUNT, "buffers fetched for write (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_TOKUTIME_MSG_BUFFER_FETCHED_WRITE, TOKUTIME, "buffers fetched for write (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_TOKUTIME_MSG_BUFFER_FETCHED_WRITE, nullptr, TOKUTIME, "buffers fetched for write (seconds)", TOKU_ENGINE_STATUS);
// Disk write statistics. // Disk write statistics.
// //
// Leaf/Nonleaf: Not for checkpoint // Leaf/Nonleaf: Not for checkpoint
STATUS_INIT(FT_DISK_FLUSH_LEAF, PARCOUNT, "leaf nodes flushed to disk (not for checkpoint)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_DISK_FLUSH_LEAF, nullptr, PARCOUNT, "leaf nodes flushed to disk (not for checkpoint)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_DISK_FLUSH_LEAF_BYTES, PARCOUNT, "leaf nodes flushed to disk (not for checkpoint) (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_DISK_FLUSH_LEAF_BYTES, nullptr, PARCOUNT, "leaf nodes flushed to disk (not for checkpoint) (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_DISK_FLUSH_LEAF_UNCOMPRESSED_BYTES, PARCOUNT, "leaf nodes flushed to disk (not for checkpoint) (uncompressed bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_DISK_FLUSH_LEAF_UNCOMPRESSED_BYTES, nullptr, PARCOUNT, "leaf nodes flushed to disk (not for checkpoint) (uncompressed bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_DISK_FLUSH_LEAF_TOKUTIME, TOKUTIME, "leaf nodes flushed to disk (not for checkpoint) (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_DISK_FLUSH_LEAF_TOKUTIME, nullptr, TOKUTIME, "leaf nodes flushed to disk (not for checkpoint) (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_DISK_FLUSH_NONLEAF, PARCOUNT, "nonleaf nodes flushed to disk (not for checkpoint)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_DISK_FLUSH_NONLEAF, nullptr, PARCOUNT, "nonleaf nodes flushed to disk (not for checkpoint)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_DISK_FLUSH_NONLEAF_BYTES, PARCOUNT, "nonleaf nodes flushed to disk (not for checkpoint) (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_DISK_FLUSH_NONLEAF_BYTES, nullptr, PARCOUNT, "nonleaf nodes flushed to disk (not for checkpoint) (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_DISK_FLUSH_NONLEAF_UNCOMPRESSED_BYTES, PARCOUNT, "nonleaf nodes flushed to disk (not for checkpoint) (uncompressed bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_DISK_FLUSH_NONLEAF_UNCOMPRESSED_BYTES, nullptr, PARCOUNT, "nonleaf nodes flushed to disk (not for checkpoint) (uncompressed bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_DISK_FLUSH_NONLEAF_TOKUTIME, TOKUTIME, "nonleaf nodes flushed to disk (not for checkpoint) (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_DISK_FLUSH_NONLEAF_TOKUTIME, nullptr, TOKUTIME, "nonleaf nodes flushed to disk (not for checkpoint) (seconds)", TOKU_ENGINE_STATUS);
// Leaf/Nonleaf: For checkpoint // Leaf/Nonleaf: For checkpoint
STATUS_INIT(FT_DISK_FLUSH_LEAF_FOR_CHECKPOINT, PARCOUNT, "leaf nodes flushed to disk (for checkpoint)", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS); STATUS_INIT(FT_DISK_FLUSH_LEAF_FOR_CHECKPOINT, nullptr, PARCOUNT, "leaf nodes flushed to disk (for checkpoint)", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS);
STATUS_INIT(FT_DISK_FLUSH_LEAF_BYTES_FOR_CHECKPOINT, PARCOUNT, "leaf nodes flushed to disk (for checkpoint) (bytes)", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS); STATUS_INIT(FT_DISK_FLUSH_LEAF_BYTES_FOR_CHECKPOINT, nullptr, PARCOUNT, "leaf nodes flushed to disk (for checkpoint) (bytes)", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS);
STATUS_INIT(FT_DISK_FLUSH_LEAF_UNCOMPRESSED_BYTES_FOR_CHECKPOINT, PARCOUNT, "leaf nodes flushed to disk (for checkpoint) (uncompressed bytes)", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS); STATUS_INIT(FT_DISK_FLUSH_LEAF_UNCOMPRESSED_BYTES_FOR_CHECKPOINT, nullptr, PARCOUNT, "leaf nodes flushed to disk (for checkpoint) (uncompressed bytes)", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS);
STATUS_INIT(FT_DISK_FLUSH_LEAF_TOKUTIME_FOR_CHECKPOINT, TOKUTIME, "leaf nodes flushed to disk (for checkpoint) (seconds)", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS); STATUS_INIT(FT_DISK_FLUSH_LEAF_TOKUTIME_FOR_CHECKPOINT, nullptr, TOKUTIME, "leaf nodes flushed to disk (for checkpoint) (seconds)", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS);
STATUS_INIT(FT_DISK_FLUSH_NONLEAF_FOR_CHECKPOINT, PARCOUNT, "nonleaf nodes flushed to disk (for checkpoint)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_DISK_FLUSH_NONLEAF_FOR_CHECKPOINT, nullptr, PARCOUNT, "nonleaf nodes flushed to disk (for checkpoint)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_DISK_FLUSH_NONLEAF_BYTES_FOR_CHECKPOINT, PARCOUNT, "nonleaf nodes flushed to disk (for checkpoint) (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_DISK_FLUSH_NONLEAF_BYTES_FOR_CHECKPOINT, nullptr, PARCOUNT, "nonleaf nodes flushed to disk (for checkpoint) (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_DISK_FLUSH_NONLEAF_UNCOMPRESSED_BYTES_FOR_CHECKPOINT, PARCOUNT, "nonleaf nodes flushed to disk (for checkpoint) (uncompressed bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_DISK_FLUSH_NONLEAF_UNCOMPRESSED_BYTES_FOR_CHECKPOINT, nullptr, PARCOUNT, "nonleaf nodes flushed to disk (for checkpoint) (uncompressed bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_DISK_FLUSH_NONLEAF_TOKUTIME_FOR_CHECKPOINT, TOKUTIME, "nonleaf nodes flushed to disk (for checkpoint) (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_DISK_FLUSH_NONLEAF_TOKUTIME_FOR_CHECKPOINT, nullptr, TOKUTIME, "nonleaf nodes flushed to disk (for checkpoint) (seconds)", TOKU_ENGINE_STATUS);
// CPU time statistics for [de]serialization and [de]compression. // CPU time statistics for [de]serialization and [de]compression.
STATUS_INIT(FT_LEAF_COMPRESS_TOKUTIME, TOKUTIME, "leaf compression to memory (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_LEAF_COMPRESS_TOKUTIME, nullptr, TOKUTIME, "leaf compression to memory (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_LEAF_SERIALIZE_TOKUTIME, TOKUTIME, "leaf serialization to memory (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_LEAF_SERIALIZE_TOKUTIME, nullptr, TOKUTIME, "leaf serialization to memory (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_LEAF_DECOMPRESS_TOKUTIME, TOKUTIME, "leaf decompression to memory (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_LEAF_DECOMPRESS_TOKUTIME, nullptr, TOKUTIME, "leaf decompression to memory (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_LEAF_DESERIALIZE_TOKUTIME, TOKUTIME, "leaf deserialization to memory (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_LEAF_DESERIALIZE_TOKUTIME, nullptr, TOKUTIME, "leaf deserialization to memory (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NONLEAF_COMPRESS_TOKUTIME, TOKUTIME, "nonleaf compression to memory (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NONLEAF_COMPRESS_TOKUTIME, nullptr, TOKUTIME, "nonleaf compression to memory (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NONLEAF_SERIALIZE_TOKUTIME, TOKUTIME, "nonleaf serialization to memory (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NONLEAF_SERIALIZE_TOKUTIME, nullptr, TOKUTIME, "nonleaf serialization to memory (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NONLEAF_DECOMPRESS_TOKUTIME, TOKUTIME, "nonleaf decompression to memory (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NONLEAF_DECOMPRESS_TOKUTIME, nullptr, TOKUTIME, "nonleaf decompression to memory (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_NONLEAF_DESERIALIZE_TOKUTIME, TOKUTIME, "nonleaf deserialization to memory (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_NONLEAF_DESERIALIZE_TOKUTIME, nullptr, TOKUTIME, "nonleaf deserialization to memory (seconds)", TOKU_ENGINE_STATUS);
// Promotion statistics. // Promotion statistics.
STATUS_INIT(FT_PRO_NUM_ROOT_SPLIT, PARCOUNT, "promotion: roots split", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PRO_NUM_ROOT_SPLIT, nullptr, PARCOUNT, "promotion: roots split", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_PRO_NUM_ROOT_H0_INJECT, PARCOUNT, "promotion: leaf roots injected into", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PRO_NUM_ROOT_H0_INJECT, nullptr, PARCOUNT, "promotion: leaf roots injected into", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_PRO_NUM_ROOT_H1_INJECT, PARCOUNT, "promotion: h1 roots injected into", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PRO_NUM_ROOT_H1_INJECT, nullptr, PARCOUNT, "promotion: h1 roots injected into", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_PRO_NUM_INJECT_DEPTH_0, PARCOUNT, "promotion: injections at depth 0", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PRO_NUM_INJECT_DEPTH_0, nullptr, PARCOUNT, "promotion: injections at depth 0", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_PRO_NUM_INJECT_DEPTH_1, PARCOUNT, "promotion: injections at depth 1", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PRO_NUM_INJECT_DEPTH_1, nullptr, PARCOUNT, "promotion: injections at depth 1", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_PRO_NUM_INJECT_DEPTH_2, PARCOUNT, "promotion: injections at depth 2", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PRO_NUM_INJECT_DEPTH_2, nullptr, PARCOUNT, "promotion: injections at depth 2", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_PRO_NUM_INJECT_DEPTH_3, PARCOUNT, "promotion: injections at depth 3", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PRO_NUM_INJECT_DEPTH_3, nullptr, PARCOUNT, "promotion: injections at depth 3", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_PRO_NUM_INJECT_DEPTH_GT3, PARCOUNT, "promotion: injections lower than depth 3", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PRO_NUM_INJECT_DEPTH_GT3, nullptr, PARCOUNT, "promotion: injections lower than depth 3", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_PRO_NUM_STOP_NONEMPTY_BUF, PARCOUNT, "promotion: stopped because of a nonempty buffer", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PRO_NUM_STOP_NONEMPTY_BUF, nullptr, PARCOUNT, "promotion: stopped because of a nonempty buffer", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_PRO_NUM_STOP_H1, PARCOUNT, "promotion: stopped at height 1", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PRO_NUM_STOP_H1, nullptr, PARCOUNT, "promotion: stopped at height 1", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_PRO_NUM_STOP_LOCK_CHILD, PARCOUNT, "promotion: stopped because the child was locked or not at all in memory", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PRO_NUM_STOP_LOCK_CHILD, nullptr, PARCOUNT, "promotion: stopped because the child was locked or not at all in memory", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_PRO_NUM_STOP_CHILD_INMEM, PARCOUNT, "promotion: stopped because the child was not fully in memory", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PRO_NUM_STOP_CHILD_INMEM, nullptr, PARCOUNT, "promotion: stopped because the child was not fully in memory", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_PRO_NUM_DIDNT_WANT_PROMOTE, PARCOUNT, "promotion: stopped anyway, after locking the child", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PRO_NUM_DIDNT_WANT_PROMOTE, nullptr, PARCOUNT, "promotion: stopped anyway, after locking the child", TOKU_ENGINE_STATUS);
ft_status.initialized = true; ft_status.initialized = true;
} }
......
...@@ -15,14 +15,14 @@ ...@@ -15,14 +15,14 @@
static FT_UPGRADE_STATUS_S ft_upgrade_status; static FT_UPGRADE_STATUS_S ft_upgrade_status;
#define STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(ft_upgrade_status, k, t, "brt upgrade: " l, inc) #define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(ft_upgrade_status, k, c, t, "brt upgrade: " l, inc)
static void static void
status_init(void) status_init(void)
{ {
// Note, this function initializes the keyname, type, and legend fields. // Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler. // Value fields are initialized to zero by compiler.
STATUS_INIT(FT_UPGRADE_FOOTPRINT, UINT64, "footprint", TOKU_ENGINE_STATUS); STATUS_INIT(FT_UPGRADE_FOOTPRINT, nullptr, UINT64, "footprint", TOKU_ENGINE_STATUS);
ft_upgrade_status.initialized = true; ft_upgrade_status.initialized = true;
} }
#undef STATUS_INIT #undef STATUS_INIT
......
...@@ -1314,20 +1314,20 @@ void toku_logger_note_checkpoint(TOKULOGGER logger, LSN lsn) { ...@@ -1314,20 +1314,20 @@ void toku_logger_note_checkpoint(TOKULOGGER logger, LSN lsn) {
static LOGGER_STATUS_S logger_status; static LOGGER_STATUS_S logger_status;
#define STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(logger_status, k, t, "logger: " l, inc) #define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(logger_status, k, c, t, "logger: " l, inc)
static void static void
status_init(void) { status_init(void) {
// Note, this function initializes the keyname, type, and legend fields. // Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler. // Value fields are initialized to zero by compiler.
STATUS_INIT(LOGGER_NEXT_LSN, UINT64, "next LSN", TOKU_ENGINE_STATUS); STATUS_INIT(LOGGER_NEXT_LSN, nullptr, UINT64, "next LSN", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_ILOCK_CTR, UINT64, "ilock count", TOKU_ENGINE_STATUS); STATUS_INIT(LOGGER_ILOCK_CTR, nullptr, UINT64, "ilock count", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_OLOCK_CTR, UINT64, "olock count", TOKU_ENGINE_STATUS); STATUS_INIT(LOGGER_OLOCK_CTR, nullptr, UINT64, "olock count", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_SWAP_CTR, UINT64, "swap count", TOKU_ENGINE_STATUS); STATUS_INIT(LOGGER_SWAP_CTR, nullptr, UINT64, "swap count", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_NUM_WRITES, UINT64, "writes", TOKU_ENGINE_STATUS); STATUS_INIT(LOGGER_NUM_WRITES, nullptr, UINT64, "writes", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_BYTES_WRITTEN, UINT64, "writes (bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(LOGGER_BYTES_WRITTEN, nullptr, UINT64, "writes (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_UNCOMPRESSED_BYTES_WRITTEN, UINT64, "writes (uncompressed bytes)", TOKU_ENGINE_STATUS); STATUS_INIT(LOGGER_UNCOMPRESSED_BYTES_WRITTEN, nullptr, UINT64, "writes (uncompressed bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_TOKUTIME_WRITES, TOKUTIME, "writes (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(LOGGER_TOKUTIME_WRITES, nullptr, TOKUTIME, "writes (seconds)", TOKU_ENGINE_STATUS);
logger_status.initialized = true; logger_status.initialized = true;
} }
#undef STATUS_INIT #undef STATUS_INIT
......
...@@ -23,16 +23,16 @@ ...@@ -23,16 +23,16 @@
static TXN_STATUS_S txn_status; static TXN_STATUS_S txn_status;
#define STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(txn_status, k, t, "txn: " l, inc) #define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(txn_status, k, c, t, "txn: " l, inc)
void void
txn_status_init(void) { txn_status_init(void) {
// Note, this function initializes the keyname, type, and legend fields. // Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler. // Value fields are initialized to zero by compiler.
STATUS_INIT(TXN_BEGIN, PARCOUNT, "begin", TOKU_ENGINE_STATUS); STATUS_INIT(TXN_BEGIN, nullptr, PARCOUNT, "begin", TOKU_ENGINE_STATUS);
STATUS_INIT(TXN_READ_BEGIN, PARCOUNT, "begin read only", TOKU_ENGINE_STATUS); STATUS_INIT(TXN_READ_BEGIN, nullptr, PARCOUNT, "begin read only", TOKU_ENGINE_STATUS);
STATUS_INIT(TXN_COMMIT, PARCOUNT, "successful commits", TOKU_ENGINE_STATUS); STATUS_INIT(TXN_COMMIT, nullptr, PARCOUNT, "successful commits", TOKU_ENGINE_STATUS);
STATUS_INIT(TXN_ABORT, PARCOUNT, "aborts", TOKU_ENGINE_STATUS); STATUS_INIT(TXN_ABORT, nullptr, PARCOUNT, "aborts", TOKU_ENGINE_STATUS);
txn_status.initialized = true; txn_status.initialized = true;
} }
......
...@@ -45,16 +45,16 @@ static uint32_t ule_get_innermost_numbytes(ULE ule); ...@@ -45,16 +45,16 @@ static uint32_t ule_get_innermost_numbytes(ULE ule);
static LE_STATUS_S le_status; static LE_STATUS_S le_status;
#define STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(le_status, k, t, "le: " l, inc) #define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(le_status, k, c, t, "le: " l, inc)
static void static void
status_init(void) { status_init(void) {
// Note, this function initializes the keyname, type, and legend fields. // Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler. // Value fields are initialized to zero by compiler.
STATUS_INIT(LE_MAX_COMMITTED_XR, UINT64, "max committed xr", TOKU_ENGINE_STATUS); STATUS_INIT(LE_MAX_COMMITTED_XR, nullptr, UINT64, "max committed xr", TOKU_ENGINE_STATUS);
STATUS_INIT(LE_MAX_PROVISIONAL_XR, UINT64, "max provisional xr", TOKU_ENGINE_STATUS); STATUS_INIT(LE_MAX_PROVISIONAL_XR, nullptr, UINT64, "max provisional xr", TOKU_ENGINE_STATUS);
STATUS_INIT(LE_EXPANDED, UINT64, "expanded", TOKU_ENGINE_STATUS); STATUS_INIT(LE_EXPANDED, nullptr, UINT64, "expanded", TOKU_ENGINE_STATUS);
STATUS_INIT(LE_MAX_MEMSIZE, UINT64, "max memsize", TOKU_ENGINE_STATUS); STATUS_INIT(LE_MAX_MEMSIZE, nullptr, UINT64, "max memsize", TOKU_ENGINE_STATUS);
le_status.initialized = true; le_status.initialized = true;
} }
#undef STATUS_INIT #undef STATUS_INIT
......
...@@ -272,19 +272,19 @@ bool locktree::manager::memory_tracker::out_of_locks(void) const { ...@@ -272,19 +272,19 @@ bool locktree::manager::memory_tracker::out_of_locks(void) const {
return m_mgr->m_current_lock_memory >= m_mgr->m_max_lock_memory; return m_mgr->m_current_lock_memory >= m_mgr->m_max_lock_memory;
} }
#define STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(status, k, t, "locktree: " l, inc) #define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(status, k, c, t, "locktree: " l, inc)
void locktree::manager::status_init(void) { void locktree::manager::status_init(void) {
STATUS_INIT(LTM_SIZE_CURRENT, UINT64, "memory size", TOKU_ENGINE_STATUS); STATUS_INIT(LTM_SIZE_CURRENT, nullptr, UINT64, "memory size", TOKU_ENGINE_STATUS);
STATUS_INIT(LTM_SIZE_LIMIT, UINT64, "memory size limit", TOKU_ENGINE_STATUS); STATUS_INIT(LTM_SIZE_LIMIT, nullptr, UINT64, "memory size limit", TOKU_ENGINE_STATUS);
STATUS_INIT(LTM_ESCALATION_COUNT, UINT64, "number of times lock escalation ran", TOKU_ENGINE_STATUS); STATUS_INIT(LTM_ESCALATION_COUNT, nullptr, UINT64, "number of times lock escalation ran", TOKU_ENGINE_STATUS);
STATUS_INIT(LTM_ESCALATION_TIME, TOKUTIME, "time spent running escalation (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(LTM_ESCALATION_TIME, nullptr, TOKUTIME, "time spent running escalation (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(LTM_ESCALATION_LATEST_RESULT, UINT64, "latest post-escalation memory size", TOKU_ENGINE_STATUS); STATUS_INIT(LTM_ESCALATION_LATEST_RESULT, nullptr, UINT64, "latest post-escalation memory size", TOKU_ENGINE_STATUS);
STATUS_INIT(LTM_NUM_LOCKTREES, UINT64, "number of locktrees open now", TOKU_ENGINE_STATUS); STATUS_INIT(LTM_NUM_LOCKTREES, nullptr, UINT64, "number of locktrees open now", TOKU_ENGINE_STATUS);
STATUS_INIT(LTM_LOCK_REQUESTS_PENDING, UINT64, "number of pending lock requests", TOKU_ENGINE_STATUS); STATUS_INIT(LTM_LOCK_REQUESTS_PENDING, nullptr, UINT64, "number of pending lock requests", TOKU_ENGINE_STATUS);
STATUS_INIT(LTM_STO_NUM_ELIGIBLE, UINT64, "number of locktrees eligible for the STO", TOKU_ENGINE_STATUS); STATUS_INIT(LTM_STO_NUM_ELIGIBLE, nullptr, UINT64, "number of locktrees eligible for the STO", TOKU_ENGINE_STATUS);
STATUS_INIT(LTM_STO_END_EARLY_COUNT, UINT64, "number of times a locktree ended the STO early", TOKU_ENGINE_STATUS); STATUS_INIT(LTM_STO_END_EARLY_COUNT, nullptr, UINT64, "number of times a locktree ended the STO early", TOKU_ENGINE_STATUS);
STATUS_INIT(LTM_STO_END_EARLY_TIME, TOKUTIME, "time spent ending the STO early (seconds)", TOKU_ENGINE_STATUS); STATUS_INIT(LTM_STO_END_EARLY_TIME, nullptr, TOKUTIME, "time spent ending the STO early (seconds)", TOKU_ENGINE_STATUS);
status.initialized = true; status.initialized = true;
} }
......
...@@ -38,21 +38,21 @@ ...@@ -38,21 +38,21 @@
static INDEXER_STATUS_S indexer_status; static INDEXER_STATUS_S indexer_status;
#define STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(indexer_status, k, t, "indexer: " l, inc) #define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(indexer_status, k, c, t, "indexer: " l, inc)
static void static void
status_init(void) { status_init(void) {
// Note, this function initializes the keyname, type, and legend fields. // Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler. // Value fields are initialized to zero by compiler.
STATUS_INIT(INDEXER_CREATE, UINT64, "number of indexers successfully created", TOKU_ENGINE_STATUS); STATUS_INIT(INDEXER_CREATE, nullptr, UINT64, "number of indexers successfully created", TOKU_ENGINE_STATUS);
STATUS_INIT(INDEXER_CREATE_FAIL, UINT64, "number of calls to toku_indexer_create_indexer() that failed", TOKU_ENGINE_STATUS); STATUS_INIT(INDEXER_CREATE_FAIL, nullptr, UINT64, "number of calls to toku_indexer_create_indexer() that failed", TOKU_ENGINE_STATUS);
STATUS_INIT(INDEXER_BUILD, UINT64, "number of calls to indexer->build() succeeded", TOKU_ENGINE_STATUS); STATUS_INIT(INDEXER_BUILD, nullptr, UINT64, "number of calls to indexer->build() succeeded", TOKU_ENGINE_STATUS);
STATUS_INIT(INDEXER_BUILD_FAIL, UINT64, "number of calls to indexer->build() failed", TOKU_ENGINE_STATUS); STATUS_INIT(INDEXER_BUILD_FAIL, nullptr, UINT64, "number of calls to indexer->build() failed", TOKU_ENGINE_STATUS);
STATUS_INIT(INDEXER_CLOSE, UINT64, "number of calls to indexer->close() that succeeded", TOKU_ENGINE_STATUS); STATUS_INIT(INDEXER_CLOSE, nullptr, UINT64, "number of calls to indexer->close() that succeeded", TOKU_ENGINE_STATUS);
STATUS_INIT(INDEXER_CLOSE_FAIL, UINT64, "number of calls to indexer->close() that failed", TOKU_ENGINE_STATUS); STATUS_INIT(INDEXER_CLOSE_FAIL, nullptr, UINT64, "number of calls to indexer->close() that failed", TOKU_ENGINE_STATUS);
STATUS_INIT(INDEXER_ABORT, UINT64, "number of calls to indexer->abort()", TOKU_ENGINE_STATUS); STATUS_INIT(INDEXER_ABORT, nullptr, UINT64, "number of calls to indexer->abort()", TOKU_ENGINE_STATUS);
STATUS_INIT(INDEXER_CURRENT, UINT64, "number of indexers currently in existence", TOKU_ENGINE_STATUS); STATUS_INIT(INDEXER_CURRENT, nullptr, UINT64, "number of indexers currently in existence", TOKU_ENGINE_STATUS);
STATUS_INIT(INDEXER_MAX, UINT64, "max number of indexers that ever existed simultaneously", TOKU_ENGINE_STATUS); STATUS_INIT(INDEXER_MAX, nullptr, UINT64, "max number of indexers that ever existed simultaneously", TOKU_ENGINE_STATUS);
indexer_status.initialized = true; indexer_status.initialized = true;
} }
#undef STATUS_INIT #undef STATUS_INIT
......
...@@ -41,21 +41,21 @@ enum {MAX_FILE_SIZE=256}; ...@@ -41,21 +41,21 @@ enum {MAX_FILE_SIZE=256};
static LOADER_STATUS_S loader_status; static LOADER_STATUS_S loader_status;
#define STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(loader_status, k, t, "loader: " l, inc) #define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(loader_status, k, c, t, "loader: " l, inc)
static void static void
status_init(void) { status_init(void) {
// Note, this function initializes the keyname, type, and legend fields. // Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler. // Value fields are initialized to zero by compiler.
STATUS_INIT(LOADER_CREATE, UINT64, "number of loaders successfully created", TOKU_ENGINE_STATUS); STATUS_INIT(LOADER_CREATE, nullptr, UINT64, "number of loaders successfully created", TOKU_ENGINE_STATUS);
STATUS_INIT(LOADER_CREATE_FAIL, UINT64, "number of calls to toku_loader_create_loader() that failed", TOKU_ENGINE_STATUS); STATUS_INIT(LOADER_CREATE_FAIL, nullptr, UINT64, "number of calls to toku_loader_create_loader() that failed", TOKU_ENGINE_STATUS);
STATUS_INIT(LOADER_PUT, UINT64, "number of calls to loader->put() succeeded", TOKU_ENGINE_STATUS); STATUS_INIT(LOADER_PUT, nullptr, UINT64, "number of calls to loader->put() succeeded", TOKU_ENGINE_STATUS);
STATUS_INIT(LOADER_PUT_FAIL, UINT64, "number of calls to loader->put() failed", TOKU_ENGINE_STATUS); STATUS_INIT(LOADER_PUT_FAIL, nullptr, UINT64, "number of calls to loader->put() failed", TOKU_ENGINE_STATUS);
STATUS_INIT(LOADER_CLOSE, UINT64, "number of calls to loader->close() that succeeded", TOKU_ENGINE_STATUS); STATUS_INIT(LOADER_CLOSE, nullptr, UINT64, "number of calls to loader->close() that succeeded", TOKU_ENGINE_STATUS);
STATUS_INIT(LOADER_CLOSE_FAIL, UINT64, "number of calls to loader->close() that failed", TOKU_ENGINE_STATUS); STATUS_INIT(LOADER_CLOSE_FAIL, nullptr, UINT64, "number of calls to loader->close() that failed", TOKU_ENGINE_STATUS);
STATUS_INIT(LOADER_ABORT, UINT64, "number of calls to loader->abort()", TOKU_ENGINE_STATUS); STATUS_INIT(LOADER_ABORT, nullptr, UINT64, "number of calls to loader->abort()", TOKU_ENGINE_STATUS);
STATUS_INIT(LOADER_CURRENT, UINT64, "number of loaders currently in existence", TOKU_ENGINE_STATUS); STATUS_INIT(LOADER_CURRENT, nullptr, UINT64, "number of loaders currently in existence", TOKU_ENGINE_STATUS);
STATUS_INIT(LOADER_MAX, UINT64, "max number of loaders that ever existed simultaneously", TOKU_ENGINE_STATUS); STATUS_INIT(LOADER_MAX, nullptr, UINT64, "max number of loaders that ever existed simultaneously", TOKU_ENGINE_STATUS);
loader_status.initialized = true; loader_status.initialized = true;
} }
#undef STATUS_INIT #undef STATUS_INIT
......
...@@ -94,6 +94,7 @@ test_main (int argc, char * const argv[]) { ...@@ -94,6 +94,7 @@ test_main (int argc, char * const argv[]) {
printf("First all the raw fields:\n"); printf("First all the raw fields:\n");
for (uint64_t i = 0; i < nrows; i++) { for (uint64_t i = 0; i < nrows; i++) {
printf("%s ", mystat[i].keyname); printf("%s ", mystat[i].keyname);
printf("%s ", mystat[i].columnname ? mystat[i].columnname : "(null)");
printf("%s ", mystat[i].legend); printf("%s ", mystat[i].legend);
printf("type=%d val = ", mystat[i].type); printf("type=%d val = ", mystat[i].type);
switch(mystat[i].type) { switch(mystat[i].type) {
......
...@@ -111,21 +111,21 @@ typedef struct { ...@@ -111,21 +111,21 @@ typedef struct {
static YDB_LAYER_STATUS_S ydb_layer_status; static YDB_LAYER_STATUS_S ydb_layer_status;
#define STATUS_VALUE(x) ydb_layer_status.status[x].value.num #define STATUS_VALUE(x) ydb_layer_status.status[x].value.num
#define STATUS_INIT(k,t,l,inc) TOKUDB_STATUS_INIT(ydb_layer_status, k, t, l, inc) #define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(ydb_layer_status, k, c, t, l, inc)
static void static void
ydb_layer_status_init (void) { ydb_layer_status_init (void) {
// Note, this function initializes the keyname, type, and legend fields. // Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler. // Value fields are initialized to zero by compiler.
STATUS_INIT(YDB_LAYER_TIME_CREATION, UNIXTIME, "time of environment creation", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_TIME_CREATION, nullptr, UNIXTIME, "time of environment creation", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_TIME_STARTUP, UNIXTIME, "time of engine startup", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_TIME_STARTUP, nullptr, UNIXTIME, "time of engine startup", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_TIME_NOW, UNIXTIME, "time now", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_TIME_NOW, nullptr, UNIXTIME, "time now", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_DB_OPEN, UINT64, "db opens", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_NUM_DB_OPEN, nullptr, UINT64, "db opens", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_DB_CLOSE, UINT64, "db closes", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_NUM_DB_CLOSE, nullptr, UINT64, "db closes", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_OPEN_DBS, UINT64, "num open dbs now", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_NUM_OPEN_DBS, nullptr, UINT64, "num open dbs now", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_MAX_OPEN_DBS, UINT64, "max open dbs", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_MAX_OPEN_DBS, nullptr, UINT64, "max open dbs", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_FSYNC_LOG_PERIOD, UINT64, "period, in ms, that recovery log is automatically fsynced", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_FSYNC_LOG_PERIOD, nullptr, UINT64, "period, in ms, that recovery log is automatically fsynced", TOKU_ENGINE_STATUS);
STATUS_VALUE(YDB_LAYER_TIME_STARTUP) = time(NULL); STATUS_VALUE(YDB_LAYER_TIME_STARTUP) = time(NULL);
ydb_layer_status.initialized = true; ydb_layer_status.initialized = true;
...@@ -500,18 +500,18 @@ typedef struct { ...@@ -500,18 +500,18 @@ typedef struct {
static PERSISTENT_UPGRADE_STATUS_S persistent_upgrade_status; static PERSISTENT_UPGRADE_STATUS_S persistent_upgrade_status;
#define PERSISTENT_UPGRADE_STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(persistent_upgrade_status, k, t, "upgrade: " l, inc) #define PERSISTENT_UPGRADE_STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(persistent_upgrade_status, k, c, t, "upgrade: " l, inc)
static void static void
persistent_upgrade_status_init (void) { persistent_upgrade_status_init (void) {
// Note, this function initializes the keyname, type, and legend fields. // Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler. // Value fields are initialized to zero by compiler.
PERSISTENT_UPGRADE_STATUS_INIT(PERSISTENT_UPGRADE_ORIGINAL_ENV_VERSION, UINT64, "original version (at time of environment creation)", TOKU_ENGINE_STATUS); PERSISTENT_UPGRADE_STATUS_INIT(PERSISTENT_UPGRADE_ORIGINAL_ENV_VERSION, nullptr, UINT64, "original version (at time of environment creation)", TOKU_ENGINE_STATUS);
PERSISTENT_UPGRADE_STATUS_INIT(PERSISTENT_UPGRADE_STORED_ENV_VERSION_AT_STARTUP, UINT64, "version at time of startup", TOKU_ENGINE_STATUS); PERSISTENT_UPGRADE_STATUS_INIT(PERSISTENT_UPGRADE_STORED_ENV_VERSION_AT_STARTUP, nullptr, UINT64, "version at time of startup", TOKU_ENGINE_STATUS);
PERSISTENT_UPGRADE_STATUS_INIT(PERSISTENT_UPGRADE_LAST_LSN_OF_V13, UINT64, "last LSN of version 13", TOKU_ENGINE_STATUS); PERSISTENT_UPGRADE_STATUS_INIT(PERSISTENT_UPGRADE_LAST_LSN_OF_V13, nullptr, UINT64, "last LSN of version 13", TOKU_ENGINE_STATUS);
PERSISTENT_UPGRADE_STATUS_INIT(PERSISTENT_UPGRADE_V14_TIME, UNIXTIME, "time of upgrade to version 14", TOKU_ENGINE_STATUS); PERSISTENT_UPGRADE_STATUS_INIT(PERSISTENT_UPGRADE_V14_TIME, nullptr, UNIXTIME, "time of upgrade to version 14", TOKU_ENGINE_STATUS);
PERSISTENT_UPGRADE_STATUS_INIT(PERSISTENT_UPGRADE_V14_FOOTPRINT, UINT64, "footprint from version 13 to 14", TOKU_ENGINE_STATUS); PERSISTENT_UPGRADE_STATUS_INIT(PERSISTENT_UPGRADE_V14_FOOTPRINT, nullptr, UINT64, "footprint from version 13 to 14", TOKU_ENGINE_STATUS);
persistent_upgrade_status.initialized = true; persistent_upgrade_status.initialized = true;
} }
...@@ -1696,17 +1696,17 @@ typedef struct { ...@@ -1696,17 +1696,17 @@ typedef struct {
static FS_STATUS_S fsstat; static FS_STATUS_S fsstat;
#define FS_STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(fsstat, k, t, "filesystem: " l, inc) #define FS_STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(fsstat, k, c, t, "filesystem: " l, inc)
static void static void
fs_status_init(void) { fs_status_init(void) {
FS_STATUS_INIT(FS_ENOSPC_REDZONE_STATE, FS_STATE, "ENOSPC redzone state", TOKU_ENGINE_STATUS); FS_STATUS_INIT(FS_ENOSPC_REDZONE_STATE, nullptr, FS_STATE, "ENOSPC redzone state", TOKU_ENGINE_STATUS);
FS_STATUS_INIT(FS_ENOSPC_THREADS_BLOCKED, UINT64, "threads currently blocked by full disk", TOKU_ENGINE_STATUS); FS_STATUS_INIT(FS_ENOSPC_THREADS_BLOCKED, nullptr, UINT64, "threads currently blocked by full disk", TOKU_ENGINE_STATUS);
FS_STATUS_INIT(FS_ENOSPC_REDZONE_CTR, UINT64, "number of operations rejected by enospc prevention (red zone)", TOKU_ENGINE_STATUS); FS_STATUS_INIT(FS_ENOSPC_REDZONE_CTR, nullptr, UINT64, "number of operations rejected by enospc prevention (red zone)", TOKU_ENGINE_STATUS);
FS_STATUS_INIT(FS_ENOSPC_MOST_RECENT, UNIXTIME, "most recent disk full", TOKU_ENGINE_STATUS); FS_STATUS_INIT(FS_ENOSPC_MOST_RECENT, nullptr, UNIXTIME, "most recent disk full", TOKU_ENGINE_STATUS);
FS_STATUS_INIT(FS_ENOSPC_COUNT, UINT64, "number of write operations that returned ENOSPC", TOKU_ENGINE_STATUS); FS_STATUS_INIT(FS_ENOSPC_COUNT, nullptr, UINT64, "number of write operations that returned ENOSPC", TOKU_ENGINE_STATUS);
FS_STATUS_INIT(FS_FSYNC_TIME, UINT64, "fsync time", TOKU_ENGINE_STATUS); FS_STATUS_INIT(FS_FSYNC_TIME, nullptr, UINT64, "fsync time", TOKU_ENGINE_STATUS);
FS_STATUS_INIT(FS_FSYNC_COUNT, UINT64, "fsync count", TOKU_ENGINE_STATUS); FS_STATUS_INIT(FS_FSYNC_COUNT, nullptr, UINT64, "fsync count", TOKU_ENGINE_STATUS);
fsstat.initialized = true; fsstat.initialized = true;
} }
#undef FS_STATUS_INIT #undef FS_STATUS_INIT
...@@ -1761,23 +1761,23 @@ typedef struct { ...@@ -1761,23 +1761,23 @@ typedef struct {
static MEMORY_STATUS_S memory_status; static MEMORY_STATUS_S memory_status;
#define STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(memory_status, k, t, "memory: " l, inc) #define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(memory_status, k, c, t, "memory: " l, inc)
static void static void
memory_status_init(void) { memory_status_init(void) {
// Note, this function initializes the keyname, type, and legend fields. // Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler. // Value fields are initialized to zero by compiler.
STATUS_INIT(MEMORY_MALLOC_COUNT, UINT64, "number of malloc operations", TOKU_ENGINE_STATUS); STATUS_INIT(MEMORY_MALLOC_COUNT, nullptr, UINT64, "number of malloc operations", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_FREE_COUNT, UINT64, "number of free operations", TOKU_ENGINE_STATUS); STATUS_INIT(MEMORY_FREE_COUNT, nullptr, UINT64, "number of free operations", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_REALLOC_COUNT, UINT64, "number of realloc operations", TOKU_ENGINE_STATUS); STATUS_INIT(MEMORY_REALLOC_COUNT, nullptr, UINT64, "number of realloc operations", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_MALLOC_FAIL, UINT64, "number of malloc operations that failed", TOKU_ENGINE_STATUS); STATUS_INIT(MEMORY_MALLOC_FAIL, nullptr, UINT64, "number of malloc operations that failed", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_REALLOC_FAIL, UINT64, "number of realloc operations that failed" , TOKU_ENGINE_STATUS); STATUS_INIT(MEMORY_REALLOC_FAIL, nullptr, UINT64, "number of realloc operations that failed" , TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_REQUESTED, UINT64, "number of bytes requested", TOKU_ENGINE_STATUS); STATUS_INIT(MEMORY_REQUESTED, nullptr, UINT64, "number of bytes requested", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_USED, UINT64, "number of bytes used (requested + overhead)", TOKU_ENGINE_STATUS); STATUS_INIT(MEMORY_USED, nullptr, UINT64, "number of bytes used (requested + overhead)", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_FREED, UINT64, "number of bytes freed", TOKU_ENGINE_STATUS); STATUS_INIT(MEMORY_FREED, nullptr, UINT64, "number of bytes freed", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_MAX_IN_USE, UINT64, "estimated maximum memory footprint", TOKU_ENGINE_STATUS); STATUS_INIT(MEMORY_MAX_IN_USE, nullptr, UINT64, "estimated maximum memory footprint", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_MALLOCATOR_VERSION, CHARSTR, "mallocator version", TOKU_ENGINE_STATUS); STATUS_INIT(MEMORY_MALLOCATOR_VERSION, nullptr, CHARSTR, "mallocator version", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_MMAP_THRESHOLD, UINT64, "mmap threshold", TOKU_ENGINE_STATUS); STATUS_INIT(MEMORY_MMAP_THRESHOLD, nullptr, UINT64, "mmap threshold", TOKU_ENGINE_STATUS);
memory_status.initialized = true; memory_status.initialized = true;
} }
#undef STATUS_INIT #undef STATUS_INIT
......
...@@ -19,7 +19,7 @@ static YDB_C_LAYER_STATUS_S ydb_c_layer_status; ...@@ -19,7 +19,7 @@ static YDB_C_LAYER_STATUS_S ydb_c_layer_status;
#endif #endif
#define STATUS_VALUE(x) ydb_c_layer_status.status[x].value.num #define STATUS_VALUE(x) ydb_c_layer_status.status[x].value.num
#define STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(ydb_c_layer_status, k, t, l, inc) #define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(ydb_c_layer_status, k, c, t, l, inc)
static void static void
ydb_c_layer_status_init (void) { ydb_c_layer_status_init (void) {
......
...@@ -29,17 +29,17 @@ static YDB_DB_LAYER_STATUS_S ydb_db_layer_status; ...@@ -29,17 +29,17 @@ static YDB_DB_LAYER_STATUS_S ydb_db_layer_status;
#endif #endif
#define STATUS_VALUE(x) ydb_db_layer_status.status[x].value.num #define STATUS_VALUE(x) ydb_db_layer_status.status[x].value.num
#define STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(ydb_db_layer_status, k, t, l, inc) #define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(ydb_db_layer_status, k, c, t, l, inc)
static void static void
ydb_db_layer_status_init (void) { ydb_db_layer_status_init (void) {
// Note, this function initializes the keyname, type, and legend fields. // Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler. // Value fields are initialized to zero by compiler.
STATUS_INIT(YDB_LAYER_DIRECTORY_WRITE_LOCKS, UINT64, "directory write locks", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_DIRECTORY_WRITE_LOCKS, nullptr, UINT64, "directory write locks", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_DIRECTORY_WRITE_LOCKS_FAIL, UINT64, "directory write locks fail", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_DIRECTORY_WRITE_LOCKS_FAIL, nullptr, UINT64, "directory write locks fail", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_LOGSUPPRESS, UINT64, "log suppress", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_LOGSUPPRESS, nullptr, UINT64, "log suppress", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_LOGSUPPRESS_FAIL, UINT64, "log suppress fail", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_LOGSUPPRESS_FAIL, nullptr, UINT64, "log suppress fail", TOKU_ENGINE_STATUS);
ydb_db_layer_status.initialized = true; ydb_db_layer_status.initialized = true;
} }
#undef STATUS_INIT #undef STATUS_INIT
......
...@@ -21,26 +21,26 @@ static YDB_WRITE_LAYER_STATUS_S ydb_write_layer_status; ...@@ -21,26 +21,26 @@ static YDB_WRITE_LAYER_STATUS_S ydb_write_layer_status;
#endif #endif
#define STATUS_VALUE(x) ydb_write_layer_status.status[x].value.num #define STATUS_VALUE(x) ydb_write_layer_status.status[x].value.num
#define STATUS_INIT(k,t,l, inc) TOKUDB_STATUS_INIT(ydb_write_layer_status, k, t, l, inc) #define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(ydb_write_layer_status, k, c, t, l, inc)
static void static void
ydb_write_layer_status_init (void) { ydb_write_layer_status_init (void) {
// Note, this function initializes the keyname, type, and legend fields. // Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler. // Value fields are initialized to zero by compiler.
STATUS_INIT(YDB_LAYER_NUM_INSERTS, UINT64, "dictionary inserts", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_NUM_INSERTS, nullptr, UINT64, "dictionary inserts", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_INSERTS_FAIL, UINT64, "dictionary inserts fail", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_NUM_INSERTS_FAIL, nullptr, UINT64, "dictionary inserts fail", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_DELETES, UINT64, "dictionary deletes", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_NUM_DELETES, nullptr, UINT64, "dictionary deletes", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_DELETES_FAIL, UINT64, "dictionary deletes fail", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_NUM_DELETES_FAIL, nullptr, UINT64, "dictionary deletes fail", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_UPDATES, UINT64, "dictionary updates", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_NUM_UPDATES, nullptr, UINT64, "dictionary updates", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_UPDATES_FAIL, UINT64, "dictionary updates fail", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_NUM_UPDATES_FAIL, nullptr, UINT64, "dictionary updates fail", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_UPDATES_BROADCAST, UINT64, "dictionary broadcast updates", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_NUM_UPDATES_BROADCAST, nullptr, UINT64, "dictionary broadcast updates", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_UPDATES_BROADCAST_FAIL, UINT64, "dictionary broadcast updates fail", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_NUM_UPDATES_BROADCAST_FAIL, nullptr, UINT64, "dictionary broadcast updates fail", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_MULTI_INSERTS, UINT64, "dictionary multi inserts", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_NUM_MULTI_INSERTS, nullptr, UINT64, "dictionary multi inserts", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_MULTI_INSERTS_FAIL, UINT64, "dictionary multi inserts fail", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_NUM_MULTI_INSERTS_FAIL, nullptr, UINT64, "dictionary multi inserts fail", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_MULTI_DELETES, UINT64, "dictionary multi deletes", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_NUM_MULTI_DELETES, nullptr, UINT64, "dictionary multi deletes", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_MULTI_DELETES_FAIL, UINT64, "dictionary multi deletes fail", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_NUM_MULTI_DELETES_FAIL, nullptr, UINT64, "dictionary multi deletes fail", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_MULTI_UPDATES, UINT64, "dictionary updates multi", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_NUM_MULTI_UPDATES, nullptr, UINT64, "dictionary updates multi", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_MULTI_UPDATES_FAIL, UINT64, "dictionary updates multi fail", TOKU_ENGINE_STATUS); STATUS_INIT(YDB_LAYER_NUM_MULTI_UPDATES_FAIL, nullptr, UINT64, "dictionary updates multi fail", TOKU_ENGINE_STATUS);
ydb_write_layer_status.initialized = true; ydb_write_layer_status.initialized = true;
} }
#undef STATUS_INIT #undef STATUS_INIT
......
...@@ -58,11 +58,18 @@ void partitioned_counters_init(void); ...@@ -58,11 +58,18 @@ void partitioned_counters_init(void);
void partitioned_counters_destroy(void); void partitioned_counters_destroy(void);
// Effect: Destroy any partitioned counters data structures. // Effect: Destroy any partitioned counters data structures.
#define TOKUDB_STATUS_INIT(array, k, t, l, inc) do { \ /*
*/
#define TOKUDB_STATUS_INIT(array,k,c,t,l,inc) do { \
array.status[k].keyname = #k; \ array.status[k].keyname = #k; \
array.status[k].columnname = #c; \
array.status[k].type = t; \ array.status[k].type = t; \
array.status[k].legend = l; \ array.status[k].legend = l; \
static_assert((inc) != 0, "Var must be included in at least one place"); \ static_assert((inc) != 0, "Var must be included in at least one place"); \
static_assert(true || (inc) == TOKU_ENGINE_STATUS || \
(strcmp(#c, "nullptr") && strcmp(#c, "NULL") && strcmp(#c, "0")) \
, "Missing column name."); \
array.status[k].include = static_cast<toku_engine_status_include_type>(inc); \ array.status[k].include = static_cast<toku_engine_status_include_type>(inc); \
if (t == PARCOUNT) { \ if (t == PARCOUNT) { \
array.status[k].value.parcount = create_partitioned_counter(); \ array.status[k].value.parcount = create_partitioned_counter(); \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment