Java Code Examples for org.apache.flink.runtime.rest.handler.legacy.metrics.MetricStore#add()
The following examples show how to use
org.apache.flink.runtime.rest.handler.legacy.metrics.MetricStore#add() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractMetricsHandlerTest.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
@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); }
Example 2
Source File: MetricsHandlerTestBase.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
@Before public void setUp() { MockitoAnnotations.initMocks(this); this.leaderRetriever = new GatewayRetriever<DispatcherGateway>() { @Override public CompletableFuture<DispatcherGateway> getFuture() { return CompletableFuture.completedFuture(mockDispatcherGateway); } }; this.pathParameters = getPathParameters(); this.metricsHandler = getMetricsHandler(); final MetricStore metricStore = new MetricStore(); metricStore.add(new MetricDump.CounterDump(getQueryScopeInfo(), TEST_METRIC_NAME, TEST_METRIC_VALUE)); when(mockMetricFetcher.getMetricStore()).thenReturn(metricStore); }
Example 3
Source File: AbstractMetricsHandlerTest.java From flink with Apache License 2.0 | 6 votes |
@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); }
Example 4
Source File: MetricsHandlerTestBase.java From flink with Apache License 2.0 | 6 votes |
@Before public void setUp() { MockitoAnnotations.initMocks(this); this.leaderRetriever = new GatewayRetriever<DispatcherGateway>() { @Override public CompletableFuture<DispatcherGateway> getFuture() { return CompletableFuture.completedFuture(mockDispatcherGateway); } }; this.pathParameters = getPathParameters(); this.metricsHandler = getMetricsHandler(); final MetricStore metricStore = new MetricStore(); metricStore.add(new MetricDump.CounterDump(getQueryScopeInfo(), TEST_METRIC_NAME, TEST_METRIC_VALUE)); when(mockMetricFetcher.getMetricStore()).thenReturn(metricStore); }
Example 5
Source File: AbstractMetricsHandlerTest.java From flink with Apache License 2.0 | 6 votes |
@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); }
Example 6
Source File: MetricsHandlerTestBase.java From flink with Apache License 2.0 | 6 votes |
@Before public void setUp() { MockitoAnnotations.initMocks(this); this.leaderRetriever = new GatewayRetriever<DispatcherGateway>() { @Override public CompletableFuture<DispatcherGateway> getFuture() { return CompletableFuture.completedFuture(mockDispatcherGateway); } }; this.pathParameters = getPathParameters(); this.metricsHandler = getMetricsHandler(); final MetricStore metricStore = new MetricStore(); metricStore.add(new MetricDump.CounterDump(getQueryScopeInfo(), TEST_METRIC_NAME, TEST_METRIC_VALUE)); when(mockMetricFetcher.getMetricStore()).thenReturn(metricStore); }