mirror of
https://github.com/isar/libmdbx.git
synced 2025-12-18 17:52:22 +08:00
mdbx-test: refix logging.
Change-Id: I8852cca84669b4da2a994f2d5d2cec833e21f2f6
This commit is contained in:
@@ -314,7 +314,7 @@ const struct option_verb table_bits[] = {
|
||||
|
||||
static void dump_verbs(const char *caption, size_t bits,
|
||||
const struct option_verb *verbs) {
|
||||
log_info("%s: 0x%" PRIx64 " = ", caption, (uint64_t)bits);
|
||||
log_verbose("%s: 0x%" PRIx64 " = ", caption, (uint64_t)bits);
|
||||
|
||||
const char *comma = "";
|
||||
while (verbs->mask && bits) {
|
||||
@@ -330,7 +330,7 @@ static void dump_verbs(const char *caption, size_t bits,
|
||||
}
|
||||
|
||||
static void dump_duration(const char *caption, unsigned duration) {
|
||||
log_info("%s: ", caption);
|
||||
log_verbose("%s: ", caption);
|
||||
if (duration) {
|
||||
if (duration > 24 * 3600)
|
||||
logging::feed("%u_", duration / (24 * 3600));
|
||||
@@ -347,84 +347,86 @@ void dump(const char *title) {
|
||||
logging::local_suffix indent(title);
|
||||
|
||||
for (auto i = global::actors.begin(); i != global::actors.end(); ++i) {
|
||||
log_info("#%u, testcase %s, space_id/table %u\n", i->actor_id,
|
||||
testcase2str(i->testcase), i->space_id);
|
||||
log_verbose("#%u, testcase %s, space_id/table %u\n", i->actor_id,
|
||||
testcase2str(i->testcase), i->space_id);
|
||||
indent.push();
|
||||
|
||||
if (i->params.loglevel) {
|
||||
log_info("log: level %u, %s\n", i->params.loglevel,
|
||||
i->params.pathname_log.empty() ? "console"
|
||||
: i->params.pathname_log.c_str());
|
||||
log_verbose("log: level %u, %s\n", i->params.loglevel,
|
||||
i->params.pathname_log.empty()
|
||||
? "console"
|
||||
: i->params.pathname_log.c_str());
|
||||
}
|
||||
|
||||
log_info("database: %s, size %" PRIuPTR "[%" PRIiPTR "..%" PRIiPTR
|
||||
", %i %i, %i]\n",
|
||||
i->params.pathname_db.c_str(), i->params.size_now,
|
||||
i->params.size_lower, i->params.size_upper,
|
||||
i->params.shrink_threshold, i->params.growth_step,
|
||||
i->params.pagesize);
|
||||
log_verbose("database: %s, size %" PRIuPTR "[%" PRIiPTR "..%" PRIiPTR
|
||||
", %i %i, %i]\n",
|
||||
i->params.pathname_db.c_str(), i->params.size_now,
|
||||
i->params.size_lower, i->params.size_upper,
|
||||
i->params.shrink_threshold, i->params.growth_step,
|
||||
i->params.pagesize);
|
||||
|
||||
dump_verbs("mode", i->params.mode_flags, mode_bits);
|
||||
dump_verbs("table", i->params.table_flags, table_bits);
|
||||
|
||||
if (i->params.test_nops)
|
||||
log_info("iterations/records %u\n", i->params.test_nops);
|
||||
log_verbose("iterations/records %u\n", i->params.test_nops);
|
||||
else
|
||||
dump_duration("duration", i->params.test_duration);
|
||||
|
||||
if (i->params.nrepeat)
|
||||
log_info("repeat %u\n", i->params.nrepeat);
|
||||
log_verbose("repeat %u\n", i->params.nrepeat);
|
||||
else
|
||||
log_info("repeat ETERNALLY\n");
|
||||
log_verbose("repeat ETERNALLY\n");
|
||||
|
||||
log_info("threads %u\n", i->params.nthreads);
|
||||
log_verbose("threads %u\n", i->params.nthreads);
|
||||
|
||||
log_info(
|
||||
log_verbose(
|
||||
"keygen.params: case %s, width %u, mesh %u, rotate %u, offset %" PRIu64
|
||||
", split %u/%u\n",
|
||||
keygencase2str(i->params.keygen.keycase), i->params.keygen.width,
|
||||
i->params.keygen.mesh, i->params.keygen.rotate, i->params.keygen.offset,
|
||||
i->params.keygen.split,
|
||||
i->params.keygen.width - i->params.keygen.split);
|
||||
log_info("keygen.seed: %u\n", i->params.keygen.seed);
|
||||
log_info("key: minlen %u, maxlen %u\n", i->params.keylen_min,
|
||||
i->params.keylen_max);
|
||||
log_info("data: minlen %u, maxlen %u\n", i->params.datalen_min,
|
||||
i->params.datalen_max);
|
||||
log_verbose("keygen.seed: %u\n", i->params.keygen.seed);
|
||||
log_verbose("key: minlen %u, maxlen %u\n", i->params.keylen_min,
|
||||
i->params.keylen_max);
|
||||
log_verbose("data: minlen %u, maxlen %u\n", i->params.datalen_min,
|
||||
i->params.datalen_max);
|
||||
|
||||
log_info("batch: read %u, write %u\n", i->params.batch_read,
|
||||
i->params.batch_write);
|
||||
log_verbose("batch: read %u, write %u\n", i->params.batch_read,
|
||||
i->params.batch_write);
|
||||
|
||||
if (i->params.waitfor_nops)
|
||||
log_info("wait: actor %u for %u ops\n", i->wait4id,
|
||||
i->params.waitfor_nops);
|
||||
log_verbose("wait: actor %u for %u ops\n", i->wait4id,
|
||||
i->params.waitfor_nops);
|
||||
else if (i->params.delaystart)
|
||||
dump_duration("delay", i->params.delaystart);
|
||||
else
|
||||
log_info("no-delay\n");
|
||||
log_verbose("no-delay\n");
|
||||
|
||||
if (i->params.inject_writefaultn)
|
||||
log_info("inject-writefault on %u ops\n", i->params.inject_writefaultn);
|
||||
log_verbose("inject-writefault on %u ops\n",
|
||||
i->params.inject_writefaultn);
|
||||
else
|
||||
log_info("no-inject-writefault\n");
|
||||
log_verbose("no-inject-writefault\n");
|
||||
|
||||
log_info("limits: readers %u, tables %u\n", i->params.max_readers,
|
||||
i->params.max_tables);
|
||||
log_verbose("limits: readers %u, tables %u\n", i->params.max_readers,
|
||||
i->params.max_tables);
|
||||
|
||||
log_info("drop table: %s\n", i->params.drop_table ? "Yes" : "No");
|
||||
log_info("ignore MDBX_MAP_FULL error: %s\n",
|
||||
i->params.ignore_dbfull ? "Yes" : "No");
|
||||
log_verbose("drop table: %s\n", i->params.drop_table ? "Yes" : "No");
|
||||
log_verbose("ignore MDBX_MAP_FULL error: %s\n",
|
||||
i->params.ignore_dbfull ? "Yes" : "No");
|
||||
indent.pop();
|
||||
}
|
||||
|
||||
dump_duration("timeout", global::config::timeout_duration_seconds);
|
||||
log_info("cleanup: before %s, after %s\n",
|
||||
global::config::cleanup_before ? "Yes" : "No",
|
||||
global::config::cleanup_after ? "Yes" : "No");
|
||||
log_verbose("cleanup: before %s, after %s\n",
|
||||
global::config::cleanup_before ? "Yes" : "No",
|
||||
global::config::cleanup_after ? "Yes" : "No");
|
||||
|
||||
log_info("failfast: %s\n", global::config::failfast ? "Yes" : "No");
|
||||
log_info("progress indicator: %s\n",
|
||||
global::config::progress_indicator ? "Yes" : "No");
|
||||
log_verbose("failfast: %s\n", global::config::failfast ? "Yes" : "No");
|
||||
log_verbose("progress indicator: %s\n",
|
||||
global::config::progress_indicator ? "Yes" : "No");
|
||||
}
|
||||
|
||||
} /* namespace config */
|
||||
|
||||
Reference in New Issue
Block a user