1 // Copyright (c) 2016 The Zcash developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
11 extern int64_t nHashCount;
13 struct AtomicCounter {
14 std::atomic<uint64_t> value;
16 AtomicCounter() : value {0} { }
26 uint64_t get() const {
39 AtomicTimer() : threads(0), start_time(0), total_time(0) {}
42 * Starts timing on first call, and counts the number of calls.
47 * Counts number of calls, and stops timing after it has been called as
48 * many times as start().
54 uint64_t threadCount();
56 double rate(const AtomicCounter& count);
57 double rate(const int64_t count);
61 extern AtomicCounter transactionsValidated;
62 extern AtomicCounter ehSolverRuns;
63 extern AtomicCounter solutionTargetChecks;
64 extern AtomicTimer miningTimer;
66 void TrackMinedBlock(uint256 hash);
69 double GetLocalSolPS();
70 int EstimateNetHeightInner(int height, int64_t tipmediantime,
71 int heightLastCheckpoint, int64_t timeLastCheckpoint,
72 int64_t genesisTime, int64_t targetSpacing);
74 void TriggerRefresh();
76 void ConnectMetricsScreen();
77 void ThreadShowMetricsScreen();
80 * Heart image: https://commons.wikimedia.org/wiki/File:Heart_coraz%C3%B3n.svg
81 * License: CC BY-SA 3.0
84 * Zcash: img2txt -W 40 -H 20 -f utf8 -d none -g 0.7 Z-yellow.orange-logo.png
85 * Heart: img2txt -W 40 -H 20 -f utf8 -d none 2000px-Heart_corazón.svg.png
87 const std::string METRICS_ART =
88 "
\e[0;34;40m
\e[0m \n"
89 "
\e[0;34;40m
\e[0m \n"
90 "
\e[0;34;40m
\e[0;31;40m:8
\e[0;33;5;40;100m8
\e[0;1;30;90;43mSX@888@@X
\e[0;31;5;40;100m8
\e[0;31;40m:
\e[0;34;40m
\e[0m
\e[0;31;5;41;101m8; %
\e[0;1;31;91;41mX
\e[0m
\e[0;1;31;91;41mX
\e[0;31;5;41;101m% ;8
\e[0m \n"
91 "
\e[0;34;40m
\e[0;31;40m%
\e[0;1;30;90;43m%X
\e[0;1;33;93;43mt
\e[0;33;5;43;103m%tt%
\e[0;1;30;90;43mSSSS
\e[0;33;5;43;103mS:
\e[0;37;5;43;103mXXX
\e[0;1;33;93;43mt
\e[0;1;30;90;43m@
\e[0;31;40m@
\e[0;34;40m
\e[0m
\e[0;1;31;91;41mX
\e[0;31;5;41;101m :
\e[0;1;31;91;41m:
\e[0m
\e[0;1;31;91;41m:
\e[0;31;5;41;101m:
\e[0;1;31;91;41mX
\e[0m \n"
92 "
\e[0;34;40m
\e[0;31;40m@
\e[0;1;30;90;43mS
\e[0;1;33;93;43m;;tt%%
\e[0;33;5;43;103m%
\e[0;1;33;93;43mt
\e[0;34;40m
\e[0;1;33;93;43m;
\e[0;33;5;43;103m;::
\e[0;37;5;43;103mXXXX
\e[0;37;43mS
\e[0;31;5;40;100mX
\e[0;34;40m
\e[0m
\e[0;31;5;41;101m% SS %
\e[0m \n"
93 "
\e[0;34;40m
\e[0;31;40m.
\e[0;1;30;90;43mt
\e[0;1;33;93;43m:::;;
\e[0;1;30;90;43m%
\e[0;31;40m8888
\e[0;34;40m
\e[0;31;40m8
\e[0;30;41m8888
\e[0;1;33;93;43mt
\e[0;37;5;43;103mXXXX
\e[0;1;30;90;43m8
\e[0;31;40m;
\e[0;34;40m
\e[0m
\e[0;1;31;91;41mS
\e[0;31;5;41;101m
\e[0;1;31;91;41mS
\e[0m \n"
94 "
\e[0;34;40m
\e[0;31;40m.
\e[0;1;30;90;43m%
\e[0;1;33;93;43m...:::
\e[0;31;40m8
\e[0;34;40m
\e[0;1;30;90;43m8
\e[0;33;5;43;103m::
\e[0;37;5;43;103mXXX
\e[0;1;33;93;43m%
\e[0;31;40m;
\e[0;34;40m
\e[0m
\e[0;31;5;41;101mX X
\e[0m \n"
95 "
\e[0;34;40m
\e[0;31;43m8
\e[0;1;31;91;43m888
\e[0;1;33;93;43m...:
\e[0;1;30;90;43mt
\e[0;1;30;90;41m888888
\e[0;31;40mX
\e[0;34;40m
\e[0;33;5;40;100m8
\e[0;33;5;43;103mt;;::
\e[0;37;5;43;103mXX
\e[0;1;30;90;43m8
\e[0;31;40m
\e[0;34;40m
\e[0m
\e[0;31;5;41;101m8 8
\e[0m \n"
96 "
\e[0;34;40m
\e[0;31;40m%
\e[0;1;31;91;43m888888
\e[0;1;33;93;43m...:::;:
\e[0;1;30;90;41m8
\e[0;31;40m
\e[0;34;40m
\e[0;31;40m:
\e[0;1;30;90;43mX
\e[0;33;5;43;103mttt;;;::
\e[0;37;5;43;103mX
\e[0;31;5;40;100m@
\e[0;34;40m
\e[0m
\e[0;31;5;41;101m
\e[0m \n"
97 "
\e[0;34;40m
\e[0;1;30;90;41m8
\e[0;1;31;91;43m88888888
\e[0;1;33;93;43m...:
\e[0;1;30;90;43mS
\e[0;31;40mt
\e[0;34;40m
\e[0;1;30;90;41m8
\e[0;1;33;93;43m:%
\e[0;33;5;43;103m%tttt;;;:
\e[0;1;30;90;43mX
\e[0;34;40m
\e[0m
\e[0;31;5;41;101mX X
\e[0m \n"
98 "
\e[0;34;40m
\e[0;1;30;90;41m8
\e[0;1;31;91;43m8888888888
\e[0;1;30;90;43mS
\e[0;1;30;90;41m8
\e[0;31;40m
\e[0;34;40m
\e[0;31;40m:
\e[0;1;30;90;43m%
\e[0;1;33;93;43m;ttt%
\e[0;33;5;43;103m%tttt;;
\e[0;1;30;90;43mX
\e[0;34;40m
\e[0m
\e[0;31;5;41;101m8 8
\e[0m \n"
99 "
\e[0;34;40m
\e[0;31;40m%
\e[0;1;31;91;43m888888888
\e[0;1;30;90;43m%
\e[0;31;40mt
\e[0;34;40m
\e[0;30;41m8
\e[0;1;30;90;43mS
\e[0;1;33;93;43m:;;;tt%%
\e[0;33;5;43;103m%ttt;
\e[0;1;30;90;41m8
\e[0;34;40m
\e[0m
\e[0;31;5;41;101m: :
\e[0m \n"
100 "
\e[0;34;40m
\e[0;31;43m8t
\e[0;1;31;91;43m888888
\e[0;33;41m8
\e[0;31;40m
\e[0;34;40m
\e[0;31;40mS
\e[0;33;41m888
\e[0;31;43m8888
\e[0;1;30;90;43mS
\e[0;1;33;93;43mtt%%
\e[0;33;5;43;103m%t
\e[0;1;30;90;43m@
\e[0;31;40m
\e[0;34;40m
\e[0m
\e[0;1;31;91;41m:
\e[0;31;5;41;101m: :
\e[0;1;31;91;41m:
\e[0m \n"
101 "
\e[0;34;40m
\e[0;31;40m.
\e[0;31;43m@tt
\e[0;1;31;91;43m888
\e[0;31;43m@
\e[0;34;40m
\e[0;1;30;90;41m8
\e[0;1;33;93;43m;;ttt
\e[0;1;30;90;43m@
\e[0;31;40m;
\e[0;34;40m
\e[0m
\e[0;31;5;41;101mt t
\e[0m \n"
102 "
\e[0;34;40m
\e[0;31;40m.
\e[0;31;43m8ttt
\e[0;1;31;91;43m8
\e[0;31;43m@
\e[0;31;40mSSSSS
\e[0;34;40m
\e[0;31;40mSXXXX
\e[0;1;30;90;43m%
\e[0;1;33;93;43m:;;;
\e[0;1;30;90;43mX
\e[0;31;40m;
\e[0;34;40m
\e[0m
\e[0;31;5;41;101m8 8
\e[0m \n"
103 "
\e[0;34;40m
\e[0;31;40mX
\e[0;31;43m8ttt
\e[0;1;31;91;43m8888
\e[0;1;30;90;43m%
\e[0;34;40m
\e[0;1;30;90;43m%
\e[0;1;31;91;43m88
\e[0;1;33;93;43m...::
\e[0;1;30;90;43mX
\e[0;30;41m8
\e[0;31;40m
\e[0;34;40m
\e[0m
\e[0;1;31;91;41mX
\e[0;31;5;41;101m. .
\e[0;1;31;91;41mX
\e[0m \n"
104 "
\e[0;34;40m
\e[0;31;40m%
\e[0;1;30;90;41m8
\e[0;31;43m@tt
\e[0;1;31;91;43m88
\e[0;31;43m;
\e[0;33;41m8888
\e[0;1;30;90;43m%
\e[0;1;31;91;43m8888
\e[0;1;30;90;43m%
\e[0;31;43m8
\e[0;31;40mX
\e[0;32;40m
\e[0;34;40m
\e[0m
\e[0;1;31;91;41m:
\e[0;31;5;41;101m; ;
\e[0;1;31;91;41m:
\e[0m \n"
105 "
\e[0;34;40m
\e[0;31;40m:@
\e[0;1;30;90;41m8
\e[0;33;41m8
\e[0;31;43m8@XXX@8
\e[0;1;30;90;41m8
\e[0;31;40m8:
\e[0;34;40m
\e[0m
\e[0;31;5;41;101mtt
\e[0m \n"
106 "
\e[0;34;40m
\e[0m \n"
107 "
\e[0;34;40m
\e[0m ";