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));
}
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));
}
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);
}
Aggregations