Commit df6db990 authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

[t:2905] Add upgrade info and environment creation timestamp to engine status.

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@25400 c7de825b-a66e-492c-adef-691d508d4ae1
parent 27368bca
...@@ -918,6 +918,26 @@ static int tokudb_get_user_data_size(THD *thd, bool exact, u_int64_t *data_size_ ...@@ -918,6 +918,26 @@ static int tokudb_get_user_data_size(THD *thd, bool exact, u_int64_t *data_size_
return error; return error;
} }
/*** to be used when timestamps are sent in engine status as u_int64_t instead of as char strings
static void
format_time(u_int64_t time64, char *buf) {
time_t timer = (time_t) time64;
ctime_r(&timer, buf);
size_t len = strlen(buf);
assert(len < 26);
char end;
assert(len>=1);
end = buf[len-1];
while (end == '\n' || end == '\r') {
buf[len-1] = '\0';
len--;
assert(len>=1);
end = buf[len-1];
}
}
***/
#define STATPRINT(legend, val) stat_print(thd, \ #define STATPRINT(legend, val) stat_print(thd, \
tokudb_hton_name, \ tokudb_hton_name, \
tokudb_hton_name_length, \ tokudb_hton_name_length, \
...@@ -954,6 +974,7 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) { ...@@ -954,6 +974,7 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) {
} }
STATPRINT ("disk free space", buf); STATPRINT ("disk free space", buf);
STATPRINT("time of environment creation", engstat.creationtime);
STATPRINT("time of engine startup", engstat.startuptime); STATPRINT("time of engine startup", engstat.startuptime);
STATPRINT("time now", engstat.now); STATPRINT("time now", engstat.now);
...@@ -1135,7 +1156,6 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) { ...@@ -1135,7 +1156,6 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) {
snprintf(buf, bufsiz, "%" PRIu64, engstat.logsuppressfail); snprintf(buf, bufsiz, "%" PRIu64, engstat.logsuppressfail);
STATPRINT("log suppress fail", buf); STATPRINT("log suppress fail", buf);
#if 0
// patched out until upgrade logic is in product // patched out until upgrade logic is in product
snprintf(buf, bufsiz, "%" PRIu64, engstat.upgrade_env_status); snprintf(buf, bufsiz, "%" PRIu64, engstat.upgrade_env_status);
STATPRINT("upgrade env status", buf); STATPRINT("upgrade env status", buf);
...@@ -1145,7 +1165,14 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) { ...@@ -1145,7 +1165,14 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) {
STATPRINT("upgrade nonleaf", buf); STATPRINT("upgrade nonleaf", buf);
snprintf(buf, bufsiz, "%" PRIu64, engstat.upgrade_leaf); snprintf(buf, bufsiz, "%" PRIu64, engstat.upgrade_leaf);
STATPRINT("upgrade leaf", buf); STATPRINT("upgrade leaf", buf);
#endif
snprintf(buf, bufsiz, "%" PRIu64, engstat.original_ver);
STATPRINT("original version", buf);
snprintf(buf, bufsiz, "%" PRIu64, engstat.ver_at_startup);
STATPRINT("version at startup", buf);
snprintf(buf, bufsiz, "%" PRIu64, engstat.last_lsn_v12);
STATPRINT("last LSN of version 12", buf);
STATPRINT("time of upgrade to version 13", engstat.upgrade_v13_time);
} }
if (error) { my_errno = error; } if (error) { my_errno = error; }
TOKUDB_DBUG_RETURN(error); TOKUDB_DBUG_RETURN(error);
......
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