mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
stats: don't report network.*hashesPerSecond
if it's zero
It's more likely that the stat is broken than the network running with such low difficulty, the hash rate is reported as zero. `*hashesPerSecond` are a gauge and we should let the last known good value linger instead of potentially overwriting it with an improbable value.
This commit is contained in:
parent
b39c6b9909
commit
40070c0337
10
src/init.cpp
10
src/init.cpp
@ -866,10 +866,12 @@ static void PeriodicStats(NodeContext& node)
|
|||||||
return workDiff.getdouble() / timeDiff;
|
return workDiff.getdouble() / timeDiff;
|
||||||
}();
|
}();
|
||||||
|
|
||||||
::g_stats_client->gaugeDouble("network.hashesPerSecond", nNetworkHashPS);
|
if (nNetworkHashPS > 0.0) {
|
||||||
::g_stats_client->gaugeDouble("network.terahashesPerSecond", nNetworkHashPS / 1e12);
|
::g_stats_client->gaugeDouble("network.hashesPerSecond", nNetworkHashPS);
|
||||||
::g_stats_client->gaugeDouble("network.petahashesPerSecond", nNetworkHashPS / 1e15);
|
::g_stats_client->gaugeDouble("network.terahashesPerSecond", nNetworkHashPS / 1e12);
|
||||||
::g_stats_client->gaugeDouble("network.exahashesPerSecond", nNetworkHashPS / 1e18);
|
::g_stats_client->gaugeDouble("network.petahashesPerSecond", nNetworkHashPS / 1e15);
|
||||||
|
::g_stats_client->gaugeDouble("network.exahashesPerSecond", nNetworkHashPS / 1e18);
|
||||||
|
}
|
||||||
// No need for cs_main, we never use null tip here
|
// No need for cs_main, we never use null tip here
|
||||||
::g_stats_client->gaugeDouble("network.difficulty", (double)GetDifficulty(tip));
|
::g_stats_client->gaugeDouble("network.difficulty", (double)GetDifficulty(tip));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user