Source:
<code>protected DataDogPortUnificationHandler( final String handle, final HealthCheckManager healthCheckManager, final ReportableEntityHandler<ReportPoint, String> pointHandler, final int fanout, final boolean synchronousMode, final boolean processSystemMetrics, final boolean processServiceChecks, @Nullable final HttpClient requestRelayClient, @Nullable final String requestRelayTarget, @Nullable final Supplier<ReportableEntityPreprocessor> preprocessor) { super(TokenAuthenticatorBuilder.create().build(), healthCheckManager, handle); this.pointHandler = pointHandler; this.threadpool = new ScheduledThreadPoolExecutor(fanout, new NamedThreadFactory("dd-relay")); this.synchronousMode = synchronousMode; this.processSystemMetrics = processSystemMetrics; this.processServiceChecks = processServiceChecks; this.requestRelayClient = requestRelayClient; this.requestRelayTarget = requestRelayTarget; this.preprocessorSupplier = preprocessor; this.jsonParser = new ObjectMapper(); this.httpRequestSize = Metrics.newHistogram(new TaggedMetricName("listeners", "http-requests.payload-points", "port", handle)); Metrics.newGauge(new TaggedMetricName("listeners", "tags-cache-size", "port", handle), new Gauge<Long>() { @Override public Long value() { return tagsCache.estimatedSize(); } }); Metrics.newGauge(new TaggedMetricName("listeners", "http-relay.threadpool.queue-size", "port", handle), new Gauge<Integer>() { @Override public Integer value() { <START> return threadpool.getQueue().size(); <END> } }); }</code><technical_language>check this is O(N)</technical_language>

Target:
protected DataDogPortUnificationHandler( final String handle, final HealthCheckManager healthCheckManager, final ReportableEntityHandler<ReportPoint, String> pointHandler, final int fanout, final boolean synchronousMode, final boolean processSystemMetrics, final boolean processServiceChecks, @Nullable final HttpClient requestRelayClient, @Nullable final String requestRelayTarget, @Nullable final Supplier<ReportableEntityPreprocessor> preprocessor) { super(TokenAuthenticatorBuilder.create().build(), healthCheckManager, handle); this.pointHandler = pointHandler; this.threadpool = new ScheduledThreadPoolExecutor(fanout, new NamedThreadFactory("dd-relay")); this.synchronousMode = synchronousMode; this.processSystemMetrics = processSystemMetrics; this.processServiceChecks = processServiceChecks; this.requestRelayClient = requestRelayClient; this.requestRelayTarget = requestRelayTarget; this.preprocessorSupplier = preprocessor; this.jsonParser = new ObjectMapper(); this.httpRequestSize = Metrics.newHistogram(new TaggedMetricName("listeners", "http-requests.payload-points", "port", handle)); this.httpStatusCounterCache = Caffeine.newBuilder().build(status -> Metrics.newCounter(new TaggedMetricName("listeners", "http-relay.status." + status + ".count", "port", handle))); Metrics.newGauge(new TaggedMetricName("listeners", "tags-cache-size", "port", handle), new Gauge<Long>() { @Override public Long value() { return tagsCache.estimatedSize(); } }); Metrics.newGauge(new TaggedMetricName("listeners", "http-relay.threadpool.queue-size", "port", handle), new Gauge<Integer>() { @Override public Integer value() { return threadpool.getQueue().size(); } }); }