Skip to content

Commit

Permalink
suppress
Browse files Browse the repository at this point in the history
  • Loading branch information
carterkozak committed Oct 2, 2023
1 parent 1881a79 commit aace111
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import com.palantir.tracing.CloseableTracer;
import com.palantir.tritium.metrics.registry.TaggedMetricRegistry;
import java.io.IOException;
import java.time.Duration;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.apache.hc.client5.http.HttpRoute;
import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager;
import org.apache.hc.client5.http.io.ConnectionEndpoint;
Expand All @@ -39,6 +39,7 @@
import org.apache.hc.core5.util.Timeout;

/** A simple wrapper around a {@link PoolingHttpClientConnectionManager} which provides instrumentation. */
@SuppressWarnings("PreferJavaTimeOverload") // perf sensitive
final class InstrumentedPoolingHttpClientConnectionManager
implements HttpClientConnectionManager, ConnPoolControl<HttpRoute> {

Expand Down Expand Up @@ -121,9 +122,9 @@ public void connect(ConnectionEndpoint endpoint, TimeValue connectTimeout, HttpC
long beginNanos = System.nanoTime();
try (CloseableTracer ignored = CloseableTracer.startSpan("Dialogue ConnectionManager.connect")) {
manager.connect(endpoint, connectTimeout, context);
connectTimerSuccess.update(Duration.ofNanos(System.nanoTime() - beginNanos));
connectTimerSuccess.update(System.nanoTime() - beginNanos, TimeUnit.NANOSECONDS);
} catch (Throwable throwable) {
connectTimerFailure.update(Duration.ofNanos(System.nanoTime() - beginNanos));
connectTimerFailure.update(System.nanoTime() - beginNanos, TimeUnit.NANOSECONDS);
DialogueClientMetrics.of(registry)
.connectionCreateError()
.clientName(clientName)
Expand Down

0 comments on commit aace111

Please sign in to comment.