mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-26 05:55:51 +00:00
Report cache hit rates.
This commit is contained in:
@@ -70,6 +70,8 @@ public:
|
||||
int getLedgerSeq() const { return mLedger->getLedgerSeq(); }
|
||||
int getTxnCount() const { return mMap.size(); }
|
||||
|
||||
static float getCacheHitRate() { return ALCache.getHitRate(); }
|
||||
|
||||
ALTransaction::pointer getTxn(int) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -65,7 +65,9 @@ public:
|
||||
|
||||
HashedObjectStore(int cacheSize, int cacheAge);
|
||||
|
||||
bool isLevelDB() { return mLevelDB; }
|
||||
bool isLevelDB() { return mLevelDB; }
|
||||
|
||||
float getCacheHitRate() { return mCache.getHitRate(); }
|
||||
|
||||
bool store(HashedObjectType type, uint32 index, const std::vector<unsigned char>& data,
|
||||
const uint256& hash)
|
||||
|
||||
@@ -15,6 +15,7 @@ public:
|
||||
void addLedger(Ledger::pointer ledger);
|
||||
void addAcceptedLedger(Ledger::pointer ledger, bool fromConsensus);
|
||||
|
||||
float getCacheHitRate() { return mLedgersByHash.getHitRate(); }
|
||||
uint256 getLedgerHash(uint32 index);
|
||||
Ledger::pointer getLedgerBySeq(uint32 index);
|
||||
Ledger::pointer getLedgerByHash(const uint256& hash);
|
||||
|
||||
@@ -157,8 +157,9 @@ public:
|
||||
|
||||
void resumeAcquiring();
|
||||
|
||||
void tune(int size, int age) { mLedgerHistory.tune(size, age); }
|
||||
void sweep(void) { mLedgerHistory.sweep(); }
|
||||
void tune(int size, int age) { mLedgerHistory.tune(size, age); }
|
||||
void sweep() { mLedgerHistory.sweep(); }
|
||||
float getCacheHitRate() { return mLedgerHistory.getCacheHitRate(); }
|
||||
|
||||
void addValidateCallback(callback& c) { mOnValidate.push_back(c); }
|
||||
|
||||
|
||||
@@ -2304,6 +2304,11 @@ Json::Value RPCHandler::doGetCounts(Json::Value jvRequest, int& cost, ScopedLock
|
||||
|
||||
ret["write_load"] = theApp->getHashedObjectStore().getWriteLoad();
|
||||
|
||||
ret["SLE_hit_rate"] = theApp->getSLECache().getHitRate();
|
||||
ret["node_hit_rate"] = theApp->getHashedObjectStore().getCacheHitRate();
|
||||
ret["ledger_hit_rate"] = theApp->getLedgerMaster().getCacheHitRate();
|
||||
ret["AL_hit_rate"] = AcceptedLedger::getCacheHitRate();
|
||||
|
||||
std::string uptime;
|
||||
int s = upTime();
|
||||
textTime(uptime, s, "year", 365*24*60*60);
|
||||
|
||||
Reference in New Issue
Block a user