diff --git a/include/pika_conf.h b/include/pika_conf.h index 671f987ff..76a57d7a3 100644 --- a/include/pika_conf.h +++ b/include/pika_conf.h @@ -844,6 +844,12 @@ class PikaConf : public pstd::BaseConf { pstd::StringSplit2Set(lower_value, ',', admin_cmd_set_); } + void SetOpenRocksdbStatisticsTickers(const std::string& value) { + std::lock_guard l(rwlock_); + TryPushDiffCommands("open-rocksdb-statistics-tickers", value); + open_rocksdb_statistics_tickers_ = value == "true"; + } + void SetCacheType(const std::string &value); void SetCacheDisableFlag() { tmp_cache_disable_flag_ = true; } int zset_cache_start_direction() { return zset_cache_start_direction_; } diff --git a/src/pika_admin.cc b/src/pika_admin.cc index fa15707e2..ef8a5cfe4 100644 --- a/src/pika_admin.cc +++ b/src/pika_admin.cc @@ -2198,6 +2198,7 @@ void ConfigCmd::ConfigSet(std::shared_ptr db) { "slave-priority", "sync-window-size", "slow-cmd-list", + "open-rocksdb-statistics-tickers", // Options for storage engine // MutableDBOptions "max-cache-files", @@ -2861,6 +2862,21 @@ void ConfigCmd::ConfigSet(std::shared_ptr db) { } g_pika_conf->SetMaxConnRbufSize(static_cast(ival)); res_.AppendStringRaw("+OK\r\n"); + } else if (set_item == "open-rocksdb-statistics-tickers") { + std::string v(value); + pstd::StringToLower(v); + if (v != "yes" && v != "no") { + res_.AppendStringRaw("-ERR Invalid argument \'" + value + "\' for CONFIG SET 'open-rocksdb-statistics-tickers'\r\n"); + return; + } + g_pika_conf->SetOpenRocksdbStatisticsTickers(value); + res_.AppendStringRaw("+OK\r\n"); + if (pstd::string2int(value.data(), value.size(), &ival) == 0 || ival < PIKA_MAX_CONN_RBUF_LB || ival > PIKA_MAX_CONN_RBUF_HB * 2) { + res_.AppendStringRaw( "-ERR Invalid argument \'" + value + "\' for CONFIG SET 'max-conn-rbuf-size'\r\n"); + return; + } + g_pika_conf->SetMaxConnRbufSize(static_cast(ival)); + res_.AppendStringRaw("+OK\r\n"); } else { res_.AppendStringRaw("-ERR Unsupported CONFIG parameter: " + set_item + "\r\n"); }