Added printHealth to IBackend interface.

This commit is contained in:
XMRig 2020-02-14 01:11:53 +07:00
parent 56f23db878
commit 2f27d5d108
No known key found for this signature in database
GPG key ID: 446A53638BE94409
8 changed files with 54 additions and 44 deletions

View file

@ -324,13 +324,8 @@ const xmrig::String &xmrig::OclBackend::type() const
}
void xmrig::OclBackend::execCommand(char command)
void xmrig::OclBackend::execCommand(char)
{
# ifdef XMRIG_FEATURE_ADL
if (command == 'e' || command == 'E') {
d_ptr->printHealth();
}
# endif
}
@ -373,6 +368,14 @@ void xmrig::OclBackend::printHashrate(bool details)
}
void xmrig::OclBackend::printHealth()
{
# ifdef XMRIG_FEATURE_ADL
d_ptr->printHealth();
# endif
}
void xmrig::OclBackend::setJob(const Job &job)
{
const auto &cl = d_ptr->controller->config()->cl();
@ -449,15 +452,6 @@ void xmrig::OclBackend::stop()
void xmrig::OclBackend::tick(uint64_t ticks)
{
d_ptr->workers.tick(ticks);
# ifdef XMRIG_FEATURE_ADL
if (isEnabled()) {
auto seconds = d_ptr->controller->config()->healthPrintTime();
if (seconds && ticks && (ticks % (seconds * 2)) == 0) {
d_ptr->printHealth();
}
}
# endif
}