mirror of
https://github.com/ceph/ceph
synced 2026-08-02 07:03:18 +00:00
os/bluestore: add per-instance new allocator perf counters
Fixes: https://tracker.ceph.com/issues/76936 Signed-off-by: Jaya Prakash <jayaprakash@ibm.com>
This commit is contained in:
parent
14deb05b8e
commit
1a0ee9b11d
@ -207,3 +207,31 @@ void AllocatorBase::FreeStateHistogram::foreach(
|
||||
++i;
|
||||
}
|
||||
}
|
||||
void AllocatorPerf::_init_logger(std::string_view name) {
|
||||
PerfCountersBuilder b(cct,
|
||||
"bluestore-alloc-" + std::string(name),
|
||||
l_bluestore_allocator_first,
|
||||
l_bluestore_allocator_last);
|
||||
|
||||
b.add_time_avg(l_bluestore_allocator_alloc_process_lat,
|
||||
"alloc_process_lat",
|
||||
"Allocator processing latency",
|
||||
"apl",
|
||||
PerfCountersBuilder::PRIO_USEFUL);
|
||||
b.add_time_avg(l_bluestore_allocator_lock_wait_lat,
|
||||
"lock_wait_lat",
|
||||
"Allocator lock wait latency",
|
||||
"lwl",
|
||||
PerfCountersBuilder::PRIO_USEFUL);
|
||||
|
||||
logger = b.create_perf_counters();
|
||||
|
||||
cct->get_perfcounters_collection()->add(logger);
|
||||
}
|
||||
void AllocatorPerf::_shutdown_logger() {
|
||||
if (logger) {
|
||||
cct->get_perfcounters_collection()->remove(logger);
|
||||
delete logger;
|
||||
logger = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,6 +19,15 @@
|
||||
#include "bluestore_types.h"
|
||||
#include "common/ceph_mutex.h"
|
||||
#include "Allocator.h"
|
||||
#include "common/perf_counters.h"
|
||||
#include "common/perf_counters_collection.h"
|
||||
|
||||
enum {
|
||||
l_bluestore_allocator_first = 732300,
|
||||
l_bluestore_allocator_alloc_process_lat,
|
||||
l_bluestore_allocator_lock_wait_lat,
|
||||
l_bluestore_allocator_last
|
||||
};
|
||||
|
||||
class AllocatorBase : public Allocator {
|
||||
protected:
|
||||
@ -295,4 +304,24 @@ private:
|
||||
SocketHook* asok_hook = nullptr;
|
||||
};
|
||||
|
||||
class AllocatorPerf {
|
||||
private:
|
||||
CephContext* cct = nullptr;
|
||||
protected:
|
||||
PerfCounters *logger = nullptr;
|
||||
public:
|
||||
AllocatorPerf() = delete;
|
||||
AllocatorPerf(CephContext* cct, std::string_view name)
|
||||
: cct(cct)
|
||||
{
|
||||
_init_logger(name);
|
||||
}
|
||||
~AllocatorPerf() {
|
||||
_shutdown_logger();
|
||||
}
|
||||
private:
|
||||
void _init_logger(std::string_view name);
|
||||
void _shutdown_logger();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user