mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-22 10:45:06 +00:00
Added support for --user command line option for the benchmark.
This commit is contained in:
parent
6bb29b3e7b
commit
748be760e8
4 changed files with 13 additions and 3 deletions
|
@ -334,6 +334,7 @@ void xmrig::BenchClient::send(Request request)
|
|||
{
|
||||
doc.AddMember(StringRef(BenchConfig::kSize), m_benchmark->size(), allocator);
|
||||
doc.AddMember(StringRef(BenchConfig::kAlgo), m_benchmark->algorithm().toJSON(), allocator);
|
||||
doc.AddMember(StringRef(BenchConfig::kUser), m_benchmark->user().toJSON(), allocator);
|
||||
doc.AddMember("version", APP_VERSION, allocator);
|
||||
doc.AddMember("threads", m_threads, allocator);
|
||||
doc.AddMember("steady_ready_ts", m_readyTime, allocator);
|
||||
|
|
|
@ -41,6 +41,7 @@ const char *BenchConfig::kSeed = "seed";
|
|||
const char *BenchConfig::kSize = "size";
|
||||
const char *BenchConfig::kSubmit = "submit";
|
||||
const char *BenchConfig::kToken = "token";
|
||||
const char *BenchConfig::kUser = "user";
|
||||
const char *BenchConfig::kVerify = "verify";
|
||||
|
||||
#ifndef XMRIG_DEBUG_BENCHMARK_API
|
||||
|
@ -59,8 +60,8 @@ xmrig::BenchConfig::BenchConfig(uint32_t size, const String &id, const rapidjson
|
|||
m_id(id),
|
||||
m_seed(Json::getString(object, kSeed)),
|
||||
m_token(Json::getString(object, kToken)),
|
||||
m_size(size),
|
||||
m_hash(0)
|
||||
m_user(Json::getString(object, kUser)),
|
||||
m_size(size)
|
||||
{
|
||||
if (!m_algorithm.isValid() || m_algorithm.family() != Algorithm::RANDOM_X) {
|
||||
m_algorithm = Algorithm::RX_0;
|
||||
|
@ -111,6 +112,7 @@ rapidjson::Value xmrig::BenchConfig::toJSON(rapidjson::Document &doc) const
|
|||
out.AddMember(StringRef(kVerify), m_id.toJSON(), allocator);
|
||||
out.AddMember(StringRef(kToken), m_token.toJSON(), allocator);
|
||||
out.AddMember(StringRef(kSeed), m_seed.toJSON(), allocator);
|
||||
out.AddMember(StringRef(kUser), m_user.toJSON(), allocator);
|
||||
|
||||
if (m_hash) {
|
||||
out.AddMember(StringRef(kHash), Value(fmt::format("{:016X}", m_hash).c_str(), allocator), allocator);
|
||||
|
|
|
@ -39,6 +39,7 @@ public:
|
|||
static const char *kSize;
|
||||
static const char *kSubmit;
|
||||
static const char *kToken;
|
||||
static const char *kUser;
|
||||
static const char *kVerify;
|
||||
|
||||
# ifndef XMRIG_DEBUG_BENCHMARK_API
|
||||
|
@ -59,6 +60,7 @@ public:
|
|||
inline const String &id() const { return m_id; }
|
||||
inline const String &seed() const { return m_seed; }
|
||||
inline const String &token() const { return m_token; }
|
||||
inline const String &user() const { return m_user; }
|
||||
inline uint32_t size() const { return m_size; }
|
||||
inline uint64_t hash() const { return m_hash; }
|
||||
|
||||
|
@ -73,8 +75,9 @@ private:
|
|||
String m_id;
|
||||
String m_seed;
|
||||
String m_token;
|
||||
String m_user;
|
||||
uint32_t m_size;
|
||||
uint64_t m_hash;
|
||||
uint64_t m_hash = 0;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -262,6 +262,7 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
|
|||
case IConfig::BenchTokenKey: /* --token */
|
||||
case IConfig::BenchSeedKey: /* --seed */
|
||||
case IConfig::BenchHashKey: /* --hash */
|
||||
case IConfig::UserKey: /* --user */
|
||||
return transformBenchmark(doc, key, arg);
|
||||
# endif
|
||||
|
||||
|
@ -347,6 +348,9 @@ void xmrig::ConfigTransform::transformBenchmark(rapidjson::Document &doc, int ke
|
|||
|
||||
case IConfig::BenchHashKey: /* --hash */
|
||||
return set(doc, BenchConfig::kBenchmark, BenchConfig::kHash, arg);
|
||||
|
||||
case IConfig::UserKey: /* --user */
|
||||
return set(doc, BenchConfig::kBenchmark, BenchConfig::kUser, arg);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue