]> Git Repo - VerusCoin.git/blob - src/metrics.h
Auto merge of #1980 - bitcartel:fix_z_sendmany_logging_bug_txid, r=ebfull
[VerusCoin.git] / src / metrics.h
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.
4
5 #include "uint256.h"
6
7 #include <atomic>
8 #include <string>
9
10 struct AtomicCounter {
11     std::atomic<uint64_t> value;
12
13     AtomicCounter() : value {0} { }
14
15     void increment(){
16         ++value;
17     }
18
19     void decrement(){
20         --value;
21     }
22
23     int get(){
24         return value.load();
25     }
26 };
27
28 extern AtomicCounter transactionsValidated;
29 extern AtomicCounter ehSolverRuns;
30 extern AtomicCounter solutionTargetChecks;
31
32 void TrackMinedBlock(uint256 hash);
33
34 void MarkStartTime();
35 double GetLocalSolPS();
36
37 void TriggerRefresh();
38
39 void ConnectMetricsScreen();
40 void ThreadShowMetricsScreen();
41
42 /**
43  * Heart image: https://commons.wikimedia.org/wiki/File:Heart_coraz%C3%B3n.svg
44  * License: CC BY-SA 3.0
45  *
46  * Rendering options:
47  * Zcash: img2txt -W 40 -H 20 -f utf8 -d none -g 0.7 Z-yellow.orange-logo.png
48  * Heart: img2txt -W 40 -H 20 -f utf8 -d none 2000px-Heart_corazón.svg.png
49  */
50 const std::string METRICS_ART =
51 "              \e[0;34;40m            \e[0m                                                      \n"
52 "          \e[0;34;40m                    \e[0m                                                  \n"
53 "       \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"
54 "     \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"
55 "   \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"
56 "  \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"
57\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"
58\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"
59 "\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"
60 "\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"
61 "\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"
62 "\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"
63\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"
64\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"
65 "  \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"
66 "   \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"
67 "     \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"
68 "       \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"
69 "         \e[0;34;40m                      \e[0m                                                 \n"
70 "              \e[0;34;40m             \e[0m                                                     ";
This page took 0.036036 seconds and 4 git commands to generate.