test_filestore_workloadgen: track pg log size in memory

Avoid a stat!

Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2012-04-20 15:35:44 -07:00
parent 6b28f55cd3
commit a68b3069de
2 changed files with 5 additions and 6 deletions

View File

@ -246,12 +246,9 @@ void WorkloadGenerator::do_append_log(ObjectStore::Transaction *t,
bufferlist bl;
get_filled_byte_array(bl, log_append_bytes);
hobject_t log_obj = get_coll_meta_object(coll);
struct stat st;
int err = m_store->stat(META_COLL, log_obj, &st);
// dout(0) << "stat return: " << err << dendl;
assert(err >= 0);
t->write(META_COLL, log_obj, st.st_size, bl.length(), bl);
uint64_t s = pg_log_size[coll];
t->write(META_COLL, log_obj, s, bl.length(), bl);
pg_log_size[coll] += bl.length();
}
void WorkloadGenerator::do_destroy_collection(ObjectStore::Transaction *t,

View File

@ -77,6 +77,8 @@ private:
rngen_t m_rng;
map<coll_t, uint64_t> pg_log_size;
void wait_for_ready() {
while (m_in_flight >= max_in_flight)
m_cond.Wait(m_lock);