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__))) {
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 * 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(" 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");
......
......@@ -40,27 +40,27 @@ static CACHETABLE_STATUS_S ct_status;
// 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
status_init(void) {
// Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler.
STATUS_INIT(CT_MISS, UINT64, "miss", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_MISSTIME, UINT64, "miss time", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_PREFETCHES, UINT64, "prefetches", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_SIZE_CURRENT, 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_WRITING, UINT64, "size writing", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_SIZE_NONLEAF, UINT64, "size nonleaf", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_SIZE_LEAF, UINT64, "size leaf", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_SIZE_ROLLBACK, UINT64, "size rollback", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_SIZE_CACHEPRESSURE, UINT64, "size cachepressure", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_EVICTIONS, UINT64, "evictions", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_CLEANER_EXECUTIONS, UINT64, "cleaner executions", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_CLEANER_PERIOD, UINT64, "cleaner period", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_CLEANER_ITERATIONS, UINT64, "cleaner iterations", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_MISS, nullptr, UINT64, "miss", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_MISSTIME, nullptr, UINT64, "miss time", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_PREFETCHES, nullptr, UINT64, "prefetches", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_SIZE_CURRENT, nullptr, UINT64, "size current", 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, nullptr, UINT64, "size writing", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_SIZE_NONLEAF, nullptr, UINT64, "size nonleaf", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_SIZE_LEAF, nullptr, UINT64, "size leaf", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_SIZE_ROLLBACK, nullptr, UINT64, "size rollback", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_SIZE_CACHEPRESSURE, nullptr, UINT64, "size cachepressure", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_EVICTIONS, nullptr, UINT64, "evictions", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_CLEANER_EXECUTIONS, nullptr, UINT64, "cleaner executions", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_CLEANER_PERIOD, nullptr, UINT64, "cleaner period", TOKU_ENGINE_STATUS);
STATUS_INIT(CT_CLEANER_ITERATIONS, nullptr, UINT64, "cleaner iterations", TOKU_ENGINE_STATUS);
ct_status.initialized = true;
}
#undef STATUS_INIT
......
......@@ -60,25 +60,25 @@
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
status_init(void) {
// Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler.
STATUS_INIT(CP_PERIOD, UINT64, "period", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS);
STATUS_INIT(CP_FOOTPRINT, 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_COMPLETE, 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_LAST_LSN, UINT64, "last complete checkpoint LSN", TOKU_ENGINE_STATUS);
STATUS_INIT(CP_CHECKPOINT_COUNT, UINT64, "checkpoints taken ", TOKU_ENGINE_STATUS);
STATUS_INIT(CP_CHECKPOINT_COUNT_FAIL, UINT64, "checkpoints failed", TOKU_ENGINE_STATUS);
STATUS_INIT(CP_WAITERS_NOW, UINT64, "waiters now", TOKU_ENGINE_STATUS);
STATUS_INIT(CP_WAITERS_MAX, 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_CS, UINT64, "non-checkpoint client wait on cs lock", TOKU_ENGINE_STATUS);
STATUS_INIT(CP_PERIOD, nullptr, UINT64, "period", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS);
STATUS_INIT(CP_FOOTPRINT, nullptr, UINT64, "footprint", TOKU_ENGINE_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, nullptr, UNIXTIME, "last complete checkpoint began ", 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, nullptr, UINT64, "last complete checkpoint LSN", TOKU_ENGINE_STATUS);
STATUS_INIT(CP_CHECKPOINT_COUNT, nullptr, UINT64, "checkpoints taken ", TOKU_ENGINE_STATUS);
STATUS_INIT(CP_CHECKPOINT_COUNT_FAIL, nullptr, UINT64, "checkpoints failed", TOKU_ENGINE_STATUS);
STATUS_INIT(CP_WAITERS_NOW, nullptr, UINT64, "waiters now", TOKU_ENGINE_STATUS);
STATUS_INIT(CP_WAITERS_MAX, nullptr, UINT64, "waiters max", 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, nullptr, UINT64, "non-checkpoint client wait on cs lock", TOKU_ENGINE_STATUS);
cp_status.initialized = true;
}
#undef STATUS_INIT
......
......@@ -18,42 +18,42 @@
*/
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
void toku_ft_flusher_status_init(void) {
// Note, this function initializes the keyname, type, and legend fields.
// 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_H1_NODES, 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_EMPTY_NODES, 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_MAX_BUFFER_SIZE, 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_TOTAL_BUFFER_SIZE, 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_MIN_BUFFER_WORKDONE, 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_NUM_LEAF_MERGES_STARTED, 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_COMPLETED, 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_FLUSH_TOTAL, 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_NEEDED_IO, 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_1, 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_3, 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_5, 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_SPLIT_LEAF, UINT64, "leaf node splits", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_SPLIT_NONLEAF, 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_NONLEAF, UINT64, "nonleaf node merges", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_FLUSHER_BALANCE_LEAF, UINT64, "leaf node balances", 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, nullptr, UINT64, "height-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, nullptr, UINT64, "nodes cleaned which had empty buffers", 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, nullptr, UINT64, "max 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, nullptr, UINT64, "total bytes in buffers 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, nullptr, UINT64, "min workdone in a buffer 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, nullptr, UINT64, "times cleaner thread tries to merge a leaf", 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, nullptr, UINT64, "cleaner thread leaf merges successful", 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, nullptr, UINT64, "total number of flushes done by flusher threads or cleaner threads", 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, nullptr, UINT64, "number of flushes that read something off disk", 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, nullptr, UINT64, "number of flushes that triggered 1 cascading flush", 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, nullptr, UINT64, "number of flushes that triggered 3 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, nullptr, UINT64, "number of flushes that triggered 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, nullptr, UINT64, "leaf 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, nullptr, UINT64, "leaf 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, 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_WORKDONE) = UINT64_MAX;
......
......@@ -33,17 +33,17 @@ struct hot_flusher_extra {
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
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_COMPLETED, UINT64, "operations successfully completed", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_HOT_NUM_ABORTED, 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_NUM_STARTED, nullptr, UINT64, "operations ever started", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_HOT_NUM_COMPLETED, nullptr, UINT64, "operations successfully completed", TOKU_ENGINE_STATUS);
STATUS_INIT(FT_HOT_NUM_ABORTED, nullptr, UINT64, "operations aborted", 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;
}
......
This diff is collapsed.
......@@ -15,14 +15,14 @@
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
status_init(void)
{
// Note, this function initializes the keyname, type, and legend fields.
// 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;
}
#undef STATUS_INIT
......
......@@ -1314,20 +1314,20 @@ void toku_logger_note_checkpoint(TOKULOGGER logger, LSN lsn) {
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
status_init(void) {
// Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler.
STATUS_INIT(LOGGER_NEXT_LSN, UINT64, "next LSN", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_ILOCK_CTR, UINT64, "ilock count", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_OLOCK_CTR, UINT64, "olock count", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_SWAP_CTR, UINT64, "swap count", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_NUM_WRITES, UINT64, "writes", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_BYTES_WRITTEN, UINT64, "writes (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_UNCOMPRESSED_BYTES_WRITTEN, UINT64, "writes (uncompressed bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_TOKUTIME_WRITES, TOKUTIME, "writes (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_NEXT_LSN, nullptr, UINT64, "next LSN", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_ILOCK_CTR, nullptr, UINT64, "ilock count", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_OLOCK_CTR, nullptr, UINT64, "olock count", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_SWAP_CTR, nullptr, UINT64, "swap count", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_NUM_WRITES, nullptr, UINT64, "writes", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_BYTES_WRITTEN, nullptr, UINT64, "writes (bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_UNCOMPRESSED_BYTES_WRITTEN, nullptr, UINT64, "writes (uncompressed bytes)", TOKU_ENGINE_STATUS);
STATUS_INIT(LOGGER_TOKUTIME_WRITES, nullptr, TOKUTIME, "writes (seconds)", TOKU_ENGINE_STATUS);
logger_status.initialized = true;
}
#undef STATUS_INIT
......
......@@ -23,16 +23,16 @@
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
txn_status_init(void) {
// Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler.
STATUS_INIT(TXN_BEGIN, PARCOUNT, "begin", TOKU_ENGINE_STATUS);
STATUS_INIT(TXN_READ_BEGIN, PARCOUNT, "begin read only", TOKU_ENGINE_STATUS);
STATUS_INIT(TXN_COMMIT, PARCOUNT, "successful commits", TOKU_ENGINE_STATUS);
STATUS_INIT(TXN_ABORT, PARCOUNT, "aborts", TOKU_ENGINE_STATUS);
STATUS_INIT(TXN_BEGIN, nullptr, PARCOUNT, "begin", TOKU_ENGINE_STATUS);
STATUS_INIT(TXN_READ_BEGIN, nullptr, PARCOUNT, "begin read only", TOKU_ENGINE_STATUS);
STATUS_INIT(TXN_COMMIT, nullptr, PARCOUNT, "successful commits", TOKU_ENGINE_STATUS);
STATUS_INIT(TXN_ABORT, nullptr, PARCOUNT, "aborts", TOKU_ENGINE_STATUS);
txn_status.initialized = true;
}
......
......@@ -45,16 +45,16 @@ static uint32_t ule_get_innermost_numbytes(ULE ule);
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
status_init(void) {
// Note, this function initializes the keyname, type, and legend fields.
// 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_PROVISIONAL_XR, UINT64, "max provisional xr", TOKU_ENGINE_STATUS);
STATUS_INIT(LE_EXPANDED, UINT64, "expanded", TOKU_ENGINE_STATUS);
STATUS_INIT(LE_MAX_MEMSIZE, UINT64, "max memsize", TOKU_ENGINE_STATUS);
STATUS_INIT(LE_MAX_COMMITTED_XR, nullptr, UINT64, "max committed xr", TOKU_ENGINE_STATUS);
STATUS_INIT(LE_MAX_PROVISIONAL_XR, nullptr, UINT64, "max provisional xr", TOKU_ENGINE_STATUS);
STATUS_INIT(LE_EXPANDED, nullptr, UINT64, "expanded", TOKU_ENGINE_STATUS);
STATUS_INIT(LE_MAX_MEMSIZE, nullptr, UINT64, "max memsize", TOKU_ENGINE_STATUS);
le_status.initialized = true;
}
#undef STATUS_INIT
......
......@@ -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;
}
#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) {
STATUS_INIT(LTM_SIZE_CURRENT, UINT64, "memory size", TOKU_ENGINE_STATUS);
STATUS_INIT(LTM_SIZE_LIMIT, 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_TIME, 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_NUM_LOCKTREES, 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_STO_NUM_ELIGIBLE, 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_TIME, TOKUTIME, "time spent ending the STO early (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(LTM_SIZE_CURRENT, nullptr, UINT64, "memory size", TOKU_ENGINE_STATUS);
STATUS_INIT(LTM_SIZE_LIMIT, nullptr, UINT64, "memory size limit", TOKU_ENGINE_STATUS);
STATUS_INIT(LTM_ESCALATION_COUNT, nullptr, UINT64, "number of times lock escalation ran", TOKU_ENGINE_STATUS);
STATUS_INIT(LTM_ESCALATION_TIME, nullptr, TOKUTIME, "time spent running escalation (seconds)", TOKU_ENGINE_STATUS);
STATUS_INIT(LTM_ESCALATION_LATEST_RESULT, nullptr, UINT64, "latest post-escalation memory size", TOKU_ENGINE_STATUS);
STATUS_INIT(LTM_NUM_LOCKTREES, nullptr, UINT64, "number of locktrees open now", 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, nullptr, UINT64, "number of locktrees eligible for the STO", 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, nullptr, TOKUTIME, "time spent ending the STO early (seconds)", TOKU_ENGINE_STATUS);
status.initialized = true;
}
......
......@@ -38,21 +38,21 @@
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
status_init(void) {
// Note, this function initializes the keyname, type, and legend fields.
// 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_FAIL, 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_FAIL, 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_FAIL, 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_CURRENT, 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_CREATE, nullptr, UINT64, "number of indexers successfully created", 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, nullptr, UINT64, "number of calls to indexer->build() succeeded", TOKU_ENGINE_STATUS);
STATUS_INIT(INDEXER_BUILD_FAIL, nullptr, UINT64, "number of calls to indexer->build() failed", 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, nullptr, UINT64, "number of calls to indexer->close() that failed", TOKU_ENGINE_STATUS);
STATUS_INIT(INDEXER_ABORT, nullptr, UINT64, "number of calls to indexer->abort()", TOKU_ENGINE_STATUS);
STATUS_INIT(INDEXER_CURRENT, nullptr, UINT64, "number of indexers currently in existence", TOKU_ENGINE_STATUS);
STATUS_INIT(INDEXER_MAX, nullptr, UINT64, "max number of indexers that ever existed simultaneously", TOKU_ENGINE_STATUS);
indexer_status.initialized = true;
}
#undef STATUS_INIT
......
......@@ -41,21 +41,21 @@ enum {MAX_FILE_SIZE=256};
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
status_init(void) {
// Note, this function initializes the keyname, type, and legend fields.
// 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_FAIL, 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_FAIL, 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_FAIL, 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_CURRENT, 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_CREATE, nullptr, UINT64, "number of loaders successfully created", 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, nullptr, UINT64, "number of calls to loader->put() succeeded", TOKU_ENGINE_STATUS);
STATUS_INIT(LOADER_PUT_FAIL, nullptr, UINT64, "number of calls to loader->put() failed", 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, nullptr, UINT64, "number of calls to loader->close() that failed", TOKU_ENGINE_STATUS);
STATUS_INIT(LOADER_ABORT, nullptr, UINT64, "number of calls to loader->abort()", TOKU_ENGINE_STATUS);
STATUS_INIT(LOADER_CURRENT, nullptr, UINT64, "number of loaders currently in existence", TOKU_ENGINE_STATUS);
STATUS_INIT(LOADER_MAX, nullptr, UINT64, "max number of loaders that ever existed simultaneously", TOKU_ENGINE_STATUS);
loader_status.initialized = true;
}
#undef STATUS_INIT
......
......@@ -94,6 +94,7 @@ test_main (int argc, char * const argv[]) {
printf("First all the raw fields:\n");
for (uint64_t i = 0; i < nrows; i++) {
printf("%s ", mystat[i].keyname);
printf("%s ", mystat[i].columnname ? mystat[i].columnname : "(null)");
printf("%s ", mystat[i].legend);
printf("type=%d val = ", mystat[i].type);
switch(mystat[i].type) {
......
......@@ -111,21 +111,21 @@ typedef struct {
static YDB_LAYER_STATUS_S ydb_layer_status;
#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
ydb_layer_status_init (void) {
// Note, this function initializes the keyname, type, and legend fields.
// 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_STARTUP, UNIXTIME, "time of engine startup", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_TIME_NOW, 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_CLOSE, 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_MAX_OPEN_DBS, 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_TIME_CREATION, nullptr, UNIXTIME, "time of environment creation", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_TIME_STARTUP, nullptr, UNIXTIME, "time of engine startup", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_TIME_NOW, nullptr, UNIXTIME, "time now", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_DB_OPEN, nullptr, UINT64, "db opens", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_DB_CLOSE, nullptr, UINT64, "db closes", 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, nullptr, UINT64, "max open dbs", 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);
ydb_layer_status.initialized = true;
......@@ -500,18 +500,18 @@ typedef struct {
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
persistent_upgrade_status_init (void) {
// Note, this function initializes the keyname, type, and legend fields.
// 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_STORED_ENV_VERSION_AT_STARTUP, 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_V14_TIME, 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_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, nullptr, UINT64, "version at time of startup", 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, nullptr, UNIXTIME, "time of upgrade to version 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;
}
......@@ -1696,17 +1696,17 @@ typedef struct {
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
fs_status_init(void) {
FS_STATUS_INIT(FS_ENOSPC_REDZONE_STATE, 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_REDZONE_CTR, 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_COUNT, 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_COUNT, UINT64, "fsync count", 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, nullptr, UINT64, "threads currently blocked by full disk", 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, nullptr, UNIXTIME, "most recent disk full", 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, nullptr, UINT64, "fsync time", TOKU_ENGINE_STATUS);
FS_STATUS_INIT(FS_FSYNC_COUNT, nullptr, UINT64, "fsync count", TOKU_ENGINE_STATUS);
fsstat.initialized = true;
}
#undef FS_STATUS_INIT
......@@ -1761,23 +1761,23 @@ typedef struct {
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
memory_status_init(void) {
// Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler.
STATUS_INIT(MEMORY_MALLOC_COUNT, UINT64, "number of malloc operations", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_FREE_COUNT, UINT64, "number of free operations", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_REALLOC_COUNT, 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_REALLOC_FAIL, 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_USED, 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_MAX_IN_USE, UINT64, "estimated maximum memory footprint", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_MALLOCATOR_VERSION, CHARSTR, "mallocator version", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_MMAP_THRESHOLD, UINT64, "mmap threshold", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_MALLOC_COUNT, nullptr, UINT64, "number of malloc operations", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_FREE_COUNT, nullptr, UINT64, "number of free operations", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_REALLOC_COUNT, nullptr, UINT64, "number of realloc operations", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_MALLOC_FAIL, nullptr, UINT64, "number of malloc 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, nullptr, UINT64, "number of bytes requested", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_USED, nullptr, UINT64, "number of bytes used (requested + overhead)", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_FREED, nullptr, UINT64, "number of bytes freed", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_MAX_IN_USE, nullptr, UINT64, "estimated maximum memory footprint", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_MALLOCATOR_VERSION, nullptr, CHARSTR, "mallocator version", TOKU_ENGINE_STATUS);
STATUS_INIT(MEMORY_MMAP_THRESHOLD, nullptr, UINT64, "mmap threshold", TOKU_ENGINE_STATUS);
memory_status.initialized = true;
}
#undef STATUS_INIT
......
......@@ -19,7 +19,7 @@ static YDB_C_LAYER_STATUS_S ydb_c_layer_status;
#endif
#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
ydb_c_layer_status_init (void) {
......
......@@ -29,17 +29,17 @@ static YDB_DB_LAYER_STATUS_S ydb_db_layer_status;
#endif
#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
ydb_db_layer_status_init (void) {
// Note, this function initializes the keyname, type, and legend fields.
// 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_FAIL, UINT64, "directory write locks fail", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_LOGSUPPRESS, UINT64, "log suppress", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_LOGSUPPRESS_FAIL, UINT64, "log suppress fail", 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, nullptr, UINT64, "directory write locks fail", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_LOGSUPPRESS, nullptr, UINT64, "log suppress", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_LOGSUPPRESS_FAIL, nullptr, UINT64, "log suppress fail", TOKU_ENGINE_STATUS);
ydb_db_layer_status.initialized = true;
}
#undef STATUS_INIT
......
......@@ -21,26 +21,26 @@ static YDB_WRITE_LAYER_STATUS_S ydb_write_layer_status;
#endif
#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
ydb_write_layer_status_init (void) {
// Note, this function initializes the keyname, type, and legend fields.
// 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_FAIL, 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_FAIL, 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_FAIL, 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_FAIL, 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_FAIL, 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_FAIL, 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_FAIL, UINT64, "dictionary updates multi fail", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_INSERTS, nullptr, UINT64, "dictionary inserts", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_INSERTS_FAIL, nullptr, UINT64, "dictionary inserts fail", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_DELETES, nullptr, UINT64, "dictionary deletes", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_DELETES_FAIL, nullptr, UINT64, "dictionary deletes fail", TOKU_ENGINE_STATUS);
STATUS_INIT(YDB_LAYER_NUM_UPDATES, nullptr, UINT64, "dictionary updates", 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, nullptr, UINT64, "dictionary broadcast updates", 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, nullptr, UINT64, "dictionary multi inserts", 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, nullptr, UINT64, "dictionary multi deletes", 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, nullptr, UINT64, "dictionary updates multi", 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;
}
#undef STATUS_INIT
......
......@@ -58,11 +58,18 @@ void partitioned_counters_init(void);
void partitioned_counters_destroy(void);
// 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].columnname = #c; \
array.status[k].type = t; \
array.status[k].legend = l; \
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); \
if (t == PARCOUNT) { \
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