mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-18 10:01:06 +00:00
Sync changes with AMD miner.
This commit is contained in:
parent
eec5ca5535
commit
cac240104e
1 changed files with 6 additions and 3 deletions
|
@ -293,13 +293,16 @@ void ApiRouter::getThreads(rapidjson::Document &doc) const
|
|||
const std::vector<xmrig::IThread *> &threads = m_controller->config()->threads();
|
||||
rapidjson::Value list(rapidjson::kArrayType);
|
||||
|
||||
size_t i = 0;
|
||||
for (const xmrig::IThread *thread : threads) {
|
||||
rapidjson::Value value = thread->toAPI(doc);
|
||||
|
||||
rapidjson::Value hashrate(rapidjson::kArrayType);
|
||||
hashrate.PushBack(normalize(hr->calc(thread->index(), Hashrate::ShortInterval)), allocator);
|
||||
hashrate.PushBack(normalize(hr->calc(thread->index(), Hashrate::MediumInterval)), allocator);
|
||||
hashrate.PushBack(normalize(hr->calc(thread->index(), Hashrate::LargeInterval)), allocator);
|
||||
hashrate.PushBack(normalize(hr->calc(i, Hashrate::ShortInterval)), allocator);
|
||||
hashrate.PushBack(normalize(hr->calc(i, Hashrate::MediumInterval)), allocator);
|
||||
hashrate.PushBack(normalize(hr->calc(i, Hashrate::LargeInterval)), allocator);
|
||||
|
||||
i++;
|
||||
|
||||
value.AddMember("hashrate", hashrate, allocator);
|
||||
list.PushBack(value, allocator);
|
||||
|
|
Loading…
Reference in a new issue