@Override
	public Mono<PooledRef<Connection>> acquire() {
		return new BorrowerMono(this, Duration.ZERO);
	}
@Test
	void recordsPendingCountAndLatencies() {
		EmbeddedChannel channel = new EmbeddedChannel(new TestChannelId(),
				Http2FrameCodecBuilder.forClient().build(), new Http2MultiplexHandler(new ChannelHandlerAdapter() {}));
		TestPoolMetricsRecorder recorder = new TestPoolMetricsRecorder();
		PoolBuilder<Connection, PoolConfig<Connection>> poolBuilder =
				PoolBuilder.from(Mono.just(Connection.from(channel)))
				           .metricsRecorder(recorder)
				           .maxPendingAcquireUnbounded()
				           .sizeBetween(0, 1);
		Http2AllocationStrategy strategy = Http2AllocationStrategy.builder()
				.maxConnections(1)
				.maxConcurrentStreams(2)
				.build();
		Http2Pool http2Pool = poolBuilder.build(config -> new Http2Pool(config, strategy));

		try {
			List<PooledRef<Connection>> acquired = new ArrayList<>();
			//success, acquisition happens immediately
			http2Pool.acquire(Duration.ofMillis(1)).subscribe(acquired::add);
			// success, acquisition happens immediately without timeout
			http2Pool.acquire().subscribe(acquired::add);

			channel.runPendingTasks();

			assertThat(acquired).hasSize(2);

			//success, acquisition happens after pending some time
			http2Pool.acquire(Duration.ofMillis(50)).subscribe();

			// success, acquisition happens after pending some time without timeout
			http2Pool.acquire().subscribe();

			//error, timed out
			http2Pool.acquire(Duration.ofMillis(1))
			         .as(StepVerifier::create)
			         .expectError(PoolAcquireTimeoutException.class)
			         .verify(Duration.ofSeconds(1));

			acquired.get(0).release().block(Duration.ofSeconds(1));
			acquired.get(1).release().block(Duration.ofSeconds(1));

			channel.runPendingTasks();

			assertThat(recorder.pendingSuccessCounter)
					.as("pending success")
					.isEqualTo(2);

			assertThat(recorder.pendingErrorCounter)
					.as("pending errors")
					.isEqualTo(1);

			assertThat(recorder.pendingSuccessLatency)
					.as("pending success latency")
					.isGreaterThanOrEqualTo(1L);

			assertThat(recorder.pendingErrorLatency)
					.as("pending error latency")
					.isGreaterThanOrEqualTo(1L);
		}
		finally {
			channel.finishAndReleaseAll();
			Connection.from(channel).dispose();
		}
	}