mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add load_factor to server_info in reporting mode
* load_factor was missing from server_info when the server was running in reporting mode. Now, the reporting mode server calls server_info on the p2p node, and propagates the load_factor back to the client.
This commit is contained in:
@@ -17,7 +17,9 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/app/misc/NetworkOPs.h>
|
||||
#include <ripple/app/reporting/P2pProxy.h>
|
||||
#include <ripple/json/json_value.h>
|
||||
#include <ripple/net/RPCErr.h>
|
||||
#include <ripple/protocol/jss.h>
|
||||
@@ -38,6 +40,12 @@ doServerInfo(RPC::JsonContext& context)
|
||||
context.params.isMember(jss::counters) &&
|
||||
context.params[jss::counters].asBool());
|
||||
|
||||
if (context.app.config().reporting())
|
||||
{
|
||||
Json::Value const proxied = forwardToP2p(context);
|
||||
auto const lf = proxied[jss::result][jss::info][jss::load_factor];
|
||||
ret[jss::info][jss::load_factor] = lf.isNull() ? 1 : lf;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user