basho/leveldb — pull request #59 by matthewvon (2012-11-08 15:00:35+00:00)
Title: access node level performance counters via GetProperty

Sample code:

std::string output;
bool ret_flag;
leveldb::DB * db_ptr;

status=leveldb::DB::Open(options, dbname.c_str(), &db_ptr);
if (status.ok())
{
leveldb::Slice prop;
prop="leveldb.ApiOpen";
ret_flag=db_ptr->GetProperty(prop, &output);
printf("flag %d, value %s\n", (int)ret_flag, output.c_str());

prop="leveldb.ReadBlockError";
ret_flag=db_ptr->GetProperty(prop, &output);
printf("flag %d, value %s\n", (int)ret_flag, output.c_str());

prop="leveldb.Bob";
ret_flag=db_ptr->GetProperty(prop, &output);
printf("flag %d, value %s\n", (int)ret_flag, output.c_str());

delete db_ptr;
} // if