diff --git a/db/c.cc b/db/c.cc index db6dfee11..f92ca8047 100644 --- a/db/c.cc +++ b/db/c.cc @@ -2720,6 +2720,16 @@ unsigned int rocksdb_options_get_stats_dump_period_sec(rocksdb_options_t* opt) { return opt->rep.stats_dump_period_sec; } +void rocksdb_options_set_stats_persist_period_sec(rocksdb_options_t* opt, + unsigned int v) { + opt->rep.stats_persist_period_sec = v; +} + +unsigned int rocksdb_options_get_stats_persist_period_sec( + rocksdb_options_t* opt) { + return opt->rep.stats_persist_period_sec; +} + void rocksdb_options_set_advise_random_on_open( rocksdb_options_t* opt, unsigned char v) { opt->rep.advise_random_on_open = v; diff --git a/db/c_test.c b/db/c_test.c index 5b360dcb1..67aaee0b0 100644 --- a/db/c_test.c +++ b/db/c_test.c @@ -1672,6 +1672,9 @@ int main(int argc, char** argv) { rocksdb_options_set_stats_dump_period_sec(o, 18); CheckCondition(18 == rocksdb_options_get_stats_dump_period_sec(o)); + rocksdb_options_set_stats_persist_period_sec(o, 5); + CheckCondition(5 == rocksdb_options_get_stats_persist_period_sec(o)); + rocksdb_options_set_advise_random_on_open(o, 1); CheckCondition(1 == rocksdb_options_get_advise_random_on_open(o)); @@ -1825,6 +1828,7 @@ int main(int argc, char** argv) { CheckCondition(1 == rocksdb_options_get_is_fd_close_on_exec(copy)); CheckCondition(1 == rocksdb_options_get_skip_log_error_on_recovery(copy)); CheckCondition(18 == rocksdb_options_get_stats_dump_period_sec(copy)); + CheckCondition(5 == rocksdb_options_get_stats_persist_period_sec(copy)); CheckCondition(1 == rocksdb_options_get_advise_random_on_open(copy)); CheckCondition(3 == rocksdb_options_get_access_hint_on_compaction_start(copy)); @@ -2112,6 +2116,10 @@ int main(int argc, char** argv) { CheckCondition(218 == rocksdb_options_get_stats_dump_period_sec(copy)); CheckCondition(18 == rocksdb_options_get_stats_dump_period_sec(o)); + rocksdb_options_set_stats_persist_period_sec(copy, 600); + CheckCondition(600 == rocksdb_options_get_stats_persist_period_sec(copy)); + CheckCondition(5 == rocksdb_options_get_stats_persist_period_sec(o)); + rocksdb_options_set_advise_random_on_open(copy, 0); CheckCondition(0 == rocksdb_options_get_advise_random_on_open(copy)); CheckCondition(1 == rocksdb_options_get_advise_random_on_open(o)); diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 132552ced..37da5f16e 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -1104,6 +1104,10 @@ extern ROCKSDB_LIBRARY_API void rocksdb_options_set_stats_dump_period_sec( rocksdb_options_t*, unsigned int); extern ROCKSDB_LIBRARY_API unsigned int rocksdb_options_get_stats_dump_period_sec(rocksdb_options_t*); +extern ROCKSDB_LIBRARY_API void rocksdb_options_set_stats_persist_period_sec( + rocksdb_options_t*, unsigned int); +extern ROCKSDB_LIBRARY_API unsigned int +rocksdb_options_get_stats_persist_period_sec(rocksdb_options_t*); extern ROCKSDB_LIBRARY_API void rocksdb_options_set_advise_random_on_open( rocksdb_options_t*, unsigned char); extern ROCKSDB_LIBRARY_API unsigned char