Tracks range server memory used. More...
#include <MemoryTracker.h>
Public Member Functions | |
MemoryTracker (FileBlockCache *block_cache, QueryCachePtr query_cache) | |
Constructor. More... | |
void | add (int64_t amount) |
Add to memory used. More... | |
void | subtract (int64_t amount) |
Subtract to memory used. More... | |
int64_t | balance () |
Return total range server memory used. More... | |
Private Attributes | |
std::mutex | m_mutex |
Mutex to serialize concurrent access More... | |
int64_t | m_memory_used {} |
Current range server memory used. More... | |
FileBlockCache * | m_block_cache |
Pointer to block cache. More... | |
QueryCachePtr | m_query_cache |
Pointer to query cache. More... | |
Tracks range server memory used.
Definition at line 42 of file MemoryTracker.h.
|
inline |
Constructor.
block_cache | Pointer to block cache |
query_cache | Pointer to query cache |
Definition at line 48 of file MemoryTracker.h.
|
inline |
Add to memory used.
amount | Amount of memory to add |
Definition at line 53 of file MemoryTracker.h.
|
inline |
Return total range server memory used.
This member function returns the total amount of memory used, computed as m_memory_used plus block cache memory used plus query cache memory used.
Definition at line 70 of file MemoryTracker.h.
|
inline |
Subtract to memory used.
amount | Amount of memory to subtract |
Definition at line 60 of file MemoryTracker.h.
|
private |
Pointer to block cache.
Definition at line 85 of file MemoryTracker.h.
|
private |
Current range server memory used.
Definition at line 82 of file MemoryTracker.h.
|
private |
Mutex to serialize concurrent access
Definition at line 79 of file MemoryTracker.h.
|
private |
Pointer to query cache.
Definition at line 88 of file MemoryTracker.h.