Trigger metrics UI refresh on new messages
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
CCriticalSection cs_metrics;
|
CCriticalSection cs_metrics;
|
||||||
|
|
||||||
boost::synchronized_value<int64_t> nNodeStartTime;
|
boost::synchronized_value<int64_t> nNodeStartTime;
|
||||||
|
boost::synchronized_value<int64_t> nNextRefresh;
|
||||||
AtomicCounter transactionsValidated;
|
AtomicCounter transactionsValidated;
|
||||||
AtomicCounter ehSolverRuns;
|
AtomicCounter ehSolverRuns;
|
||||||
AtomicCounter solutionTargetChecks;
|
AtomicCounter solutionTargetChecks;
|
||||||
@@ -60,6 +61,13 @@ double GetLocalSolPS()
|
|||||||
return GetLocalSolPS_INTERNAL(GetUptime());
|
return GetLocalSolPS_INTERNAL(GetUptime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TriggerRefresh()
|
||||||
|
{
|
||||||
|
*nNextRefresh = GetTime();
|
||||||
|
// Ensure that the refresh has started before we return
|
||||||
|
MilliSleep(200);
|
||||||
|
}
|
||||||
|
|
||||||
static bool metrics_ThreadSafeMessageBox(const std::string& message,
|
static bool metrics_ThreadSafeMessageBox(const std::string& message,
|
||||||
const std::string& caption,
|
const std::string& caption,
|
||||||
unsigned int style)
|
unsigned int style)
|
||||||
@@ -85,6 +93,9 @@ static bool metrics_ThreadSafeMessageBox(const std::string& message,
|
|||||||
if (u->size() > 5) {
|
if (u->size() > 5) {
|
||||||
u->pop_back();
|
u->pop_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TriggerRefresh();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void metrics_InitMessage(const std::string& message)
|
static void metrics_InitMessage(const std::string& message)
|
||||||
@@ -333,8 +344,8 @@ void ThreadShowMetricsScreen()
|
|||||||
std::cout << "----------------------------------------" << std::endl;
|
std::cout << "----------------------------------------" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t nWaitEnd = GetTime() + nRefresh;
|
*nNextRefresh = GetTime() + nRefresh;
|
||||||
while (GetTime() < nWaitEnd) {
|
while (GetTime() < *nNextRefresh) {
|
||||||
boost::this_thread::interruption_point();
|
boost::this_thread::interruption_point();
|
||||||
MilliSleep(200);
|
MilliSleep(200);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ void TrackMinedBlock(uint256 hash);
|
|||||||
void MarkStartTime();
|
void MarkStartTime();
|
||||||
double GetLocalSolPS();
|
double GetLocalSolPS();
|
||||||
|
|
||||||
|
void TriggerRefresh();
|
||||||
|
|
||||||
void ConnectMetricsScreen();
|
void ConnectMetricsScreen();
|
||||||
void ThreadShowMetricsScreen();
|
void ThreadShowMetricsScreen();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user