mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 05:03:10 +00:00
Add stats: arena uptime.
This commit is contained in:
10
src/stats.c
10
src/stats.c
@@ -421,6 +421,7 @@ stats_arena_print(void (*write_cb)(void *, const char *), void *cbopaque,
|
||||
size_t large_allocated;
|
||||
uint64_t large_nmalloc, large_ndalloc, large_nrequests;
|
||||
size_t tcache_bytes;
|
||||
uint64_t uptime;
|
||||
|
||||
CTL_GET("arenas.page", &page, size_t);
|
||||
|
||||
@@ -433,6 +434,15 @@ stats_arena_print(void (*write_cb)(void *, const char *), void *cbopaque,
|
||||
"assigned threads: %u\n", nthreads);
|
||||
}
|
||||
|
||||
CTL_M2_GET("stats.arenas.0.uptime", i, &uptime, uint64_t);
|
||||
if (json) {
|
||||
malloc_cprintf(write_cb, cbopaque,
|
||||
"\t\t\t\t\"uptime_ns\": %"FMTu64",\n", uptime);
|
||||
} else {
|
||||
malloc_cprintf(write_cb, cbopaque,
|
||||
"uptime: %"FMTu64"\n", uptime);
|
||||
}
|
||||
|
||||
CTL_M2_GET("stats.arenas.0.dss", i, &dss, const char *);
|
||||
if (json) {
|
||||
malloc_cprintf(write_cb, cbopaque,
|
||||
|
||||
Reference in New Issue
Block a user