Fullbelow cache improvements.

This commit is contained in:
JoelKatz
2013-06-10 21:53:50 -07:00
parent 5e0a1b23b5
commit 1bfaf652fc
3 changed files with 5 additions and 2 deletions

View File

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

View File

@@ -125,7 +125,8 @@ public:
std::list<fetchPackEntry_t> getFetchPack(SHAMap* have, bool includeLeaves, int max);
static void sweep() { fullBelowCache.sweep(); }
static int getFullBelowSize() { return fullBelowCache.getSize(); }
static void sweep() { fullBelowCache.sweep(); }
private:
static KeyCache <uint256, UptimeTimerAdapter> fullBelowCache;

View File

@@ -3,7 +3,7 @@
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,
SHAMapSyncFilter* filter)