Monitor cluster load.

This commit is contained in:
JoelKatz
2013-07-10 13:19:39 -07:00
parent ea7730a419
commit ec498bf2d2
3 changed files with 17 additions and 5 deletions

View File

@@ -32,19 +32,20 @@ public:
// Scale using load as well as base rate // Scale using load as well as base rate
virtual uint64 scaleFeeLoad (uint64 fee, uint64 baseFee, uint32 referenceFeeUnits, bool bAdmin) = 0; virtual uint64 scaleFeeLoad (uint64 fee, uint64 baseFee, uint32 referenceFeeUnits, bool bAdmin) = 0;
// VFALCO NOTE These appear to be unused, so I'm hiding the declarations. // VFALCO NOTE This appears to be unused, so I'm hiding the declaration.
// //
//virtual uint32 getRemoteFee () = 0;
//virtual uint32 getLocalFee () = 0;
//virtual void setRemoteFee (uint32) = 0; //virtual void setRemoteFee (uint32) = 0;
virtual uint32 getRemoteFee () = 0;
virtual uint32 getLocalFee () = 0;
virtual uint32 getClusterFee () = 0;
virtual uint32 getLoadBase () = 0; virtual uint32 getLoadBase () = 0;
virtual uint32 getLoadFactor () = 0; virtual uint32 getLoadFactor () = 0;
virtual Json::Value getJson (uint64 baseFee, uint32 referenceFeeUnits) = 0; virtual Json::Value getJson (uint64 baseFee, uint32 referenceFeeUnits) = 0;
virtual void setClusterFee (uint32) = 0; virtual void setClusterFee (uint32) = 0;
virtual uint32 getClusterFee () = 0;
virtual bool raiseLocalFee () = 0; virtual bool raiseLocalFee () = 0;
virtual bool lowerLocalFee () = 0; virtual bool lowerLocalFee () = 0;
virtual bool isLoadedLocal () = 0; virtual bool isLoadedLocal () = 0;

View File

@@ -77,7 +77,7 @@ public:
uint32 getLoadFactor () uint32 getLoadFactor ()
{ {
boost::mutex::scoped_lock sl (mLock); boost::mutex::scoped_lock sl (mLock);
return std::max (mLocalTxnLoadFee, mRemoteTxnLoadFee); return std::max(mClusterTxnLoadFee, std::max (mLocalTxnLoadFee, mRemoteTxnLoadFee));
} }
void setClusterFee (uint32 fee) void setClusterFee (uint32 fee)

View File

@@ -1426,8 +1426,19 @@ Json::Value NetworkOPs::getServerInfo (bool human, bool admin)
info["load_factor"] = getApp().getFeeTrack ().getLoadFactor (); info["load_factor"] = getApp().getFeeTrack ().getLoadFactor ();
} }
else else
{
info["load_factor"] = info["load_factor"] =
static_cast<double> (getApp().getFeeTrack ().getLoadFactor ()) / getApp().getFeeTrack ().getLoadBase (); static_cast<double> (getApp().getFeeTrack ().getLoadFactor ()) / getApp().getFeeTrack ().getLoadBase ();
if (admin)
{
info["load_factor_local"] =
static_cast<double> (getApp().getFeeTrack ().getLocalFee ()) / getApp().getFeeTrack ().getLoadBase ();
info["load_factor_net"] =
static_cast<double> (getApp().getFeeTrack ().getRemoteFee ()) / getApp().getFeeTrack ().getLoadBase ();
info["load_factor_cluster"] =
static_cast<double> (getApp().getFeeTrack ().getClusterFee ()) / getApp().getFeeTrack ().getLoadBase ();
}
}
bool valid = false; bool valid = false;
Ledger::pointer lpClosed = getValidatedLedger (); Ledger::pointer lpClosed = getValidatedLedger ();