Track special disk accesses.

This commit is contained in:
JoelKatz
2012-11-19 17:08:58 -08:00
parent b79a927c28
commit 11088937a4
5 changed files with 5 additions and 0 deletions

View File

@@ -60,6 +60,7 @@ void HashedObjectStore::waitWrite()
void HashedObjectStore::bulkWrite()
{
LoadEvent::pointer event = theApp->getJobQueue().getLoadEvent(jtDISK);
while (1)
{
std::vector< boost::shared_ptr<HashedObject> > set;

View File

@@ -22,6 +22,7 @@ const char* Job::toString(JobType t)
case jtDEATH: return "jobOfDeath";
case jtCLIENT: return "clientCommand";
case jtPEER: return "peerCommand";
case jtDISK: return "diskAccess";
default: assert(false); return "unknown";
}
}

View File

@@ -35,6 +35,7 @@ enum JobType
// special types not dispatched by the job pool
jtCLIENT = 10,
jtPEER = 11,
jtDISK = 12,
};
#define NUM_JOB_TYPES 16

View File

@@ -341,6 +341,7 @@ uint256 Ledger::getHash()
void Ledger::saveAcceptedLedger(bool fromConsensus)
{ // can be called in a different thread
LoadEvent::pointer event = theApp->getJobQueue().getLoadEvent(jtDISK);
cLog(lsTRACE) << "saveAcceptedLedger " << (fromConsensus ? "fromConsensus " : "fromAcquire ") << getLedgerSeq();
static boost::format ledgerExists("SELECT LedgerSeq FROM Ledgers where LedgerSeq = %d;");
static boost::format deleteLedger("DELETE FROM Ledgers WHERE LedgerSeq = %d;");

View File

@@ -289,6 +289,7 @@ void ValidationCollection::condWrite()
void ValidationCollection::doWrite()
{
LoadEvent::pointer event = theApp->getJobQueue().getLoadEvent(jtDISK);
static boost::format insVal("INSERT INTO LedgerValidations "
"(LedgerHash,NodePubKey,Flags,SignTime,Signature) VALUES ('%s','%s','%u','%u',%s);");