Search in sources :

Example 1 with StatisticsComponent

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());
}
Also used : StatisticsComponent(com.yahoo.vespa.model.container.component.StatisticsComponent) StatisticsConfig(com.yahoo.container.StatisticsConfig) VespaModel(com.yahoo.vespa.model.VespaModel) ContainerCluster(com.yahoo.vespa.model.container.ContainerCluster) HealthMonitorConfig(com.yahoo.container.jdisc.config.HealthMonitorConfig) StatisticsComponent(com.yahoo.vespa.model.container.component.StatisticsComponent) Component(com.yahoo.vespa.model.container.component.Component) Test(org.junit.Test)

Example 2 with StatisticsComponent

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");
}
Also used : StatisticsComponent(com.yahoo.vespa.model.container.component.StatisticsComponent) StatisticsConfig(com.yahoo.container.StatisticsConfig) Test(org.junit.Test)

Aggregations

StatisticsConfig (com.yahoo.container.StatisticsConfig)2 StatisticsComponent (com.yahoo.vespa.model.container.component.StatisticsComponent)2 Test (org.junit.Test)2 HealthMonitorConfig (com.yahoo.container.jdisc.config.HealthMonitorConfig)1 VespaModel (com.yahoo.vespa.model.VespaModel)1 ContainerCluster (com.yahoo.vespa.model.container.ContainerCluster)1 Component (com.yahoo.vespa.model.container.component.Component)1