diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.thread_pool/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.thread_pool/10_basic.yml index 9d08f2e4ba53b..00ec838489f63 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.thread_pool/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.thread_pool/10_basic.yml @@ -1,7 +1,7 @@ "Test cat thread_pool total_wait_time output": - skip: - version: " - 3.0.0" - reason: thread_pool total_wait_time stats were introduced in V_3.0.0 + version: " - 2.10.99" + reason: thread_pool total_wait_time stats were introduced in V_2.11.0 - do: cat.thread_pool: {} @@ -19,11 +19,10 @@ - match: $body: | - /^ id \s+ name \s+ total_wait_time \s+ twt \n - (\S+ \s+ search \s+ \d+s \s+ \d+ \n - \S+ \s+ search_throttled \s+ \d+s \s+ \d+ \n - \S+ \s+ index_searcher \s+ \d+s \s+ \d+ \n - \S+ \s+ generic \s+ -1 \s+ -1 \n)+ $/ + /^ name \s+ total_wait_time \s+ twt \n + (generic \s+ -1 \s+ -1 \n + search \s+ \d*\.*\d*\D+ \s+ \d*\.*\d*\D+ \n + search_throttled \s+ \d*\.*\d*\D+ \s+ \d*\.*\d*\D+ \n)+ $/ --- "Test cat thread_pool output": diff --git a/server/src/main/java/org/opensearch/threadpool/ThreadPoolStats.java b/server/src/main/java/org/opensearch/threadpool/ThreadPoolStats.java index 8b1e1461d8b02..7b4c1504d927a 100644 --- a/server/src/main/java/org/opensearch/threadpool/ThreadPoolStats.java +++ b/server/src/main/java/org/opensearch/threadpool/ThreadPoolStats.java @@ -88,7 +88,7 @@ public Stats(StreamInput in) throws IOException { rejected = in.readLong(); largest = in.readInt(); completed = in.readLong(); - waitTimeNanos = in.getVersion().onOrAfter(Version.V_3_0_0) ? in.readLong() : -1; + waitTimeNanos = in.getVersion().onOrAfter(Version.V_2_11_0) ? in.readLong() : -1; } @Override @@ -100,7 +100,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeLong(rejected); out.writeInt(largest); out.writeLong(completed); - if (out.getVersion().onOrAfter(Version.V_3_0_0)) { + if (out.getVersion().onOrAfter(Version.V_2_11_0)) { out.writeLong(waitTimeNanos); } }