From 85cdf32ba57676d773fc0ec0f83cebdb1b115d33 Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Wed, 8 Jan 2025 12:54:47 -0800 Subject: [PATCH] cut the option to skip the regex-match-cache Summary: The regex-match-cache (`folly::RegexMatchCache`), used in `ServiceData` and in associated classes, is stable. It is mandatory in the bookkeeping path and it is on-by-default in the query path for all services. But there is no longer any need to have the option to avoid it in the query path. Reviewed By: dmm-fb Differential Revision: D64484083 fbshipit-source-id: 67dd1886f1a6a0d015d3ac4a82590ba34fbe1650 --- fb303/ServiceData.cpp | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/fb303/ServiceData.cpp b/fb303/ServiceData.cpp index e753de05e..d14667020 100644 --- a/fb303/ServiceData.cpp +++ b/fb303/ServiceData.cpp @@ -34,11 +34,6 @@ using std::string; using std::string_view; using std::vector; -DEFINE_bool( - fb303_service_data_skip_regex_match_cache, - false, - "If true, getRegexCounters() will not query the regex match cache."); - namespace facebook::fb303 { template @@ -464,23 +459,7 @@ map ServiceData::getSelectedCounters( void ServiceData::getRegexCounters( map& _return, const string& regex) const { - if (!FLAGS_fb303_service_data_skip_regex_match_cache) { - getRegexCountersOptimized(_return, regex); - return; - } - - const boost::regex regexObject(regex); - auto keys = getCounterKeys(); - keys.erase( - std::remove_if( - keys.begin(), - keys.end(), - [&](const std::string& key) { - return !regex_match(key, regexObject); - }), - keys.end()); - - getSelectedCounters(_return, keys); + getRegexCountersOptimized(_return, regex); } void ServiceData::getRegexCountersOptimized(