Search in sources :

Example 6 with Monitoring

use of com.yahoo.vespa.model.admin.monitoring.Monitoring in project vespa by vespa-engine.

the class DomAdminV2BuilderTest method basicYamasXml.

@Test
public void basicYamasXml() {
    Admin admin = buildAdmin(servicesYamas());
    Monitoring y = admin.getMonitoring();
    assertThat(y.getClustername(), is("foo"));
    assertThat(y.getInterval(), is(1));
}
Also used : Monitoring(com.yahoo.vespa.model.admin.monitoring.Monitoring) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Example 7 with Monitoring

use of com.yahoo.vespa.model.admin.monitoring.Monitoring in project vespa by vespa-engine.

the class DomAdminV2BuilderTest method yamasWithIntervalOverride.

@Test
public void yamasWithIntervalOverride() {
    Admin admin = buildAdmin(servicesYamasIntervalOverride());
    Monitoring y = admin.getMonitoring();
    assertThat(y.getClustername(), is("foo"));
    assertThat(y.getInterval(), is(5));
}
Also used : Monitoring(com.yahoo.vespa.model.admin.monitoring.Monitoring) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Example 8 with Monitoring

use of com.yahoo.vespa.model.admin.monitoring.Monitoring in project vespa by vespa-engine.

the class DedicatedAdminV4Test method testModelBuilding.

@Test
public void testModelBuilding() throws IOException, SAXException {
    String services = "<services>" + "  <admin version='4.0'>" + "    <slobroks><nodes count='2' dedicated='true'/></slobroks>" + "    <logservers><nodes count='1' dedicated='true'/></logservers>" + "    <yamas systemname='vespa.routing' interval='60' />" + "    <metrics>" + "     <consumer id='slingstone'>" + "        <metric id='foobar.count' display-name='foobar'/>" + "     </consumer>" + "    </metrics>" + "    <metric-consumers>" + "      <consumer name='yamas'>" + "        <metric name='upstreams_generated' />" + "        <metric name='upstreams_nginx_reloads' />" + "        <metric name='nginx.upstreams.down.last' output-name='nginx.upstreams.down'/>" + "      </consumer>" + "    </metric-consumers>" + "    <identity>" + "        <domain>mydomain</domain>" + "        <service>myservice</service>" + "    </identity>" + "  </admin>" + "</services>";
    VespaModel model = createModel(hosts, services);
    assertEquals(3, model.getHosts().size());
    assertHostContainsServices(model, "hosts/myhost0", "slobrok", "logd");
    assertHostContainsServices(model, "hosts/myhost1", "slobrok", "logd");
    assertHostContainsServices(model, "hosts/myhost2", "logserver", "logd");
    Monitoring monitoring = model.getAdmin().getMonitoring();
    assertEquals("vespa.routing", monitoring.getClustername());
    assertEquals(60L, (long) monitoring.getIntervalSeconds());
    MetricsConsumer consumer = model.getAdmin().getUserMetrics().getConsumers().get("slingstone");
    assertNotNull(consumer);
    Metric metric = consumer.getMetrics().get("foobar.count");
    assertNotNull(metric);
    assertEquals("foobar", metric.outputName);
    consumer = model.getAdmin().getLegacyUserMetricsConsumers().get(VESPA_CONSUMER_ID);
    assertNotNull(consumer);
    assertEquals(3, consumer.getMetrics().size());
    metric = consumer.getMetrics().get("nginx.upstreams.down.last");
    assertNotNull(metric);
    assertEquals("nginx.upstreams.down", metric.outputName);
}
Also used : VespaModel(com.yahoo.vespa.model.VespaModel) MetricsConsumer(com.yahoo.vespa.model.admin.monitoring.MetricsConsumer) Metric(com.yahoo.vespa.model.admin.monitoring.Metric) Monitoring(com.yahoo.vespa.model.admin.monitoring.Monitoring) Test(org.junit.Test)

Aggregations

Monitoring (com.yahoo.vespa.model.admin.monitoring.Monitoring)8 Test (org.junit.Test)4 DomBuilderTest (com.yahoo.config.model.builder.xml.test.DomBuilderTest)3 MetricsConsumer (com.yahoo.vespa.model.admin.monitoring.MetricsConsumer)3 Metric (com.yahoo.vespa.model.admin.monitoring.Metric)2 MetricsmanagerConfig (com.yahoo.metrics.MetricsmanagerConfig)1 VespaModel (com.yahoo.vespa.model.VespaModel)1 DefaultMonitoring (com.yahoo.vespa.model.admin.monitoring.DefaultMonitoring)1 Metrics (com.yahoo.vespa.model.admin.monitoring.builder.Metrics)1 MetricsBuilder (com.yahoo.vespa.model.admin.monitoring.builder.xml.MetricsBuilder)1 ContainerModelBuilder (com.yahoo.vespa.model.container.xml.ContainerModelBuilder)1 FileDistributionConfigProducer (com.yahoo.vespa.model.filedistribution.FileDistributionConfigProducer)1