From 1bfaf652fcf1b87d46e7b5f97fe044bda855e3f6 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 10 Jun 2013 21:53:50 -0700 Subject: [PATCH] Fullbelow cache improvements. --- src/cpp/ripple/RPCHandler.cpp | 2 ++ src/cpp/ripple/ripple_SHAMap.h | 3 ++- src/cpp/ripple/ripple_SHAMapSync.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cpp/ripple/RPCHandler.cpp b/src/cpp/ripple/RPCHandler.cpp index 39c27d5c1..268489553 100644 --- a/src/cpp/ripple/RPCHandler.cpp +++ b/src/cpp/ripple/RPCHandler.cpp @@ -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); diff --git a/src/cpp/ripple/ripple_SHAMap.h b/src/cpp/ripple/ripple_SHAMap.h index 5937ce612..2d01248ea 100644 --- a/src/cpp/ripple/ripple_SHAMap.h +++ b/src/cpp/ripple/ripple_SHAMap.h @@ -125,7 +125,8 @@ public: std::list 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 fullBelowCache; diff --git a/src/cpp/ripple/ripple_SHAMapSync.cpp b/src/cpp/ripple/ripple_SHAMapSync.cpp index bc81cd64e..083272340 100644 --- a/src/cpp/ripple/ripple_SHAMapSync.cpp +++ b/src/cpp/ripple/ripple_SHAMapSync.cpp @@ -3,7 +3,7 @@ static const uint256 uZero; -KeyCache SHAMap::fullBelowCache("fullBelowCache", 65536, 240); +KeyCache SHAMap::fullBelowCache("fullBelowCache", 524288, 240); void SHAMap::getMissingNodes(std::vector& nodeIDs, std::vector& hashes, int max, SHAMapSyncFilter* filter)