Extract repositories metrics into its own class (#103034)

This PR is a follow up of
https://github.com/elastic/elasticsearch/pull/102505#discussion_r1402957598
that move the repositories metrics management into its own class which
is then passed around instead of relying on the raw meterRegistry and
string metric names.
This commit is contained in:
Yang Wang 2023-12-08 10:26:17 +11:00 committed by GitHub
parent e20821f13e
commit b9c29807ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 210 additions and 145 deletions

View file

@ -18,6 +18,7 @@ import org.elasticsearch.env.Environment;
import org.elasticsearch.indices.recovery.RecoverySettings;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.plugins.RepositoryPlugin;
import org.elasticsearch.repositories.RepositoriesMetrics;
import org.elasticsearch.repositories.Repository;
import org.elasticsearch.repositories.url.URLRepository;
import org.elasticsearch.xcontent.NamedXContentRegistry;
@ -47,7 +48,8 @@ public class URLRepositoryPlugin extends Plugin implements RepositoryPlugin {
NamedXContentRegistry namedXContentRegistry,
ClusterService clusterService,
BigArrays bigArrays,
RecoverySettings recoverySettings
RecoverySettings recoverySettings,
RepositoriesMetrics repositoriesMetrics
) {
return Collections.singletonMap(URLRepository.TYPE, metadata -> {
assert httpClientFactory.get() != null : "Expected to get a configured http client factory";