Fix hugepage status in popup

This commit is contained in:
Ben Gräf 2018-07-18 21:58:00 +02:00
parent 1b69dfc0e5
commit c04f773222
3 changed files with 21 additions and 6 deletions

View file

@ -567,7 +567,8 @@
tooltip += '\n'; tooltip += '\n';
tooltip += "CPU Cache L2/L3: " + (row.client_status.cpu_l2 / 1024) + " MB/"+ (row.client_status.cpu_l3 / 1024) + " MB"; tooltip += "CPU Cache L2/L3: " + (row.client_status.cpu_l2 / 1024) + " MB/"+ (row.client_status.cpu_l3 / 1024) + " MB";
tooltip += '\n'; tooltip += '\n';
tooltip += "Huge Pages: " + (row.client_status.hugepages_available ? " available" : " unavailable"); tooltip += "Huge Pages: " + (row.client_status.hugepages_available ? " available, " : " unavailable, ");
tooltip += (row.client_status.hugepages_enabled ? "enabled (" + row.client_status.total_hugepages + "/" + row.client_status.total_pages + ")" : "disabled");
tooltip += '\n'; tooltip += '\n';
tooltip += "Used Threads: " + row.client_status.current_threads; tooltip += "Used Threads: " + row.client_status.current_threads;
tooltip += (row.client_status.hash_factor > 1 ? " [" + row.client_status.hash_factor + "x multi hash mode]" :""); tooltip += (row.client_status.hash_factor > 1 ? " [" + row.client_status.hash_factor + "x multi hash mode]" :"");

View file

@ -426,10 +426,6 @@ bool ClientStatus::parseFromJson(const rapidjson::Document& document)
m_isHugepagesEnabled = clientStatus["hugepages_enabled"].GetBool(); m_isHugepagesEnabled = clientStatus["hugepages_enabled"].GetBool();
} }
if (clientStatus.HasMember("hash_factor")) {
m_hashFactor = clientStatus["hash_factor"].GetInt();
}
if (clientStatus.HasMember("cpu_is_x64")) { if (clientStatus.HasMember("cpu_is_x64")) {
m_isCpuX64 = clientStatus["cpu_is_x64"].GetBool(); m_isCpuX64 = clientStatus["cpu_is_x64"].GetBool();
} }
@ -454,6 +450,18 @@ bool ClientStatus::parseFromJson(const rapidjson::Document& document)
m_hashrateHighest = clientStatus["hashrate_highest"].GetDouble(); m_hashrateHighest = clientStatus["hashrate_highest"].GetDouble();
} }
if (clientStatus.HasMember("hash_factor")) {
m_hashFactor = clientStatus["hash_factor"].GetInt();
}
if (clientStatus.HasMember("total_pages")) {
m_totalPages = clientStatus["total_pages"].GetInt();
}
if (clientStatus.HasMember("total_hugepages")) {
m_totalHugepages = clientStatus["total_hugepages"].GetInt();
}
if (clientStatus.HasMember("current_threads")) { if (clientStatus.HasMember("current_threads")) {
m_currentThreads = clientStatus["current_threads"].GetInt(); m_currentThreads = clientStatus["current_threads"].GetInt();
} }
@ -525,7 +533,6 @@ rapidjson::Value ClientStatus::toJson(rapidjson::MemoryPoolAllocator<rapidjson::
clientStatus.AddMember("hugepages_available", m_hasHugepages, allocator); clientStatus.AddMember("hugepages_available", m_hasHugepages, allocator);
clientStatus.AddMember("hugepages_enabled", m_isHugepagesEnabled, allocator); clientStatus.AddMember("hugepages_enabled", m_isHugepagesEnabled, allocator);
clientStatus.AddMember("hash_factor", m_hashFactor, allocator);
clientStatus.AddMember("cpu_is_x64", m_isCpuX64, allocator); clientStatus.AddMember("cpu_is_x64", m_isCpuX64, allocator);
clientStatus.AddMember("cpu_has_aes", m_hasCpuAES, allocator); clientStatus.AddMember("cpu_has_aes", m_hasCpuAES, allocator);
@ -534,6 +541,9 @@ rapidjson::Value ClientStatus::toJson(rapidjson::MemoryPoolAllocator<rapidjson::
clientStatus.AddMember("hashrate_long", m_hashrateLong, allocator); clientStatus.AddMember("hashrate_long", m_hashrateLong, allocator);
clientStatus.AddMember("hashrate_highest", m_hashrateHighest, allocator); clientStatus.AddMember("hashrate_highest", m_hashrateHighest, allocator);
clientStatus.AddMember("hash_factor", m_hashFactor, allocator);
clientStatus.AddMember("total_pages", m_totalPages, allocator);
clientStatus.AddMember("total_hugepages", m_totalHugepages, allocator);
clientStatus.AddMember("current_threads", m_currentThreads, allocator); clientStatus.AddMember("current_threads", m_currentThreads, allocator);
clientStatus.AddMember("cpu_sockets", m_cpuSockets, allocator); clientStatus.AddMember("cpu_sockets", m_cpuSockets, allocator);
clientStatus.AddMember("cpu_cores", m_cpuCores, allocator); clientStatus.AddMember("cpu_cores", m_cpuCores, allocator);

View file

@ -228,6 +228,10 @@ unsigned Service::setClientStatus(const std::string& clientIp, const std::string
clientStatus.parseFromJson(document); clientStatus.parseFromJson(document);
clientStatus.setExternalIp(clientIp); clientStatus.setExternalIp(clientIp);
if (m_clientStatus.find(clientId) == m_clientStatus.end()) {
m_clientCommand[clientId] = ControlCommand(ControlCommand::RESTART);
}
m_clientStatus[clientId] = clientStatus; m_clientStatus[clientId] = clientStatus;
resultCode = getClientCommand(clientId, resp); resultCode = getClientCommand(clientId, resp);