Add a persistent screen showing basic node metrics

The screen is implemented using ANSI Escape sequences.

Closes #1331
This commit is contained in:
Jack Grigg
2016-09-04 04:39:45 +12:00
parent f39d176ebf
commit a6df7ab567
7 changed files with 204 additions and 3 deletions

View File

@@ -16,6 +16,7 @@
#include "consensus/validation.h"
#include "key.h"
#include "main.h"
#include "metrics.h"
#include "miner.h"
#include "net.h"
#include "rpcserver.h"
@@ -975,6 +976,11 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
CScheduler::Function serviceLoop = boost::bind(&CScheduler::serviceQueue, &scheduler);
threadGroup.create_thread(boost::bind(&TraceThread<CScheduler::Function>, "scheduler", serviceLoop));
if (GetBoolArg("-showmetrics", true) && !fPrintToConsole && !GetBoolArg("-daemon", false)) {
// Start the persistent metrics interface
threadGroup.create_thread(&ThreadShowMetricsScreen);
}
// Initialize Zcash circuit parameters
ZC_LoadParams();
// These must be disabled for now, they are buggy and we probably don't