Search in sources :

Example 1 with GatewayRetriever

use of org.apache.flink.runtime.webmonitor.retriever.GatewayRetriever in project flink by apache.

the class AbstractMetricsHandlerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    final MetricStore metricStore = new MetricStore();
    metricStore.add(new MetricDump.CounterDump(new QueryScopeInfo.JobManagerQueryScopeInfo(), TEST_METRIC_NAME, TEST_METRIC_VALUE));
    when(mockMetricFetcher.getMetricStore()).thenReturn(metricStore);
    testMetricsHandler = new TestMetricsHandler(new GatewayRetriever<DispatcherGateway>() {

        @Override
        public CompletableFuture<DispatcherGateway> getFuture() {
            return CompletableFuture.completedFuture(mockDispatcherGateway);
        }
    }, Time.milliseconds(50), Collections.emptyMap(), new TestMetricsHeaders(), mockMetricFetcher);
}
Also used : MetricStore(org.apache.flink.runtime.rest.handler.legacy.metrics.MetricStore) MetricDump(org.apache.flink.runtime.metrics.dump.MetricDump) GatewayRetriever(org.apache.flink.runtime.webmonitor.retriever.GatewayRetriever) DispatcherGateway(org.apache.flink.runtime.dispatcher.DispatcherGateway) Before(org.junit.Before)

Aggregations

DispatcherGateway (org.apache.flink.runtime.dispatcher.DispatcherGateway)1 MetricDump (org.apache.flink.runtime.metrics.dump.MetricDump)1 MetricStore (org.apache.flink.runtime.rest.handler.legacy.metrics.MetricStore)1 GatewayRetriever (org.apache.flink.runtime.webmonitor.retriever.GatewayRetriever)1 Before (org.junit.Before)1