Monitor LevelDB performance.

This commit is contained in:
JoelKatz
2013-04-30 17:43:56 -07:00
parent 651a9c2591
commit 3ec116f5bf
3 changed files with 9 additions and 2 deletions

View File

@@ -50,6 +50,8 @@ bool HashedObjectStore::store(HashedObjectType type, uint32 index,
HashedObject::pointer object = boost::make_shared<HashedObject>(type, index, data, hash);
if (!mCache.canonicalize(hash, object))
{
LoadEvent::autoptr event(theApp->getJobQueue().getLoadEventAP(jtHO_WRITE, "HOS::store"));
std::vector<unsigned char> rawData(9 + data.size());
unsigned char* bufPtr = &rawData.front();
@@ -88,6 +90,7 @@ HashedObject::pointer HashedObjectStore::retrieve(const uint256& hash)
return obj;
}
LoadEvent::autoptr event(theApp->getJobQueue().getLoadEventAP(jtHO_READ, "HOS::retrieve"));
std::string sData;
leveldb::Status st = theApp->getHashNodeDB()->Get(leveldb::ReadOptions(),
leveldb::Slice(reinterpret_cast<const char *>(hash.begin()), hash.size()), &sData);

View File

@@ -60,6 +60,8 @@ const char* Job::toString(JobType t)
case jtTXN_PROC: return "processTransaction";
case jtOB_SETUP: return "orderBookSetup";
case jtPATH_FIND: return "pathFind";
case jtHO_READ: return "nodeRead";
case jtHO_WRITE: return "nodeWrite";
default: assert(false); return "unknown";
}
}

View File

@@ -45,9 +45,11 @@ enum JobType
jtACCEPTLEDGER = 26,
jtTXN_PROC = 27,
jtOB_SETUP = 28,
jtPATH_FIND = 29
jtPATH_FIND = 29,
jtHO_READ = 30,
jtHO_WRITE = 31,
}; // CAUTION: If you add new types, add them to JobType.cpp too
#define NUM_JOB_TYPES 32
#define NUM_JOB_TYPES 48
class Job
{