mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-03 10:37:52 +03:00
Add stats: arena uptime.
This commit is contained in:
parent
04fec5e084
commit
baf3e294e0
6 changed files with 42 additions and 0 deletions
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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue