MicrometerDuplexConnection implements DuplexConnection { @Override public void dispose() { delegate.dispose(); dispose.increment(); } MicrometerDuplexConnection(
      Type connectionType, DuplexConnection delegate, MeterRegistry meterRegistry, Tag... tags); @Override ByteBufAllocator alloc(); @Override SocketAddress remoteAddress(); @Override void dispose(); @Override Mono<Void> onClose(); @Override Flux<ByteBuf> receive(); @Override void sendFrame(int streamId, ByteBuf frame); @Override void sendErrorAndClose(RSocketErrorException e);  }
@DisplayName("dispose gathers metrics") @Test void dispose() { new MicrometerDuplexConnection( CLIENT, delegate, meterRegistry, Tag.of("test-key", "test-value")) .dispose(); assertThat( meterRegistry .get("rsocket.duplex.connection.dispose") .tag("connection.type", CLIENT.name()) .tag("test-key", "test-value") .counter() .count()) .isEqualTo(1); }