Auto merge of #4572 - oxarbitrage:issue4571, r=str4d
Add solution rates aproximation to metrics Closes https://github.com/zcash/zcash/issues/4571
This commit is contained in:
commit
66d4c88943
|
@ -276,6 +276,7 @@ int printStats(bool isScreen, bool mining)
|
||||||
int64_t currentHeadersTime;
|
int64_t currentHeadersTime;
|
||||||
size_t connections;
|
size_t connections;
|
||||||
int64_t netsolps;
|
int64_t netsolps;
|
||||||
|
double netsolpsLog = 1.0;
|
||||||
const Consensus::Params& params = Params().GetConsensus();
|
const Consensus::Params& params = Params().GetConsensus();
|
||||||
{
|
{
|
||||||
LOCK2(cs_main, cs_vNodes);
|
LOCK2(cs_main, cs_vNodes);
|
||||||
|
@ -284,8 +285,12 @@ int printStats(bool isScreen, bool mining)
|
||||||
currentHeadersTime = pindexBestHeader ? pindexBestHeader->nTime : 0;
|
currentHeadersTime = pindexBestHeader ? pindexBestHeader->nTime : 0;
|
||||||
connections = vNodes.size();
|
connections = vNodes.size();
|
||||||
netsolps = GetNetworkHashPS(120, -1);
|
netsolps = GetNetworkHashPS(120, -1);
|
||||||
|
netsolpsLog = std::log2(netsolps);
|
||||||
}
|
}
|
||||||
auto localsolps = GetLocalSolPS();
|
auto localsolps = GetLocalSolPS();
|
||||||
|
double localsolpsLog = 0.0;
|
||||||
|
if (localsolps > 0)
|
||||||
|
localsolpsLog = std::log2(localsolps);
|
||||||
|
|
||||||
if (IsInitialBlockDownload(Params())) {
|
if (IsInitialBlockDownload(Params())) {
|
||||||
if (fReindex) {
|
if (fReindex) {
|
||||||
|
@ -342,9 +347,9 @@ int printStats(bool isScreen, bool mining)
|
||||||
}
|
}
|
||||||
std::cout << " " << _("Next upgrade") << " | " << strUpgradeTime << std::endl;
|
std::cout << " " << _("Next upgrade") << " | " << strUpgradeTime << std::endl;
|
||||||
std::cout << " " << _("Connections") << " | " << connections << std::endl;
|
std::cout << " " << _("Connections") << " | " << connections << std::endl;
|
||||||
std::cout << " " << _("Network solution rate") << " | " << netsolps << " Sol/s" << std::endl;
|
std::cout << " " << _("Network solution rate") << " | " << strprintf("~ 2^%.4f Sol/s", netsolpsLog) << std::endl;
|
||||||
if (mining && miningTimer.running()) {
|
if (mining && miningTimer.running()) {
|
||||||
std::cout << " " << _("Local solution rate") << " | " << strprintf("%.4f Sol/s", localsolps) << std::endl;
|
std::cout << " " << _("Local solution rate") << " | " << strprintf("~ 2^%.4f Sol/s", localsolpsLog) << std::endl;
|
||||||
lines++;
|
lines++;
|
||||||
}
|
}
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
Loading…
Reference in New Issue