Fullbelow cache improvements.

Conflicts:
	src/cpp/ripple/ripple_SHAMap.h
This commit is contained in:
JoelKatz
2013-06-10 21:53:50 -07:00
parent ec04108910
commit 58d7e62ad9
3 changed files with 5 additions and 2 deletions

View File

@@ -2297,6 +2297,8 @@ Json::Value RPCHandler::doGetCounts(Json::Value jvRequest, int& cost, ScopedLock
ret["ledger_hit_rate"] = theApp->getLedgerMaster().getCacheHitRate(); ret["ledger_hit_rate"] = theApp->getLedgerMaster().getCacheHitRate();
ret["AL_hit_rate"] = AcceptedLedger::getCacheHitRate(); ret["AL_hit_rate"] = AcceptedLedger::getCacheHitRate();
ret["fullbelow_size"] = SHAMap::getFullBelowSize();
std::string uptime; std::string uptime;
int s = UptimeTimer::getInstance().getElapsedSeconds(); int s = UptimeTimer::getInstance().getElapsedSeconds();
textTime(uptime, s, "year", 365*24*60*60); textTime(uptime, s, "year", 365*24*60*60);

View File

@@ -480,7 +480,8 @@ public:
typedef std::pair< uint256, std::vector<unsigned char> > fetchPackEntry_t; typedef std::pair< uint256, std::vector<unsigned char> > fetchPackEntry_t;
std::list<fetchPackEntry_t> getFetchPack(SHAMap* have, bool includeLeaves, int max); std::list<fetchPackEntry_t> getFetchPack(SHAMap* have, bool includeLeaves, int max);
static void sweep() { fullBelowCache.sweep(); } static int getFullBelowCacheSize() { return fullBelowCache.getSize(); }
static void sweep() { fullBelowCache.sweep(); }
}; };
#endif #endif

View File

@@ -11,7 +11,7 @@
static const uint256 uZero; static const uint256 uZero;
KeyCache <uint256, UptimeTimerAdapter> SHAMap::fullBelowCache("fullBelowCache", 65536, 240); KeyCache <uint256, UptimeTimerAdapter> SHAMap::fullBelowCache("fullBelowCache", 524288, 240);
void SHAMap::getMissingNodes(std::vector<SHAMapNode>& nodeIDs, std::vector<uint256>& hashes, int max, void SHAMap::getMissingNodes(std::vector<SHAMapNode>& nodeIDs, std::vector<uint256>& hashes, int max,
SHAMapSyncFilter* filter) SHAMapSyncFilter* filter)