diff options
author | Harald Musum <musum@oath.com> | 2017-11-09 11:31:21 +0100 |
---|---|---|
committer | Harald Musum <musum@oath.com> | 2017-11-09 11:31:21 +0100 |
commit | b48b47867cdd9551896c9c3651b5b2d6a38165c7 (patch) | |
tree | 914ac0bb71caf1a751f8b30d1258f23b7040f821 /configserver/src/main | |
parent | 3143f748bbe39f480f44611bb814a2387983f913 (diff) |
Metrics is available in component registry, remove from constructor args
Diffstat (limited to 'configserver/src/main')
-rw-r--r-- | configserver/src/main/java/com/yahoo/vespa/config/server/tenant/Tenants.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/Tenants.java b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/Tenants.java index 866d1563e3f..f256d46218c 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/Tenants.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/Tenants.java @@ -11,7 +11,6 @@ import com.yahoo.log.LogLevel; import com.yahoo.path.Path; import com.yahoo.vespa.config.server.GlobalComponentRegistry; import com.yahoo.vespa.config.server.monitoring.MetricUpdater; -import com.yahoo.vespa.config.server.monitoring.Metrics; import com.yahoo.vespa.curator.Curator; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent; @@ -78,10 +77,10 @@ public class Tenants implements ConnectionStateListener, PathChildrenCacheListen * @throws Exception is creating the Tenants instance fails */ @Inject - public Tenants(GlobalComponentRegistry globalComponentRegistry, Metrics metrics) throws Exception { + public Tenants(GlobalComponentRegistry globalComponentRegistry) throws Exception { this.globalComponentRegistry = globalComponentRegistry; this.curator = globalComponentRegistry.getCurator(); - metricUpdater = metrics.getOrCreateMetricUpdater(Collections.emptyMap()); + metricUpdater = globalComponentRegistry.getMetrics().getOrCreateMetricUpdater(Collections.emptyMap()); this.tenantListeners.add(globalComponentRegistry.getTenantListener()); curator.framework().getConnectionStateListenable().addListener(this); @@ -99,13 +98,12 @@ public class Tenants implements ConnectionStateListener, PathChildrenCacheListen /** * New instance containing the given tenants. This will not create Zookeeper watches. For testing only * @param globalComponentRegistry a {@link com.yahoo.vespa.config.server.GlobalComponentRegistry} instance - * @param metrics a {@link com.yahoo.vespa.config.server.monitoring.Metrics} instance * @param tenants a collection of {@link Tenant}s */ - public Tenants(GlobalComponentRegistry globalComponentRegistry, Metrics metrics, Collection<Tenant> tenants) { + public Tenants(GlobalComponentRegistry globalComponentRegistry, Collection<Tenant> tenants) { this.globalComponentRegistry = globalComponentRegistry; this.curator = globalComponentRegistry.getCurator(); - metricUpdater = metrics.getOrCreateMetricUpdater(Collections.emptyMap()); + metricUpdater = globalComponentRegistry.getMetrics().getOrCreateMetricUpdater(Collections.emptyMap()); this.tenantListeners.add(globalComponentRegistry.getTenantListener()); curator.create(tenantsPath); createSystemTenants(globalComponentRegistry.getConfigserverConfig()); |