Add function call timing for all Application::sweep operations

This commit is contained in:
Vinnie Falco
2013-08-23 09:43:11 -07:00
parent b0533a91fe
commit 4ececd0204
7 changed files with 85 additions and 29 deletions

View File

@@ -776,16 +776,46 @@ void ApplicationImp::doSweep(Job& j)
// have listeners register for "onSweep ()" notification.
//
mMasterTransaction.sweep ();
m_nodeStore->sweep ();
mLedgerMaster.sweep ();
mTempNodeCache.sweep ();
mValidations->sweep ();
getInboundLedgers ().sweep ();
mSLECache.sweep ();
AcceptedLedger::sweep (); // VFALCO NOTE AcceptedLedger is/has a singleton?
SHAMap::sweep (); // VFALCO NOTE SHAMap is/has a singleton?
mNetOps->sweepFetchPack ();
logTimedCall <Application> ("TransactionMaster::sweep", __FILE__, __LINE__, boost::bind (
&TransactionMaster::sweep, &mMasterTransaction));
//mMasterTransaction.sweep ();
logTimedCall <Application> ("NodeStore::sweep", __FILE__, __LINE__, boost::bind (
&NodeStore::sweep, m_nodeStore.get ()));
//m_nodeStore->sweep ();
logTimedCall <Application> ("LedgerMaster::sweep", __FILE__, __LINE__, boost::bind (
&LedgerMaster::sweep, &mLedgerMaster));
//mLedgerMaster.sweep ();
logTimedCall <Application> ("TempNodeCache::sweep", __FILE__, __LINE__, boost::bind (
&NodeCache::sweep, &mTempNodeCache));
//mTempNodeCache.sweep ();
logTimedCall <Application> ("Validations::sweep", __FILE__, __LINE__, boost::bind (
&IValidations::sweep, mValidations.get ()));
//mValidations->sweep ();
logTimedCall <Application> ("InboundLedgers::sweep", __FILE__, __LINE__, boost::bind (
&InboundLedgers::sweep, &getInboundLedgers ()));
//getInboundLedgers ().sweep ();
logTimedCall <Application> ("SLECache::sweep", __FILE__, __LINE__, boost::bind (
&SLECache::sweep, &mSLECache));
//mSLECache.sweep ();
logTimedCall <Application> ("AcceptedLedger::sweep", __FILE__, __LINE__,
&AcceptedLedger::sweep);
//AcceptedLedger::sweep (); // VFALCO NOTE AcceptedLedger is/has a singleton?
logTimedCall <Application> ("SHAMap::sweep", __FILE__, __LINE__,
&SHAMap::sweep);
//SHAMap::sweep (); // VFALCO NOTE SHAMap is/has a singleton?
logTimedCall <Application> ("NetworkOPs::sweepFetchPack", __FILE__, __LINE__, boost::bind (
&NetworkOPs::sweepFetchPack, mNetOps.get ()));
//mNetOps->sweepFetchPack ();
// VFALCO NOTE does the call to sweep() happen on another thread?
mSweepTimer.expires_from_now (boost::posix_time::seconds (getConfig ().getSize (siSweepInterval)));
mSweepTimer.async_wait (BIND_TYPE (&ApplicationImp::sweep, this));

View File

@@ -12,7 +12,8 @@
#define CACHED_TRANSACTION_AGE 1800
#endif
TransactionMaster::TransactionMaster () : mCache ("TransactionCache", CACHED_TRANSACTION_NUM, CACHED_TRANSACTION_AGE)
TransactionMaster::TransactionMaster ()
: mCache ("TransactionCache", CACHED_TRANSACTION_NUM, CACHED_TRANSACTION_AGE)
{
;
}
@@ -92,4 +93,8 @@ bool TransactionMaster::canonicalize (Transaction::pointer& txn)
return false;
}
// vim:ts=4
void TransactionMaster::sweep (void)
{
mCache.sweep ();
}

View File

@@ -21,10 +21,7 @@ public:
// return value: true = we had the transaction already
bool inLedger (uint256 const& hash, uint32 ledger);
bool canonicalize (Transaction::pointer& txn);
void sweep (void)
{
mCache.sweep ();
}
void sweep (void);
private:
TaggedCache <uint256, Transaction, UptimeTimerAdapter> mCache;