Added pool stats

This commit is contained in:
SChernykh
2021-09-01 16:26:56 +02:00
parent 295cbda449
commit 533cc202d2
7 changed files with 82 additions and 25 deletions

View File

@@ -146,22 +146,32 @@ void ConsoleCommands::run()
do {
std::getline(std::cin, command);
if (stopped || std::cin.eof()) {
if (std::cin.eof()) {
LOGINFO(1, "EOF, stopping");
return;
}
int i;
for (i=0; cmds[i].name.len; i++) {
if (!strncmp(command.c_str(), cmds[i].name.str, cmds[i].name.len)) {
const char *args = command.c_str() + cmds[i].name.len + 1;
int rc = cmds[i].func(m_pool, args);
if ( rc )
if (stopped) {
LOGINFO(1, "stopping");
return;
}
cmd* c = cmds;
for (; c->name.len; ++c) {
if (!strncmp(command.c_str(), c->name.str, c->name.len)) {
const char *args = command.c_str() + c->name.len + 1;
if (c->func(m_pool, args)) {
LOGINFO(1, "exit requested, stopping");
return;
}
break;
}
}
if (!cmds[i].name.len)
if (!c->name.len) {
LOGWARN(0, "Unknown command " << command);
}
} while (true);
}