diff --git a/server/src/internalClusterTest/java/org/opensearch/search/profile/aggregation/AggregationProfilerIT.java b/server/src/internalClusterTest/java/org/opensearch/search/profile/aggregation/AggregationProfilerIT.java index 51c92e8653585..9d0c30c5a488f 100644 --- a/server/src/internalClusterTest/java/org/opensearch/search/profile/aggregation/AggregationProfilerIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/search/profile/aggregation/AggregationProfilerIT.java @@ -214,7 +214,8 @@ public void testSimpleProfile() { assertThat(histoAggResult.getTime(), greaterThan(0L)); Map breakdown = histoAggResult.getTimeBreakdown(); assertThat(breakdown, notNullValue()); - if (histoAggResult.isConcurrent()) { + if (histoAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(breakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(breakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -261,7 +262,8 @@ public void testMultiLevelProfile() { assertThat(histoAggResult.getTime(), greaterThan(0L)); Map histoBreakdown = histoAggResult.getTimeBreakdown(); assertThat(histoBreakdown, notNullValue()); - if (histoAggResult.isConcurrent()) { + if (histoAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(histoBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(histoBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -283,7 +285,8 @@ public void testMultiLevelProfile() { assertThat(termsAggResult.getTime(), greaterThan(0L)); Map termsBreakdown = termsAggResult.getTimeBreakdown(); assertThat(termsBreakdown, notNullValue()); - if (termsAggResult.isConcurrent()) { + if (termsAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(termsBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(termsBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -302,7 +305,8 @@ public void testMultiLevelProfile() { assertThat(avgAggResult.getTime(), greaterThan(0L)); Map avgBreakdown = termsAggResult.getTimeBreakdown(); assertThat(avgBreakdown, notNullValue()); - if (avgAggResult.isConcurrent()) { + if (avgAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(avgBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(avgBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -359,7 +363,8 @@ public void testMultiLevelProfileBreadthFirst() { assertThat(histoAggResult.getTime(), greaterThan(0L)); Map histoBreakdown = histoAggResult.getTimeBreakdown(); assertThat(histoBreakdown, notNullValue()); - if (histoAggResult.isConcurrent()) { + if (histoAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(histoBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(histoBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -381,7 +386,8 @@ public void testMultiLevelProfileBreadthFirst() { assertThat(termsAggResult.getTime(), greaterThan(0L)); Map termsBreakdown = termsAggResult.getTimeBreakdown(); assertThat(termsBreakdown, notNullValue()); - if (termsAggResult.isConcurrent()) { + if (termsAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(termsBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(termsBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -400,7 +406,8 @@ public void testMultiLevelProfileBreadthFirst() { assertThat(avgAggResult.getTime(), greaterThan(0L)); Map avgBreakdown = avgAggResult.getTimeBreakdown(); assertThat(avgBreakdown, notNullValue()); - if (avgAggResult.isConcurrent()) { + if (avgAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(avgBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(avgBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -442,7 +449,8 @@ public void testDiversifiedAggProfile() { assertThat(diversifyAggResult.getTime(), greaterThan(0L)); Map diversifyBreakdown = diversifyAggResult.getTimeBreakdown(); assertThat(diversifyBreakdown, notNullValue()); - if (diversifyAggResult.isConcurrent()) { + if (diversifyAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(diversifyBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(diversifyBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -463,7 +471,8 @@ public void testDiversifiedAggProfile() { assertThat(maxAggResult.getTime(), greaterThan(0L)); Map maxBreakdown = maxAggResult.getTimeBreakdown(); assertThat(maxBreakdown, notNullValue()); - if (maxAggResult.isConcurrent()) { + if (maxAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(maxBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(maxBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -520,7 +529,8 @@ public void testComplexProfile() { assertThat(histoAggResult.getTime(), greaterThan(0L)); Map histoBreakdown = histoAggResult.getTimeBreakdown(); assertThat(histoBreakdown, notNullValue()); - if (histoAggResult.isConcurrent()) { + if (histoAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(histoBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(histoBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -547,7 +557,8 @@ public void testComplexProfile() { assertThat(tagsAggResult.getTime(), greaterThan(0L)); Map tagsBreakdown = tagsAggResult.getTimeBreakdown(); assertThat(tagsBreakdown, notNullValue()); - if (tagsAggResult.isConcurrent()) { + if (tagsAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(tagsBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(tagsBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -571,7 +582,8 @@ public void testComplexProfile() { assertThat(avgAggResult.getTime(), greaterThan(0L)); Map avgBreakdown = avgAggResult.getTimeBreakdown(); assertThat(avgBreakdown, notNullValue()); - if (avgAggResult.isConcurrent()) { + if (avgAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(avgBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(avgBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -591,7 +603,8 @@ public void testComplexProfile() { assertThat(maxAggResult.getTime(), greaterThan(0L)); Map maxBreakdown = maxAggResult.getTimeBreakdown(); assertThat(maxBreakdown, notNullValue()); - if (maxAggResult.isConcurrent()) { + if (maxAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(maxBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(maxBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -611,7 +624,8 @@ public void testComplexProfile() { assertThat(stringsAggResult.getTime(), greaterThan(0L)); Map stringsBreakdown = stringsAggResult.getTimeBreakdown(); assertThat(stringsBreakdown, notNullValue()); - if (stringsAggResult.isConcurrent()) { + if (stringsAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(stringsBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(stringsBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -635,7 +649,8 @@ public void testComplexProfile() { assertThat(avgAggResult.getTime(), greaterThan(0L)); avgBreakdown = avgAggResult.getTimeBreakdown(); assertThat(avgBreakdown, notNullValue()); - if (avgAggResult.isConcurrent()) { + if (avgAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(avgBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(avgBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -655,7 +670,8 @@ public void testComplexProfile() { assertThat(maxAggResult.getTime(), greaterThan(0L)); maxBreakdown = maxAggResult.getTimeBreakdown(); assertThat(maxBreakdown, notNullValue()); - if (maxAggResult.isConcurrent()) { + if (maxAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(maxBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(maxBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -676,7 +692,8 @@ public void testComplexProfile() { assertThat(tagsAggResult.getTime(), greaterThan(0L)); tagsBreakdown = tagsAggResult.getTimeBreakdown(); assertThat(tagsBreakdown, notNullValue()); - if (tagsAggResult.isConcurrent()) { + if (tagsAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(tagsBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(tagsBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -700,7 +717,8 @@ public void testComplexProfile() { assertThat(avgAggResult.getTime(), greaterThan(0L)); avgBreakdown = avgAggResult.getTimeBreakdown(); assertThat(avgBreakdown, notNullValue()); - if (avgAggResult.isConcurrent()) { + if (avgAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(avgBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(avgBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -720,7 +738,8 @@ public void testComplexProfile() { assertThat(maxAggResult.getTime(), greaterThan(0L)); maxBreakdown = maxAggResult.getTimeBreakdown(); assertThat(maxBreakdown, notNullValue()); - if (maxAggResult.isConcurrent()) { + if (maxAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertThat(maxBreakdown.keySet(), equalTo(CONCURRENT_SEARCH_BREAKDOWN_KEYS)); } else { assertThat(maxBreakdown.keySet(), equalTo(BREAKDOWN_KEYS)); @@ -821,7 +840,8 @@ public void testGlobalAggWithStatsSubAggregatorProfile() { assertThat(globalAggResult.getTime(), greaterThan(0L)); Map breakdown = globalAggResult.getTimeBreakdown(); assertThat(breakdown, notNullValue()); - if (globalAggResult.isConcurrent()) { + if (globalAggResult.getMaxSliceTime() != null) { + // concurrent segment search enabled assertEquals(CONCURRENT_SEARCH_BREAKDOWN_KEYS, breakdown.keySet()); } else { assertEquals(BREAKDOWN_KEYS, breakdown.keySet()); diff --git a/server/src/main/java/org/opensearch/search/profile/ProfileResult.java b/server/src/main/java/org/opensearch/search/profile/ProfileResult.java index dd936c33ab942..d96db1d2dd8da 100644 --- a/server/src/main/java/org/opensearch/search/profile/ProfileResult.java +++ b/server/src/main/java/org/opensearch/search/profile/ProfileResult.java @@ -86,11 +86,10 @@ public final class ProfileResult implements Writeable, ToXContentObject { private final Map breakdown; private final Map debug; private final long nodeTime; - private final long maxSliceNodeTime; - private final long minSliceNodeTime; - private final long avgSliceNodeTime; + private Long maxSliceNodeTime; + private Long minSliceNodeTime; + private Long avgSliceNodeTime; private final List children; - private final boolean concurrent; public ProfileResult( String type, @@ -100,7 +99,7 @@ public ProfileResult( long nodeTime, List children ) { - this(type, description, breakdown, debug, nodeTime, children, false, -1, -1, -1); + this(type, description, breakdown, debug, nodeTime, children, null, null, null); } public ProfileResult( @@ -110,10 +109,9 @@ public ProfileResult( Map debug, long nodeTime, List children, - boolean concurrent, - long maxSliceNodeTime, - long minSliceNodeTime, - long avgSliceNodeTime + Long maxSliceNodeTime, + Long minSliceNodeTime, + Long avgSliceNodeTime ) { this.type = type; this.description = description; @@ -121,7 +119,6 @@ public ProfileResult( this.debug = debug == null ? Map.of() : debug; this.children = children == null ? List.of() : children; this.nodeTime = nodeTime; - this.concurrent = concurrent; this.maxSliceNodeTime = maxSliceNodeTime; this.minSliceNodeTime = minSliceNodeTime; this.avgSliceNodeTime = avgSliceNodeTime; @@ -138,21 +135,13 @@ public ProfileResult(StreamInput in) throws IOException { debug = in.readMap(StreamInput::readString, StreamInput::readGenericValue); children = in.readList(ProfileResult::new); if (in.getVersion().onOrAfter(Version.V_3_0_0)) { - this.concurrent = in.readBoolean(); - if (concurrent) { - this.maxSliceNodeTime = in.readLong(); - this.minSliceNodeTime = in.readLong(); - this.avgSliceNodeTime = in.readLong(); - } else { - this.maxSliceNodeTime = -1; - this.minSliceNodeTime = -1; - this.avgSliceNodeTime = -1; - } + this.maxSliceNodeTime = in.readOptionalLong(); + this.minSliceNodeTime = in.readOptionalLong(); + this.avgSliceNodeTime = in.readOptionalLong(); } else { - this.concurrent = false; - this.maxSliceNodeTime = -1; - this.minSliceNodeTime = -1; - this.avgSliceNodeTime = -1; + this.maxSliceNodeTime = null; + this.minSliceNodeTime = null; + this.avgSliceNodeTime = null; } } @@ -165,12 +154,9 @@ public void writeTo(StreamOutput out) throws IOException { out.writeMap(debug, StreamOutput::writeString, StreamOutput::writeGenericValue); out.writeList(children); if (out.getVersion().onOrAfter(Version.V_3_0_0)) { - out.writeBoolean(concurrent); - if (concurrent) { - out.writeLong(maxSliceNodeTime); - out.writeLong(minSliceNodeTime); - out.writeLong(avgSliceNodeTime); - } + out.writeOptionalLong(maxSliceNodeTime); + out.writeOptionalLong(minSliceNodeTime); + out.writeOptionalLong(avgSliceNodeTime); } } @@ -211,22 +197,18 @@ public long getTime() { return nodeTime; } - public long getMaxSliceTime() { + public Long getMaxSliceTime() { return maxSliceNodeTime; } - public long getMinSliceTime() { + public Long getMinSliceTime() { return minSliceNodeTime; } - public long getAvgSliceTime() { + public Long getAvgSliceTime() { return avgSliceNodeTime; } - public boolean isConcurrent() { - return concurrent; - } - /** * Returns a list of all profiled children queries */ @@ -241,19 +223,27 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field(DESCRIPTION.getPreferredName(), description); if (builder.humanReadable()) { builder.field(NODE_TIME.getPreferredName(), new TimeValue(getTime(), TimeUnit.NANOSECONDS).toString()); - if (concurrent) { + if (getMaxSliceTime() != null) { builder.field(MAX_SLICE_NODE_TIME.getPreferredName(), new TimeValue(getMaxSliceTime(), TimeUnit.NANOSECONDS).toString()); + } + if (getMinSliceTime() != null) { builder.field(MIN_SLICE_NODE_TIME.getPreferredName(), new TimeValue(getMinSliceTime(), TimeUnit.NANOSECONDS).toString()); + } + if (getAvgSliceTime() != null) { builder.field(AVG_SLICE_NODE_TIME.getPreferredName(), new TimeValue(getAvgSliceTime(), TimeUnit.NANOSECONDS).toString()); } } builder.field(NODE_TIME_RAW.getPreferredName(), getTime()); - if (concurrent) { + if (getMaxSliceTime() != null) { builder.field(MAX_SLICE_NODE_TIME_RAW.getPreferredName(), getMaxSliceTime()); + } + if (getMinSliceTime() != null) { builder.field(MIN_SLICE_NODE_TIME_RAW.getPreferredName(), getMinSliceTime()); + } + if (getAvgSliceTime() != null) { builder.field(AVG_SLICE_NODE_TIME_RAW.getPreferredName(), getAvgSliceTime()); } - createBreakownView(builder); + createBreakdownView(builder); if (false == debug.isEmpty()) { builder.field(DEBUG.getPreferredName(), debug); } @@ -269,11 +259,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder.endObject(); } - private void createBreakownView(XContentBuilder builder) throws IOException { + private void createBreakdownView(XContentBuilder builder) throws IOException { Map modifiedBreakdown = new LinkedHashMap<>(breakdown); - if (!concurrent) { - removeStartTimeFields(modifiedBreakdown); - } + removeStartTimeFields(modifiedBreakdown); builder.field(BREAKDOWN.getPreferredName(), modifiedBreakdown); } @@ -300,6 +288,9 @@ static void removeStartTimeFields(Map modifiedBreakdown) { parser.declareObject(optionalConstructorArg(), (p, c) -> p.map(), DEBUG); parser.declareLong(constructorArg(), NODE_TIME_RAW); parser.declareObjectArray(optionalConstructorArg(), (p, c) -> fromXContent(p), CHILDREN); + parser.declareLong(optionalConstructorArg(), MAX_SLICE_NODE_TIME_RAW); + parser.declareLong(optionalConstructorArg(), MIN_SLICE_NODE_TIME_RAW); + parser.declareLong(optionalConstructorArg(), AVG_SLICE_NODE_TIME_RAW); PARSER = parser.build(); } diff --git a/server/src/main/java/org/opensearch/search/profile/aggregation/ConcurrentAggregationProfiler.java b/server/src/main/java/org/opensearch/search/profile/aggregation/ConcurrentAggregationProfiler.java index 9048ac9f2892d..7c9bf55a97de5 100644 --- a/server/src/main/java/org/opensearch/search/profile/aggregation/ConcurrentAggregationProfiler.java +++ b/server/src/main/java/org/opensearch/search/profile/aggregation/ConcurrentAggregationProfiler.java @@ -149,7 +149,6 @@ private List reduceProfileResultsTree(List profile debug, nodeTime, reducedChildrenTree, - true, maxSliceNodeTime, minSliceNodeTime, avgSliceNodeTime diff --git a/server/src/test/java/org/opensearch/search/profile/ProfileResultTests.java b/server/src/test/java/org/opensearch/search/profile/ProfileResultTests.java index 4c0417a4a7b36..70b876b41ba08 100644 --- a/server/src/test/java/org/opensearch/search/profile/ProfileResultTests.java +++ b/server/src/test/java/org/opensearch/search/profile/ProfileResultTests.java @@ -56,7 +56,7 @@ public class ProfileResultTests extends OpenSearchTestCase { - public static ProfileResult createTestItem(int depth) { + public static ProfileResult createTestItem(int depth, boolean concurrentSegmentSearchEnabled) { String type = randomAlphaOfLengthBetween(5, 10); String description = randomAlphaOfLengthBetween(5, 10); int breakdownsSize = randomIntBetween(0, 5); @@ -77,13 +77,28 @@ public static ProfileResult createTestItem(int depth) { int childrenSize = depth > 0 ? randomIntBetween(0, 1) : 0; List children = new ArrayList<>(childrenSize); for (int i = 0; i < childrenSize; i++) { - children.add(createTestItem(depth - 1)); + children.add(createTestItem(depth - 1, concurrentSegmentSearchEnabled)); + } + if (concurrentSegmentSearchEnabled) { + return new ProfileResult( + type, + description, + breakdown, + debug, + randomNonNegativeLong(), + children, + randomNonNegativeLong(), + randomNonNegativeLong(), + randomNonNegativeLong() + ); + } else { + return new ProfileResult(type, description, breakdown, debug, randomNonNegativeLong(), children); } - return new ProfileResult(type, description, breakdown, debug, randomNonNegativeLong(), children); } public void testFromXContent() throws IOException { - doFromXContentTestWithRandomFields(false); + doFromXContentTestWithRandomFields(false, false); + doFromXContentTestWithRandomFields(false, true); } /** @@ -91,11 +106,12 @@ public void testFromXContent() throws IOException { * back to be forward compatible with additions to the xContent */ public void testFromXContentWithRandomFields() throws IOException { - doFromXContentTestWithRandomFields(true); + doFromXContentTestWithRandomFields(true, false); + doFromXContentTestWithRandomFields(true, true); } - private void doFromXContentTestWithRandomFields(boolean addRandomFields) throws IOException { - ProfileResult profileResult = createTestItem(2); + private void doFromXContentTestWithRandomFields(boolean addRandomFields, boolean concurrentSegmentSearchEnabled) throws IOException { + ProfileResult profileResult = createTestItem(2, concurrentSegmentSearchEnabled); XContentType xContentType = randomFrom(XContentType.values()); boolean humanReadable = randomBoolean(); BytesReference originalBytes = toShuffledXContent(profileResult, xContentType, ToXContent.EMPTY_PARAMS, humanReadable); @@ -119,7 +135,6 @@ private void doFromXContentTestWithRandomFields(boolean addRandomFields) throws assertEquals(profileResult.getMaxSliceTime(), parsed.getMaxSliceTime()); assertEquals(profileResult.getMinSliceTime(), parsed.getMinSliceTime()); assertEquals(profileResult.getAvgSliceTime(), parsed.getAvgSliceTime()); - assertEquals(profileResult.isConcurrent(), parsed.isConcurrent()); assertToXContentEquivalent(originalBytes, toXContent(parsed, xContentType, humanReadable), xContentType); } @@ -243,18 +258,7 @@ public void testToXContent() throws IOException { Strings.toString(builder) ); - result = new ProfileResult( - "profileName", - "some description", - Map.of("key1", 1234L), - Map.of(), - 1234L, - List.of(), - true, - 321L, - 123L, - 222L - ); + result = new ProfileResult("profileName", "some description", Map.of("key1", 1234L), Map.of(), 1234L, List.of(), 321L, 123L, 222L); builder = XContentFactory.jsonBuilder().prettyPrint(); result.toXContent(builder, ToXContent.EMPTY_PARAMS); assertEquals( @@ -279,9 +283,8 @@ public void testToXContent() throws IOException { Map.of(), 1234567890L, List.of(), - true, 87654321L, - 12345678, + 12345678L, 54637281L ); builder = XContentFactory.jsonBuilder().prettyPrint().humanReadable(true); diff --git a/server/src/test/java/org/opensearch/search/profile/aggregation/AggregationProfileShardResultTests.java b/server/src/test/java/org/opensearch/search/profile/aggregation/AggregationProfileShardResultTests.java index 33c95725dcd13..75fb846909aa1 100644 --- a/server/src/test/java/org/opensearch/search/profile/aggregation/AggregationProfileShardResultTests.java +++ b/server/src/test/java/org/opensearch/search/profile/aggregation/AggregationProfileShardResultTests.java @@ -57,7 +57,7 @@ public static AggregationProfileShardResult createTestItem(int depth) { int size = randomIntBetween(0, 5); List aggProfileResults = new ArrayList<>(size); for (int i = 0; i < size; i++) { - aggProfileResults.add(ProfileResultTests.createTestItem(1)); + aggProfileResults.add(ProfileResultTests.createTestItem(depth, false)); } return new AggregationProfileShardResult(aggProfileResults); } diff --git a/server/src/test/java/org/opensearch/search/profile/aggregation/ConcurrentAggregationProfilerTests.java b/server/src/test/java/org/opensearch/search/profile/aggregation/ConcurrentAggregationProfilerTests.java index 88e822f576600..e36b65f0a7b69 100644 --- a/server/src/test/java/org/opensearch/search/profile/aggregation/ConcurrentAggregationProfilerTests.java +++ b/server/src/test/java/org/opensearch/search/profile/aggregation/ConcurrentAggregationProfilerTests.java @@ -6,25 +6,6 @@ * compatible open source license. */ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - /* * Modifications Copyright OpenSearch Contributors. See * GitHub history for details. @@ -61,13 +42,11 @@ public static List createConcurrentSearchProfileTree() { new HashMap<>(), 3359835L, List.of(), - true, 1490667L, 1180123L, 1240676L ) ), - true, 94582L, 18667L, 211749L @@ -88,13 +67,11 @@ public static List createConcurrentSearchProfileTree() { new HashMap<>(), 3359567L, List.of(), - true, 1390554L, 1180321L, 1298776L ) ), - true, 94560L, 11237L, 236440L @@ -109,7 +86,6 @@ public static List createConcurrentSearchProfileTree() { new HashMap<>(), 19631335L, List.of(), - true, 563002L, 142210L, 1216631L @@ -123,7 +99,6 @@ public static List createConcurrentSearchProfileTree() { new HashMap<>(), 19634567L, List.of(), - true, 563333L, 146783L, 1496600L diff --git a/server/src/test/java/org/opensearch/search/profile/query/QueryProfileShardResultTests.java b/server/src/test/java/org/opensearch/search/profile/query/QueryProfileShardResultTests.java index e703396f5cf02..b371015621647 100644 --- a/server/src/test/java/org/opensearch/search/profile/query/QueryProfileShardResultTests.java +++ b/server/src/test/java/org/opensearch/search/profile/query/QueryProfileShardResultTests.java @@ -54,7 +54,7 @@ public static QueryProfileShardResult createTestItem() { int size = randomIntBetween(0, 5); List queryProfileResults = new ArrayList<>(size); for (int i = 0; i < size; i++) { - queryProfileResults.add(ProfileResultTests.createTestItem(1)); + queryProfileResults.add(ProfileResultTests.createTestItem(1, false)); } CollectorResult profileCollector = CollectorResultTests.createTestItem(2, false); long rewriteTime = randomNonNegativeLong();