Added 250K and 500K offline benchmarks.

This commit is contained in:
XMRig 2020-11-12 11:15:43 +07:00
parent 837bd1a43c
commit e3727f01b8
No known key found for this signature in database
GPG key ID: 446A53638BE94409
5 changed files with 60 additions and 17 deletions

View file

@ -70,6 +70,16 @@ bool xmrig::Pools::isEqual(const Pools &other) const
}
int xmrig::Pools::donateLevel() const
{
# ifdef XMRIG_FEATURE_BENCHMARK
return benchSize() || (m_benchmark && !m_benchmark->id().isEmpty()) ? 0 : m_donateLevel;
# else
return m_donateLevel;
# endif
}
xmrig::IStrategy *xmrig::Pools::createStrategy(IStrategyListener *listener) const
{
if (active() == 1) {

View file

@ -58,7 +58,6 @@ public:
Pools();
inline const std::vector<Pool> &data() const { return m_data; }
inline int donateLevel() const { return benchSize() ? 0 : m_donateLevel; }
inline int retries() const { return m_retries; }
inline int retryPause() const { return m_retryPause; }
inline ProxyDonate proxyDonate() const { return m_proxyDonate; }
@ -67,6 +66,7 @@ public:
inline bool operator==(const Pools &other) const { return isEqual(other); }
bool isEqual(const Pools &other) const;
int donateLevel() const;
IStrategy *createStrategy(IStrategyListener *listener) const;
rapidjson::Value toJSON(rapidjson::Document &doc) const;
size_t active() const;

View file

@ -96,9 +96,13 @@ uint32_t xmrig::BenchConfig::getSize(const char *benchmark)
}
const auto size = strtoul(benchmark, nullptr, 10);
if (size < 1 || size > 10) {
return 0;
if (size >= 1 && size <= 10) {
return strcasecmp(benchmark, fmt::format("{}M", size).c_str()) == 0 ? size * 1000000 : 0;
}
return strcasecmp(benchmark, fmt::format("{}M", size).c_str()) == 0 ? size * 1000000 : 0;
if (size == 250 || size == 500) {
return strcasecmp(benchmark, fmt::format("{}K", size).c_str()) == 0 ? size * 1000 : 0;
}
return 0;
}