MetricsProxyContainer extends Container implements
        NodeDimensionsConfig.Producer,
        NodeInfoConfig.Producer,
        RpcConnectorConfig.Producer,
        VespaServicesConfig.Producer { @Override public void getConfig(RpcConnectorConfig.Builder builder) { builder.port(metricsRpcPort); } MetricsProxyContainer(AbstractConfigProducer parent, String hostname, int index, boolean isHostedVespa); @Override int getWantedPort(); @Override boolean requiresWantedPort(); @Override void allocatePorts(int start, PortAllocBridge from); @Override int getPortCount(); @Override void getConfig(RpcConnectorConfig.Builder builder); @Override void getConfig(VespaServicesConfig.Builder builder); @Override void getConfig(NodeDimensionsConfig.Builder builder); @Override void getConfig(NodeInfoConfig.Builder builder); static final int BASEPORT; }
@Test public void metrics_v2_handler_is_set_up_with_node_info_config() { String services = servicesWithContent(); VespaModel hostedModel = getModel(services, hosted); var container = (MetricsProxyContainer)hostedModel.id2producer().get(containerConfigId(hostedModel, hosted)); var handlers = container.getHandlers().getComponents(); assertEquals(1, handlers.size()); var metricsV2Handler = handlers.iterator().next(); NodeInfoConfig config = hostedModel.getConfig(NodeInfoConfig.class, metricsV2Handler.getConfigId()); assertTrue(config.role().startsWith("content/my-content/0/")); assertTrue(config.hostname().startsWith("node-1-3-9-")); }