Search in sources :

Example 1 with MetricQueryService

use of org.apache.flink.runtime.metrics.dump.MetricQueryService in project flink by apache.

the class MetricRegistryImplTest method testQueryActorShutdown.

/**
 * Tests that the query actor will be stopped when the MetricRegistry is shut down.
 */
@Test
public void testQueryActorShutdown() throws Exception {
    final Duration timeout = Duration.ofSeconds(10L);
    MetricRegistryImpl registry = new MetricRegistryImpl(MetricRegistryTestUtils.defaultMetricRegistryConfiguration());
    final RpcService rpcService = new TestingRpcService();
    registry.startQueryService(rpcService, null);
    MetricQueryService queryService = checkNotNull(registry.getQueryService());
    registry.shutdown().get();
    queryService.getTerminationFuture().get(timeout.toMillis(), TimeUnit.MILLISECONDS);
}
Also used : MetricQueryService(org.apache.flink.runtime.metrics.dump.MetricQueryService) TestingRpcService(org.apache.flink.runtime.rpc.TestingRpcService) RpcService(org.apache.flink.runtime.rpc.RpcService) TestingRpcService(org.apache.flink.runtime.rpc.TestingRpcService) Duration(java.time.Duration) MetricGroupTest(org.apache.flink.runtime.metrics.groups.MetricGroupTest) Test(org.junit.Test)

Aggregations

Duration (java.time.Duration)1 MetricQueryService (org.apache.flink.runtime.metrics.dump.MetricQueryService)1 MetricGroupTest (org.apache.flink.runtime.metrics.groups.MetricGroupTest)1 RpcService (org.apache.flink.runtime.rpc.RpcService)1 TestingRpcService (org.apache.flink.runtime.rpc.TestingRpcService)1 Test (org.junit.Test)1