summaryrefslogtreecommitdiff
path: root/src/osdc
diff options
context:
space:
mode:
authorSage Weil <sage.weil@dreamhost.com>2012-04-13 22:19:00 -0700
committerSage Weil <sage.weil@dreamhost.com>2012-04-13 22:19:00 -0700
commita31392cf909b4f4af9efe446c5a6fac1bb16852a (patch)
treee0af5cb56a682c2c488405d0e77123087fd571cd /src/osdc
parent28e61811dc3dccd922bd0b30cf614c2768e7d6d0 (diff)
downloadceph-a31392cf909b4f4af9efe446c5a6fac1bb16852a.tar.gz
objectcacher: name them
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Diffstat (limited to 'src/osdc')
-rw-r--r--src/osdc/ObjectCacher.cc20
-rw-r--r--src/osdc/ObjectCacher.h3
2 files changed, 14 insertions, 9 deletions
diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc
index 7d6c18d58ce..0d3e7e6602b 100644
--- a/src/osdc/ObjectCacher.cc
+++ b/src/osdc/ObjectCacher.cc
@@ -15,6 +15,9 @@
#define dout_subsys ceph_subsys_objectcacher
#undef dout_prefix
#define dout_prefix *_dout << "objectcacher.object(" << oid << ") "
+
+
+
ObjectCacher::BufferHead *ObjectCacher::Object::split(BufferHead *left, loff_t off)
{
ldout(oc->cct, 20) << "split " << *left << " at " << off << dendl;
@@ -413,16 +416,16 @@ void ObjectCacher::Object::truncate(loff_t s)
#define dout_prefix *_dout << "objectcacher "
-ObjectCacher::
-ObjectCacher(CephContext *cct_, WritebackHandler& wb, Mutex& l,
- flush_set_callback_t flush_callback,
- void *flush_callback_arg) :
- perfcounter(NULL),
- cct(cct_), writeback_handler(wb), lock(l),
+ObjectCacher::ObjectCacher(CephContext *cct_, string name, WritebackHandler& wb, Mutex& l,
+ flush_set_callback_t flush_callback,
+ void *flush_callback_arg)
+ : perfcounter(NULL),
+ cct(cct_), writeback_handler(wb), name(name), lock(l),
flush_set_callback(flush_callback), flush_set_callback_arg(flush_callback_arg),
flusher_stop(false), flusher_thread(this),
stat_waiter(0),
- stat_clean(0), stat_dirty(0), stat_rx(0), stat_tx(0), stat_missing(0) {
+ stat_clean(0), stat_dirty(0), stat_rx(0), stat_tx(0), stat_missing(0)
+{
perf_start();
}
@@ -441,7 +444,8 @@ ObjectCacher::~ObjectCacher()
void ObjectCacher::perf_start()
{
- PerfCountersBuilder plb(cct, "objectcacher", l_objectcacher_first, l_objectcacher_last);
+ string n = "objectcacher-" + name;
+ PerfCountersBuilder plb(cct, n, l_objectcacher_first, l_objectcacher_last);
plb.add_u64_counter(l_objectcacher_cache_ops_hit, "cache_ops_hit");
plb.add_u64_counter(l_objectcacher_cache_ops_miss, "cache_ops_miss");
diff --git a/src/osdc/ObjectCacher.h b/src/osdc/ObjectCacher.h
index a3fe74fce5b..767f73c3abf 100644
--- a/src/osdc/ObjectCacher.h
+++ b/src/osdc/ObjectCacher.h
@@ -275,6 +275,7 @@ class ObjectCacher {
private:
WritebackHandler& writeback_handler;
+ string name;
Mutex& lock;
flush_set_callback_t flush_set_callback;
@@ -429,7 +430,7 @@ class ObjectCacher {
- ObjectCacher(CephContext *cct_, WritebackHandler& wb, Mutex& l,
+ ObjectCacher(CephContext *cct_, string name, WritebackHandler& wb, Mutex& l,
flush_set_callback_t flush_callback,
void *flush_callback_arg);
~ObjectCacher();