use of com.yahoo.vespa.model.container.component.StatisticsComponent in project vespa by vespa-engine.
the class AdminTestCase method testContainerMetricsSnapshotInterval.
@Test
public void testContainerMetricsSnapshotInterval() throws Exception {
VespaModel vespaModel = getVespaModel(TESTDIR + "metricconfig");
ContainerCluster docprocCluster = vespaModel.getContainerClusters().get("cluster.music.indexing");
HealthMonitorConfig.Builder builder = new HealthMonitorConfig.Builder();
docprocCluster.getConfig(builder);
HealthMonitorConfig docprocConfig = new HealthMonitorConfig(builder);
assertEquals(60, (int) docprocConfig.snapshot_interval());
ContainerCluster qrCluster = vespaModel.getContainerClusters().get("container");
builder = new HealthMonitorConfig.Builder();
qrCluster.getConfig(builder);
HealthMonitorConfig qrClusterConfig = new HealthMonitorConfig(builder);
assertEquals(60, (int) qrClusterConfig.snapshot_interval());
StatisticsComponent stat = null;
for (Component component : qrCluster.getAllComponents()) {
if (component.getClassId().getName().contains("com.yahoo.statistics.StatisticsImpl")) {
stat = (StatisticsComponent) component;
break;
}
}
assertNotNull(stat);
StatisticsConfig.Builder sb = new StatisticsConfig.Builder();
stat.getConfig(sb);
StatisticsConfig sc = new StatisticsConfig(sb);
assertEquals(60, (int) sc.collectionintervalsec());
assertEquals(60, (int) sc.loggingintervalsec());
}
use of com.yahoo.vespa.model.container.component.StatisticsComponent in project vespa by vespa-engine.
the class AdminTestCase method testStatisticsConfig.
@Test
public void testStatisticsConfig() {
StatisticsComponent stat = new StatisticsComponent();
StatisticsConfig.Builder sb = new StatisticsConfig.Builder();
stat.getConfig(sb);
StatisticsConfig sc = new StatisticsConfig(sb);
assertEquals(sc.collectionintervalsec(), 300, 0.1);
assertEquals(sc.loggingintervalsec(), 300, 0.1);
assertEquals(sc.values(0).operations(0).name(), StatisticsConfig.Values.Operations.Name.REGULAR);
assertEquals(sc.values(0).operations(0).arguments(0).key(), "limits");
assertEquals(sc.values(0).operations(0).arguments(0).value(), "25,50,100,500");
}
Aggregations