diff options
author | Joao Eduardo Luis <joao.luis@inktank.com> | 2013-04-30 16:05:23 +0100 |
---|---|---|
committer | Joao Eduardo Luis <joao.luis@inktank.com> | 2013-04-30 16:05:23 +0100 |
commit | 891c54a6eee3cb2bb79601dc3f0414cda2716beb (patch) | |
tree | 2229f818edb1c5439e37ec5e39446b71335e38e9 | |
parent | 40d0ec6df12e0123cd730a9032da649fe148cd42 (diff) | |
download | ceph-891c54a6eee3cb2bb79601dc3f0414cda2716beb.tar.gz |
mon: MonitorDBStore: debug transactions
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
-rw-r--r-- | src/mon/MonitorDBStore.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mon/MonitorDBStore.h b/src/mon/MonitorDBStore.h index d1399d972f0..17abfec3407 100644 --- a/src/mon/MonitorDBStore.h +++ b/src/mon/MonitorDBStore.h @@ -184,13 +184,19 @@ class MonitorDBStore int apply_transaction(MonitorDBStore::Transaction& t) { KeyValueDB::Transaction dbt = db->get_transaction(); + uint64_t num_erase = 0, num_put = 0; + uint64_t num_bytes = 0; + for (list<Op>::iterator it = t.ops.begin(); it != t.ops.end(); ++it) { Op& op = *it; switch (op.type) { case Transaction::OP_PUT: + num_put ++; + num_bytes += op.bl.length(); dbt->set(op.prefix, op.key, op.bl); break; case Transaction::OP_ERASE: + num_erase ++; dbt->rmkey(op.prefix, op.key); break; default: @@ -199,9 +205,9 @@ class MonitorDBStore break; } } - generic_dout(0) << __func__ << " put: " << t.total_put - << " erase: " << t.total_erase - << " bytes: " << t.total_bytes << dendl; + generic_dout(0) << __func__ << " put: " << num_put + << " erase: " << num_erase + << " bytes: " << num_bytes << dendl; return db->submit_transaction_sync(dbt); } |