Skip to content

Commit bf8f50a

Browse files
committed
fix: simplify jemalloc metrics (#23)
1 parent af0464e commit bf8f50a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/alloc/src/stats.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ pub fn update_jemalloc_metrics() -> Result<(), Error> {
137137
// Cumulative number of allocation requests satisfied by bin regions of the
138138
// corresponding size class.
139139
gauge("jemalloc_memory_bin_nrequests", bin_stats.nrequests);
140+
141+
let active = bin_stats.nmalloc - bin_stats.ndalloc;
142+
143+
gauge("jemalloc_memory_bin_nactive", active);
144+
gauge("jemalloc_memory_bin_nactive_size", active * bin_const.size);
140145
}
141146

142147
Ok(())

0 commit comments

Comments
 (0)