Also report work queue threads in rpcinfo
This commit is contained in:
@@ -162,6 +162,11 @@ public:
|
||||
boost::unique_lock<boost::mutex> lock(cs);
|
||||
return maxDepth;
|
||||
}
|
||||
int NumThreads()
|
||||
{
|
||||
boost::unique_lock<boost::mutex> lock(cs);
|
||||
return numThreads;
|
||||
}
|
||||
};
|
||||
|
||||
struct HTTPPathHandler
|
||||
@@ -196,11 +201,17 @@ int getWorkQueueDepth()
|
||||
{
|
||||
return workQueue->Depth();
|
||||
}
|
||||
|
||||
int getWorkQueueMaxDepth()
|
||||
{
|
||||
return workQueue->MaxDepth();
|
||||
}
|
||||
|
||||
int getWorkQueueNumThreads()
|
||||
{
|
||||
return workQueue->NumThreads();
|
||||
}
|
||||
|
||||
/** Check if a network address is allowed to access the HTTP server */
|
||||
static bool ClientAllowed(const CNetAddr& netaddr)
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@ class HTTPRequest;
|
||||
|
||||
int getWorkQueueDepth();
|
||||
int getWorkQueueMaxDepth();
|
||||
int getWorkQueueNumThreads();
|
||||
|
||||
/** Initialize HTTP server.
|
||||
* Call this before RegisterHTTPHandler or EventBase().
|
||||
|
||||
@@ -180,6 +180,7 @@ UniValue geterablockheights(const UniValue& params, bool fHelp, const CPubKey& m
|
||||
|
||||
extern int getWorkQueueDepth();
|
||||
extern int getWorkQueueMaxDepth();
|
||||
extern int getWorkQueueNumThreads();
|
||||
|
||||
UniValue rpcinfo(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
{
|
||||
@@ -195,6 +196,7 @@ UniValue rpcinfo(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
|
||||
result.push_back(Pair("work_queue_depth", depth));
|
||||
result.push_back(Pair("work_queue_max_depth", getWorkQueueMaxDepth() ));
|
||||
result.push_back(Pair("work_queue_num_threads", getWorkQueueNumThreads() ));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user