use of org.apache.heron.proto.tmanager.TopologyManager.MetricsCacheLocation in project heron by twitter.
the class MetricsCacheMetricsProviderTest method createMetricsProviderSpy.
private MetricsCacheMetricsProvider createMetricsProviderSpy() {
MetricsCacheLocation location = MetricsCacheLocation.newBuilder().setTopologyName("testTopo").setTopologyId("topoId").setHost("localhost").setControllerPort(0).setServerPort(0).build();
SchedulerStateManagerAdaptor stateMgr = Mockito.mock(SchedulerStateManagerAdaptor.class);
when(stateMgr.getMetricsCacheLocation("testTopo")).thenReturn(location);
MetricsCacheMetricsProvider metricsProvider = new MetricsCacheMetricsProvider(stateMgr, "testTopo");
return spy(metricsProvider);
}
use of org.apache.heron.proto.tmanager.TopologyManager.MetricsCacheLocation in project heron by twitter.
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;
}
Aggregations