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