Remove nodes allocated/released metrics
This commit is contained in:
@@ -587,8 +587,6 @@ struct Counter : private Metric {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class T> struct BoundedFreeListAllocator {
|
template <class T> struct BoundedFreeListAllocator {
|
||||||
Counter *allocated_total = nullptr;
|
|
||||||
Counter *released_total = nullptr;
|
|
||||||
|
|
||||||
static_assert(sizeof(T) >= sizeof(void *));
|
static_assert(sizeof(T) >= sizeof(void *));
|
||||||
static_assert(std::derived_from<T, Node>);
|
static_assert(std::derived_from<T, Node>);
|
||||||
@@ -623,7 +621,6 @@ template <class T> struct BoundedFreeListAllocator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
T *allocate(int partialKeyCapacity) {
|
T *allocate(int partialKeyCapacity) {
|
||||||
allocated_total->add(1);
|
|
||||||
T *result = allocate_helper(partialKeyCapacity);
|
T *result = allocate_helper(partialKeyCapacity);
|
||||||
if constexpr (!std::is_same_v<T, Node0>) {
|
if constexpr (!std::is_same_v<T, Node0>) {
|
||||||
memset(result->children, 0, sizeof(result->children));
|
memset(result->children, 0, sizeof(result->children));
|
||||||
@@ -640,7 +637,6 @@ template <class T> struct BoundedFreeListAllocator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void release(T *p) {
|
void release(T *p) {
|
||||||
released_total->add(1);
|
|
||||||
if (freeListBytes >= kFreeListMaxMemory) {
|
if (freeListBytes >= kFreeListMaxMemory) {
|
||||||
removeNode(p);
|
removeNode(p);
|
||||||
return safe_free(p, sizeof(T) + p->partialKeyCapacity);
|
return safe_free(p, sizeof(T) + p->partialKeyCapacity);
|
||||||
@@ -3202,16 +3198,6 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl {
|
|||||||
|
|
||||||
allocators.~NodeAllocators();
|
allocators.~NodeAllocators();
|
||||||
new (&allocators) NodeAllocators();
|
new (&allocators) NodeAllocators();
|
||||||
allocators.node0.allocated_total = &node0_allocated_total;
|
|
||||||
allocators.node3.allocated_total = &node3_allocated_total;
|
|
||||||
allocators.node16.allocated_total = &node16_allocated_total;
|
|
||||||
allocators.node48.allocated_total = &node48_allocated_total;
|
|
||||||
allocators.node256.allocated_total = &node256_allocated_total;
|
|
||||||
allocators.node0.released_total = &node0_released_total;
|
|
||||||
allocators.node3.released_total = &node3_released_total;
|
|
||||||
allocators.node16.released_total = &node16_released_total;
|
|
||||||
allocators.node48.released_total = &node48_released_total;
|
|
||||||
allocators.node256.released_total = &node256_released_total;
|
|
||||||
|
|
||||||
removalKeyArena = Arena{};
|
removalKeyArena = Arena{};
|
||||||
removalKey = {};
|
removalKey = {};
|
||||||
@@ -3280,26 +3266,6 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl {
|
|||||||
#define COUNTER(name, help) \
|
#define COUNTER(name, help) \
|
||||||
Counter name { this, #name, help }
|
Counter name { this, #name, help }
|
||||||
// ==================== METRICS DEFINITIONS ====================
|
// ==================== METRICS DEFINITIONS ====================
|
||||||
COUNTER(node0_allocated_total,
|
|
||||||
"Total number of nodes of type \"Node0\" that have been allocated");
|
|
||||||
COUNTER(node3_allocated_total,
|
|
||||||
"Total number of nodes of type \"Node3\" that have been allocated");
|
|
||||||
COUNTER(node16_allocated_total,
|
|
||||||
"Total number of nodes of type \"Node16\" that have been allocated");
|
|
||||||
COUNTER(node48_allocated_total,
|
|
||||||
"Total number of nodes of type \"Node48\" that have been allocated");
|
|
||||||
COUNTER(node256_allocated_total,
|
|
||||||
"Total number of nodes of type \"Node256\" that have been allocated");
|
|
||||||
COUNTER(node0_released_total,
|
|
||||||
"Total number of nodes of type \"Node0\" that have been released");
|
|
||||||
COUNTER(node3_released_total,
|
|
||||||
"Total number of nodes of type \"Node3\" that have been released");
|
|
||||||
COUNTER(node16_released_total,
|
|
||||||
"Total number of nodes of type \"Node16\" that have been released");
|
|
||||||
COUNTER(node48_released_total,
|
|
||||||
"Total number of nodes of type \"Node48\" that have been released");
|
|
||||||
COUNTER(node256_released_total,
|
|
||||||
"Total number of nodes of type \"Node256\" that have been released");
|
|
||||||
GAUGE(memory_bytes, "Total number of bytes in use.");
|
GAUGE(memory_bytes, "Total number of bytes in use.");
|
||||||
COUNTER(read_point_total, "Total number of point reads checked.");
|
COUNTER(read_point_total, "Total number of point reads checked.");
|
||||||
COUNTER(read_prefix_total, "Total number of prefix reads checked.");
|
COUNTER(read_prefix_total, "Total number of prefix reads checked.");
|
||||||
|
Reference in New Issue
Block a user