horaedb
horaedb copied to clipboard
Track memory usage in `MemUsageCollector`
Description
We have implemented a MemUsageCollector in https://github.com/CeresDB/ceresdb/blob/6b929ca19a/analytic_engine/src/instance/mem_collector.rs but no one reports memory consumptions to it.
One of the use cases is deciding whether to schedule a flush job based on memory usage: https://github.com/CeresDB/ceresdb/blob/6b929ca19abf48ba9afd1cb554ec9a25c7783a42/analytic_engine/src/instance/write.rs#L307-L331
Proposal
Tracking allocation using this collector. For now I think tracks memtable is enough
Additional context