mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Measure CPU utilization in ServiceQueue
This commit is contained in:
@@ -412,12 +412,13 @@ public:
|
||||
//
|
||||
|
||||
// Return the current ChosenList as JSON
|
||||
Json::Value rpcPrint (Json::Value const& args)
|
||||
Json::Value rpcPrint (Json::Value const& args, int cpuPercent)
|
||||
{
|
||||
Json::Value results (Json::objectValue);
|
||||
|
||||
Json::Value entries (Json::arrayValue);
|
||||
{
|
||||
results ["cpu"] = cpuPercent;
|
||||
results ["count"] = int(m_validators.size());
|
||||
for (ValidatorTable::const_iterator iter (m_validators.begin());
|
||||
iter != m_validators.end(); ++iter)
|
||||
|
||||
@@ -147,7 +147,8 @@ public:
|
||||
|
||||
Json::Value rpcPrint (Json::Value const& args)
|
||||
{
|
||||
return m_logic.rpcPrint (args);
|
||||
int const cpuPercent (std::ceil (m_queue.getUtilizaton() * 100));
|
||||
return m_logic.rpcPrint (args, cpuPercent);
|
||||
}
|
||||
|
||||
Json::Value rpcRebuild (Json::Value const& args)
|
||||
|
||||
Reference in New Issue
Block a user