From eaf103502b365b953cc0163edc0e4a3288f2d11b Mon Sep 17 00:00:00 2001 From: Dylan Forciea Date: Thu, 2 Mar 2023 09:26:51 -0600 Subject: [PATCH] Create option to dump malloc stats --- options.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/options.go b/options.go index eda0b72..b358319 100644 --- a/options.go +++ b/options.go @@ -1086,6 +1086,13 @@ func (opts *Options) SetMaxSuccessiveMerges(value int) { C.rocksdb_options_set_max_successive_merges(opts.c, C.size_t(value)) } +// SetDumpMallocStats will print malloc statistics to the LOG file for the +// database if set to true - jemalloc must be turned on for this to work. +// Default: false +func (opts *Options) SetDumpMallocStats(value bool) { + C.rocksdb_options_set_dump_malloc_stats(opts.c, boolToChar(value)) +} + // EnableStatistics enable statistics. func (opts *Options) EnableStatistics() { C.rocksdb_options_enable_statistics(opts.c)