use of com.yahoo.vespa.hosted.controller.MetricsMock.MapContext in project vespa by vespa-engine.
the class MetricsReporterTest method test_chef_metrics.
@Test
public void test_chef_metrics() {
Clock clock = Clock.fixed(Instant.ofEpochSecond(1475497913), ZoneId.systemDefault());
;
ControllerTester tester = new ControllerTester();
MetricsReporter metricsReporter = createReporter(clock, tester.controller(), metrics, SystemName.cd);
metricsReporter.maintain();
assertEquals(2, metrics.getMetrics().size());
Map<MapContext, Map<String, Number>> hostMetrics = getMetricsByHost("fake-node.test");
assertEquals(1, hostMetrics.size());
Map.Entry<MapContext, Map<String, Number>> metricEntry = hostMetrics.entrySet().iterator().next();
MapContext metricContext = metricEntry.getKey();
assertDimension(metricContext, "tenantName", "ciintegrationtests");
assertDimension(metricContext, "app", "restart.default");
assertDimension(metricContext, "zone", "prod.cd-us-east-1");
assertEquals(727, metricEntry.getValue().get(MetricsReporter.convergeMetric).longValue());
}
use of com.yahoo.vespa.hosted.controller.MetricsMock.MapContext in project vespa by vespa-engine.
the class MetricsReporterTest method it_omits_zone_when_unknown.
@Test
public void it_omits_zone_when_unknown() {
ControllerTester tester = new ControllerTester();
String hostname = "fake-node2.test";
MapContext metricContext = getMetricContextByHost(tester.controller(), hostname);
assertNull(metricContext.getDimensions().get("zone"));
}
Aggregations