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();
|
const std::vector<xmrig::IThread *> &threads = m_controller->config()->threads();
|
||||||
rapidjson::Value list(rapidjson::kArrayType);
|
rapidjson::Value list(rapidjson::kArrayType);
|
||||||
|
|
||||||
|
size_t i = 0;
|
||||||
for (const xmrig::IThread *thread : threads) {
|
for (const xmrig::IThread *thread : threads) {
|
||||||
rapidjson::Value value = thread->toAPI(doc);
|
rapidjson::Value value = thread->toAPI(doc);
|
||||||
|
|
||||||
rapidjson::Value hashrate(rapidjson::kArrayType);
|
rapidjson::Value hashrate(rapidjson::kArrayType);
|
||||||
hashrate.PushBack(normalize(hr->calc(thread->index(), Hashrate::ShortInterval)), allocator);
|
hashrate.PushBack(normalize(hr->calc(i, Hashrate::ShortInterval)), allocator);
|
||||||
hashrate.PushBack(normalize(hr->calc(thread->index(), Hashrate::MediumInterval)), allocator);
|
hashrate.PushBack(normalize(hr->calc(i, Hashrate::MediumInterval)), allocator);
|
||||||
hashrate.PushBack(normalize(hr->calc(thread->index(), Hashrate::LargeInterval)), allocator);
|
hashrate.PushBack(normalize(hr->calc(i, Hashrate::LargeInterval)), allocator);
|
||||||
|
|
||||||
|
i++;
|
||||||
|
|
||||||
value.AddMember("hashrate", hashrate, allocator);
|
value.AddMember("hashrate", hashrate, allocator);
|
||||||
list.PushBack(value, allocator);
|
list.PushBack(value, allocator);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue