@@ -24,7 +24,7 @@ namespace cache {
2424
2525namespace impl {
2626
27- utils::statistics::Entry RegisterOnStatisticsStorage (
27+ void RegisterOnStatisticsStorage (
2828 const components::ComponentContext& context,
2929 const std::string& name,
3030 std::function<void (utils::statistics::Writer&)> func
@@ -107,7 +107,6 @@ class LruCacheComponent : public components::ComponentBase, private dump::Dumpab
107107
108108 // Subscriptions must be the last fields.
109109 concurrent::AsyncEventSubscriberScope config_subscription_;
110- utils::statistics::Entry statistics_holder_;
111110 testsuite::CacheResetRegistration reset_registration_;
112111 // See the comment above before adding a new field.
113112};
@@ -145,17 +144,14 @@ LruCacheComponent<
145144 LOG_INFO () << " Dynamic LRU cache config is disabled, cache=" << name_;
146145 }
147146
148- statistics_holder_ = impl::RegisterOnStatisticsStorage (context, name_, [this ](utils::statistics::Writer& writer) {
149- writer = *cache_;
150- });
147+ impl::RegisterOnStatisticsStorage (context, name_, [this ](utils::statistics::Writer& writer) { writer = *cache_; });
151148
152149 reset_registration_ = testsuite::RegisterCache (context, this , &LruCacheComponent::DropCache);
153150}
154151
155152template <typename Key, typename Value, typename Hash, typename Equal>
156153LruCacheComponent<Key, Value, Hash, Equal>::~LruCacheComponent () {
157154 reset_registration_.Unregister ();
158- statistics_holder_.Unregister ();
159155 config_subscription_.Unsubscribe ();
160156
161157 if (dumper_) {
0 commit comments