diff options
author | Joao Eduardo Luis <joao.luis@inktank.com> | 2013-04-29 22:27:34 +0100 |
---|---|---|
committer | Joao Eduardo Luis <joao.luis@inktank.com> | 2013-04-29 22:27:34 +0100 |
commit | 195f0e7aa5716d7c3b24bb9ea9efb5ef53b4b10f (patch) | |
tree | 10801a77882b62f1c851163344e1fe8f303807d4 | |
parent | 058c6993e70a1a366a3ee8b262c8e90b5d1a3d83 (diff) | |
download | ceph-195f0e7aa5716d7c3b24bb9ea9efb5ef53b4b10f.tar.gz |
mon: MonitorDBStore: debug info on apply_transaction()
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
-rw-r--r-- | src/mon/MonitorDBStore.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mon/MonitorDBStore.h b/src/mon/MonitorDBStore.h index b14c5aaae46..d1399d972f0 100644 --- a/src/mon/MonitorDBStore.h +++ b/src/mon/MonitorDBStore.h @@ -66,6 +66,9 @@ class MonitorDBStore struct Transaction { list<Op> ops; + uint64_t total_erase; + uint64_t total_put; + uint64_t total_bytes; enum { OP_PUT = 1, @@ -74,6 +77,8 @@ class MonitorDBStore void put(string prefix, string key, bufferlist& bl) { ops.push_back(Op(OP_PUT, prefix, key, bl)); + total_put ++; + total_bytes += bl.length(); } void put(string prefix, version_t ver, bufferlist& bl) { @@ -90,6 +95,7 @@ class MonitorDBStore void erase(string prefix, string key) { ops.push_back(Op(OP_ERASE, prefix, key)); + total_erase ++; } void erase(string prefix, version_t ver) { @@ -112,6 +118,10 @@ class MonitorDBStore void append(Transaction& other) { ops.splice(ops.end(), other.ops); + + total_put += other.total_put; + total_erase += other.total_erase; + total_bytes += other.total_bytes; } void append_from_encoded(bufferlist& bl) { @@ -189,6 +199,10 @@ class MonitorDBStore break; } } + generic_dout(0) << __func__ << " put: " << t.total_put + << " erase: " << t.total_erase + << " bytes: " << t.total_bytes << dendl; + return db->submit_transaction_sync(dbt); } |