diff --git a/fb303/BaseService.cpp b/fb303/BaseService.cpp index cb7d0bade..454128603 100644 --- a/fb303/BaseService.cpp +++ b/fb303/BaseService.cpp @@ -22,8 +22,6 @@ THRIFT_FLAG_DEFINE_int64(fb303_counters_queue_timeout_ms, 5 * 1000); namespace facebook::fb303 { -/* static */ thread_local bool BaseService::useRegexCacheTL_ = false; - BaseService::~BaseService() = default; std::chrono::milliseconds BaseService::getCountersExpiration() const { diff --git a/fb303/BaseService.h b/fb303/BaseService.h index efa6d8fe6..732a9e3f4 100644 --- a/fb303/BaseService.h +++ b/fb303/BaseService.h @@ -28,8 +28,6 @@ namespace facebook { namespace fb303 { constexpr std::string_view kCountersLimitHeader{"fb303_counters_read_limit"}; -constexpr std::string_view kEnableRegexCachedHeader{ - "fb303_server_side_regex_enable_caching"}; enum ThriftFuncAction { FIRST_ACTION = 0, @@ -71,10 +69,6 @@ class BaseService : virtual public cpp2::BaseServiceSvIf { } ~BaseService() override; - static bool isThreadRegexCacheEnabled() { - return useRegexCacheTL_; - } - public: using cpp2::BaseServiceSvIf::ServerInterface::getName; void getName(std::string& _return) override { @@ -98,11 +92,7 @@ class BaseService : virtual public cpp2::BaseServiceSvIf { virtual void getRegexCounters( std::map& _return, std::unique_ptr regex) { - if (isThreadRegexCacheEnabled()) { - ServiceData::get()->getRegexCountersOptimized(_return, *regex); - } else { - ServiceData::get()->getRegexCounters(_return, *regex); - } + ServiceData::get()->getRegexCounters(_return, *regex); } /*** Returns a list of counter values */ @@ -274,13 +264,7 @@ class BaseService : virtual public cpp2::BaseServiceSvIf { std::optional limit = readThriftHeader(reqCtx, kCountersLimitHeader); std::map res; - std::optional enable_regex_caching = - readThriftHeader(reqCtx, kEnableRegexCachedHeader); - // save and restore thread-local used for out-of-band behavior flag - bool save = - std::exchange(useRegexCacheTL_, enable_regex_caching.has_value()); getRegexCounters(res, std::move(regex_)); - useRegexCacheTL_ = save; if (limit) { size_t numAvailable = res.size(); /*** Get first limit counters from map ***/ @@ -348,8 +332,6 @@ class BaseService : virtual public cpp2::BaseServiceSvIf { 2, std::make_shared("GetCountersCPU")}; std::optional getCountersExpiration_; - - static thread_local bool useRegexCacheTL_; }; } // namespace fb303