From 58d7e62ad9f1b1e11491c35820a97801b2620163 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 10 Jun 2013 21:53:50 -0700 Subject: [PATCH] Fullbelow cache improvements. Conflicts: src/cpp/ripple/ripple_SHAMap.h --- src/cpp/ripple/RPCHandler.cpp | 2 ++ src/cpp/ripple/SHAMap.h | 3 ++- src/cpp/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 67bc87269..ae9bbe8d9 100644 --- a/src/cpp/ripple/RPCHandler.cpp +++ b/src/cpp/ripple/RPCHandler.cpp @@ -2297,6 +2297,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/SHAMap.h b/src/cpp/ripple/SHAMap.h index 2e3ea10e5..bc9bfdc4e 100644 --- a/src/cpp/ripple/SHAMap.h +++ b/src/cpp/ripple/SHAMap.h @@ -480,7 +480,8 @@ public: typedef std::pair< uint256, std::vector > fetchPackEntry_t; std::list getFetchPack(SHAMap* have, bool includeLeaves, int max); - static void sweep() { fullBelowCache.sweep(); } + static int getFullBelowCacheSize() { return fullBelowCache.getSize(); } + static void sweep() { fullBelowCache.sweep(); } }; #endif diff --git a/src/cpp/ripple/SHAMapSync.cpp b/src/cpp/ripple/SHAMapSync.cpp index e282609ea..2114cba97 100644 --- a/src/cpp/ripple/SHAMapSync.cpp +++ b/src/cpp/ripple/SHAMapSync.cpp @@ -11,7 +11,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)