From cacdf7c9526221c5b8ef86f0de203e815cc69754 Mon Sep 17 00:00:00 2001 From: jonmv Date: Thu, 9 May 2024 17:53:16 +0200 Subject: Use actual target inflight when updating measured throughput --- client/go/internal/vespa/document/throttler.go | 2 +- .../src/main/java/ai/vespa/feed/client/impl/DynamicThrottler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/go/internal/vespa/document/throttler.go b/client/go/internal/vespa/document/throttler.go index dea2dc1c67e..0400ba1a150 100644 --- a/client/go/internal/vespa/document/throttler.go +++ b/client/go/internal/vespa/document/throttler.go @@ -57,7 +57,7 @@ func newThrottler(connections int, nowFunc func() time.Time) *dynamicThrottler { func NewThrottler(connections int) Throttler { return newThrottler(connections, time.Now) } func (t *dynamicThrottler) Sent() { - currentInflight := t.targetInflight.Load() + currentInflight := t.TargetInflight() t.sent++ if t.sent*t.sent*t.sent < 100*currentInflight*currentInflight { return diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/DynamicThrottler.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/DynamicThrottler.java index 31d91ec3530..81e972fe45d 100644 --- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/DynamicThrottler.java +++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/DynamicThrottler.java @@ -33,7 +33,7 @@ public class DynamicThrottler extends StaticThrottler { @Override public void sent(long __, CompletableFuture ___) { - double currentInflight = targetInflight.get(); + double currentInflight = targetInflight(); if (++sent * sent * sent < 1e2 * currentInflight * currentInflight) return; -- cgit v1.2.3