Java Code Examples for io.micrometer.core.instrument.Metrics#removeRegistry()

The following examples show how to use io.micrometer.core.instrument.Metrics#removeRegistry() . 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: TcpMetricsTests.java    From reactor-netty with Apache License 2.0 6 votes vote down vote up
@After
public void tearDown() {
	if (disposableServer != null) {
		disposableServer.disposeNow();
	}

	if (connection != null) {
		connection.disposeNow();
	}

	provider.disposeLater()
	        .block(Duration.ofSeconds(30));

	Metrics.removeRegistry(registry);
	registry.clear();
	registry.close();
}
 
Example 2
Source File: MicrometerMetricsReporterTest.java    From java-metrics with Apache License 2.0 5 votes vote down vote up
@Before
public void init() {
    for (MeterRegistry registry : Metrics.globalRegistry.getRegistries()) {
        Metrics.removeRegistry(registry);
    }
    this.registry = new SimpleMeterRegistry();
    Metrics.addRegistry(this.registry);
}
 
Example 3
Source File: UdpMetricsTests.java    From reactor-netty with Apache License 2.0 5 votes vote down vote up
@After
public void tearDown() {
	if (serverConnection != null) {
		serverConnection.disposeNow();
	}

	if (clientConnection != null) {
		clientConnection.disposeNow();
	}

	Metrics.removeRegistry(registry);
	registry.clear();
	registry.close();
}
 
Example 4
Source File: HttpMetricsHandlerTests.java    From reactor-netty with Apache License 2.0 5 votes vote down vote up
@After
public void tearDown() {
	if (disposableServer != null) {
		disposableServer.disposeNow();
	}

	provider.disposeLater()
	        .block(Duration.ofSeconds(30));

	Metrics.removeRegistry(registry);
	registry.clear();
	registry.close();
}
 
Example 5
Source File: PooledConnectionProviderMetricsTest.java    From reactor-netty with Apache License 2.0 4 votes vote down vote up
@After
public void tearDown() {
	Metrics.removeRegistry(registry);
	registry.clear();
	registry.close();
}
 
Example 6
Source File: AddressResolverGroupMetricsTest.java    From reactor-netty with Apache License 2.0 4 votes vote down vote up
@After
public void tearDown() {
	Metrics.removeRegistry(registry);
	registry.clear();
	registry.close();
}
 
Example 7
Source File: ByteBufAllocatorMetricsTest.java    From reactor-netty with Apache License 2.0 4 votes vote down vote up
@After
public void tearDown() {
	Metrics.removeRegistry(registry);
	registry.clear();
	registry.close();
}
 
Example 8
Source File: SchedulersMetricsTest.java    From reactor-core with Apache License 2.0 4 votes vote down vote up
@After
public void tearDown() {
	Schedulers.disableMetrics();
	Metrics.globalRegistry.forEachMeter(Metrics.globalRegistry::remove);
	Metrics.removeRegistry(simpleMeterRegistry);
}