Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add INFO comment when DB not scaned #1956

Merged
merged 8 commits into from
Jan 3, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/server/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,11 @@ void Server::GetInfo(const std::string &ns, const std::string &section, std::str

if (section_cnt++) string_stream << "\r\n";
string_stream << "# Keyspace\r\n";
string_stream << "# Last scan db time: " << std::put_time(&last_scan_tm, "%a %b %e %H:%M:%S %Y") << "\r\n";
if (last_scan_time == 0) {
string_stream << "# WARN: DB not scan, run `dbsize scan` command first.\r\n";
} else {
string_stream << "# Last scan DB time: " << std::put_time(&last_scan_tm, "%a %b %e %H:%M:%S %Y") << "\r\n";
jihuayu marked this conversation as resolved.
Show resolved Hide resolved
}
PragmaTwice marked this conversation as resolved.
Show resolved Hide resolved
string_stream << "db0:keys=" << stats.n_key << ",expires=" << stats.n_expires << ",avg_ttl=" << stats.avg_ttl
<< ",expired=" << stats.n_expired << "\r\n";
string_stream << "sequence:" << storage->GetDB()->GetLatestSequenceNumber() << "\r\n";
Expand Down