Search in sources :

Example 1 with MetricsCacheLocation

use of com.twitter.heron.proto.tmaster.TopologyMaster.MetricsCacheLocation in project incubator-heron by apache.

the class MetricsCacheMetricsProvider method getCacheLocation.

/* returns last known location of metrics cache
   */
private synchronized String getCacheLocation() {
    if (metricsCacheLocation != null) {
        return metricsCacheLocation;
    }
    MetricsCacheLocation cacheLocation = stateManagerAdaptor.getMetricsCacheLocation(topologyName);
    metricsCacheLocation = String.format("http://%s:%s/%s", cacheLocation.getHost(), cacheLocation.getStatsPort(), PATH_STATS);
    return metricsCacheLocation;
}
Also used : MetricsCacheLocation(com.twitter.heron.proto.tmaster.TopologyMaster.MetricsCacheLocation)

Example 2 with MetricsCacheLocation

use of com.twitter.heron.proto.tmaster.TopologyMaster.MetricsCacheLocation in project incubator-heron by apache.

the class MetricsCacheMetricsProviderTest method createMetricsProviderSpy.

private MetricsCacheMetricsProvider createMetricsProviderSpy() {
    MetricsCacheLocation location = MetricsCacheLocation.newBuilder().setTopologyName("testTopo").setTopologyId("topoId").setHost("localhost").setControllerPort(0).setMasterPort(0).build();
    SchedulerStateManagerAdaptor stateMgr = Mockito.mock(SchedulerStateManagerAdaptor.class);
    when(stateMgr.getMetricsCacheLocation("testTopo")).thenReturn(location);
    MetricsCacheMetricsProvider metricsProvider = new MetricsCacheMetricsProvider(stateMgr, "testTopo");
    MetricsCacheMetricsProvider spyMetricsProvider = spy(metricsProvider);
    spyMetricsProvider.setClock(new TestClock(70000));
    return spyMetricsProvider;
}
Also used : MetricsCacheLocation(com.twitter.heron.proto.tmaster.TopologyMaster.MetricsCacheLocation) SchedulerStateManagerAdaptor(com.twitter.heron.spi.statemgr.SchedulerStateManagerAdaptor)

Aggregations

MetricsCacheLocation (com.twitter.heron.proto.tmaster.TopologyMaster.MetricsCacheLocation)2 SchedulerStateManagerAdaptor (com.twitter.heron.spi.statemgr.SchedulerStateManagerAdaptor)1