Merge pull request #2 from donSchoe/master

Improved statistics output for better readability.
master
Thomas Baumbach 2013-10-20 10:29:32 -07:00
commit aa92b7b925
3 changed files with 31 additions and 26 deletions

View File

@ -5,6 +5,7 @@ file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the [OpenSSL Toolkit](http://www.openssl.org/). This product includes
cryptographic software written by Eric Young ([eay@cryptsoft.com](mailto:eay@cryptsoft.com)), and UPnP software written by Thomas Bernard.
UNIX BUILD NOTES
====================
@ -14,8 +15,6 @@ To Build
cd src/
make -f makefile.unix # Headless bitcoin
See readme-qt.rst for instructions on building Bitcoin-Qt, the graphical user interface.
Dependencies
---------------------
@ -24,6 +23,7 @@ Dependencies
libssl SSL Support Secure communications
libdb4.8 Berkeley DB Blockchain & wallet storage
libboost Boost C++ Library
libgmp Gnu MP Multiprecision arithmetic library developers tools
miniupnpc UPnP Support Optional firewall-jumping support
[miniupnpc](http://miniupnp.free.fr/) may be used for UPnP port mapping. It can be downloaded from [here](
@ -48,15 +48,16 @@ Licenses of statically linked libraries:
- GCC 4.3.3
- OpenSSL 1.0.1c
- Berkeley DB 4.8.30.NC
- Boost 1.37
- Boost 1.48
- GMP 5.0.2
- miniupnpc 1.6
Dependency Build Instructions: Ubuntu & Debian
----------------------------------------------
Build requirements:
sudo apt-get install build-essential
sudo apt-get install libssl-dev
sudo apt-get install build-essential libssl-dev
for Ubuntu 12.04:
@ -69,9 +70,12 @@ for Ubuntu 12.04:
for other Ubuntu & Debian:
sudo apt-get install libgmp-dev
sudo apt-get install libdb4.8-dev
sudo apt-get install libdb4.8++-dev
sudo apt-get install libboost1.37-dev
sudo apt-get install libboost1.48-dev
sudo apt-get install libboost-timer1.48-dev
sudo apt-get install libboost-chrono1.48-dev
(If using Boost 1.37, append -mt to the boost libraries in the makefile)
Optional:

View File

@ -4776,7 +4776,7 @@ void BitcoinMiner(CWallet *pwallet, CBlockProvider *block_provider, unsigned int
{
double dPrimesPerMinute = 60000.0 * nPrimeCounter / (nMillisNow - nHPSTimerStart);
dPrimesPerSec = dPrimesPerMinute / 60.0;
double dTestsPerMinute = 60000.0 * nTestCounter / (nMillisNow - nHPSTimerStart);
double dTestsPerSec = 1000.0 * nTestCounter / (nMillisNow - nHPSTimerStart);
dChainsPerMinute = 60000.0 * nChainCounter / (nMillisNow - nHPSTimerStart);
dChainsPerDay = 86400000.0 * dChainExpected / (GetTimeMillis() - nHPSTimerStart);
nHPSTimerStart = nMillisNow;
@ -4788,7 +4788,7 @@ void BitcoinMiner(CWallet *pwallet, CBlockProvider *block_provider, unsigned int
if (nMillisNow - nLogTime > 59000)
{
nLogTime = nMillisNow;
printf("%s primemeter %9.0f prime/h %9.0f test/h %4.0f %d-chains/h %3.6f chain/d\n", DateTimeStrFormat("%Y-%m-%d %H:%M:%S", nLogTime / 1000).c_str(), dPrimesPerMinute * 60.0, dTestsPerMinute * 60.0, dChainsPerMinute * 60.0, nStatsChainLength, dChainsPerDay);
printf("[STATS] %s | %4.0f primes/s, %4.0f tests/s, %4.0f %d-chains/h, %3.3f chains/d\n", DateTimeStrFormat("%Y-%m-%d %H:%M:%S", nLogTime / 1000).c_str(), dPrimesPerSec, dTestsPerSec, dChainsPerMinute * 60.0, nStatsChainLength, dChainsPerDay);
}
}
}

View File

@ -416,7 +416,7 @@ private:
void stats_running() {
if (!running) return;
std::cout << std::fixed;
std::cout << std::setprecision(0);
std::cout << std::setprecision(1);
boost::posix_time::ptime t_end = boost::posix_time::second_clock::universal_time();
unsigned long rejects = 0;
unsigned long stale = 0;
@ -428,11 +428,12 @@ private:
if (it->first == 1) blocks = it->second;
if (it->first > 1) valid += it->second;
}
std::cout << "[STATS] " << DateTimeStrFormat("%Y-%m-%d %H:%M:%S", GetTimeMillis() / 1000).c_str() << " | ";
for (std::map<int,unsigned long>::iterator it = statistics.begin(); it != statistics.end(); ++it)
if (it->first > 1)
std::cout << " " << it->first << "-CH: " << it->second << " (" <<
std::cout << it->first << "-CH: " << it->second << " (" <<
((valid+blocks > 0) ? (static_cast<double>(it->second) / static_cast<double>(valid+blocks)) * 100.0 : 0.0) << "% | " <<
((valid+blocks > 0) ? (static_cast<double>(it->second) / (static_cast<double>((t_end - t_start).total_seconds()) / 3600.0)) : 0.0) << "/hr), ";
((valid+blocks > 0) ? (static_cast<double>(it->second) / (static_cast<double>((t_end - t_start).total_seconds()) / 3600.0)) : 0.0) << "/h), ";
if (valid+blocks+rejects+stale > 0) {
std::cout << "VL: " << valid+blocks << " (" << (static_cast<double>(valid+blocks) / static_cast<double>(valid+blocks+rejects+stale)) * 100.0 << "%), ";
std::cout << "RJ: " << rejects << " (" << (static_cast<double>(rejects) / static_cast<double>(valid+blocks+rejects+stale)) * 100.0 << "%), ";
@ -467,13 +468,13 @@ void stats_on_exit() {
}
std::cout << std::endl;
std::cout << "********************************************" << std::endl;
std::cout << "*** running time: " << static_cast<double>((t_end - t_start).total_seconds()) / 3600.0 << "hrs" << std::endl;
std::cout << "*** running time: " << static_cast<double>((t_end - t_start).total_seconds()) / 3600.0 << "h" << std::endl;
std::cout << "***" << std::endl;
for (std::map<int,unsigned long>::iterator it = statistics.begin(); it != statistics.end(); ++it)
if (it->first > 1)
std::cout << "*** " << it->first << "-chains: " << it->second << "\t(" <<
((valid+blocks > 0) ? (static_cast<double>(it->second) / static_cast<double>(valid+blocks)) * 100.0 : 0.0) << "% | " <<
((valid+blocks > 0) ? (static_cast<double>(it->second) / (static_cast<double>((t_end - t_start).total_seconds()) / 3600.0)) : 0.0) << "/hr)" <<
((valid+blocks > 0) ? (static_cast<double>(it->second) / (static_cast<double>((t_end - t_start).total_seconds()) / 3600.0)) : 0.0) << "/h)" <<
std::endl;
if (valid+blocks+rejects+stale > 0) {
std::cout << "***" << std::endl;