Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle 7, JDK related changes and OS 2.0 #179

Merged
merged 6 commits into from
Apr 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixing unit tests to remove reference of deleted fields in OS 2.0
Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
  • Loading branch information
sgup432 committed Apr 6, 2022
commit 606eff176d11119e4425bf28bfbaa29893928670
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
import com.fasterxml.jackson.module.paranamer.ParanamerModule;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.junit.After;
import org.junit.Before;
@@ -72,21 +73,21 @@ public void testCollectMetrics() throws IOException {
createIndex(TEST_INDEX);
collector.collectMetrics(startTimeInMills);
List<CircuitBreakerCollector.CircuitBreakerStatus> metrics = readMetrics();
assertEquals(5, metrics.size());
assertEquals(4, metrics.size());
assertEquals(CircuitBreaker.REQUEST, metrics.get(0).getType());
assertEquals(CircuitBreaker.FIELDDATA, metrics.get(1).getType());
assertEquals(CircuitBreaker.IN_FLIGHT_REQUESTS, metrics.get(2).getType());
assertEquals(CircuitBreaker.PARENT, metrics.get(4).getType());
assertEquals(CircuitBreaker.PARENT, metrics.get(3).getType());
}

private List<CircuitBreakerCollector.CircuitBreakerStatus> readMetrics() throws IOException {
List<Event> metrics = TestUtil.readEvents();
assert metrics.size() == 1;
ObjectMapper objectMapper = new ObjectMapper().registerModule(new ParanamerModule());
String[] jsonStrs = metrics.get(0).value.split("\n");
assert jsonStrs.length == 6;
assert jsonStrs.length == 5;
List<CircuitBreakerCollector.CircuitBreakerStatus> list = new ArrayList<>();
for (int i = 1; i < 6; i++) {
for (int i = 1; i < 5; i++) {
list.add(
objectMapper.readValue(
jsonStrs[i], CircuitBreakerCollector.CircuitBreakerStatus.class));
Original file line number Diff line number Diff line change
@@ -131,13 +131,6 @@ public void testCollectMetrics() {
assertTrue(jsonStr.contains(ShardStatsValue.Constants.MERGE_CURRENT_VALUE));
assertTrue(jsonStr.contains(ShardStatsValue.Constants.INDEX_BUFFER_BYTES_VALUE));
assertTrue(jsonStr.contains(ShardStatsValue.Constants.SEGMENTS_COUNT_VALUE));
assertTrue(jsonStr.contains(ShardStatsValue.Constants.SEGMENTS_MEMORY_VALUE));
assertTrue(jsonStr.contains(ShardStatsValue.Constants.TERMS_MEMORY_VALUE));
assertTrue(jsonStr.contains(ShardStatsValue.Constants.STORED_FIELDS_MEMORY_VALUE));
assertTrue(jsonStr.contains(ShardStatsValue.Constants.TERM_VECTOR_MEMORY_VALUE));
assertTrue(jsonStr.contains(ShardStatsValue.Constants.NORMS_MEMORY_VALUE));
assertTrue(jsonStr.contains(ShardStatsValue.Constants.POINTS_MEMORY_VALUE));
assertTrue(jsonStr.contains(ShardStatsValue.Constants.DOC_VALUES_MEMORY_VALUE));
assertTrue(jsonStr.contains(ShardStatsValue.Constants.INDEX_WRITER_MEMORY_VALUE));
assertTrue(jsonStr.contains(ShardStatsValue.Constants.VERSION_MAP_MEMORY_VALUE));
assertTrue(jsonStr.contains(ShardStatsValue.Constants.BITSET_MEMORY_VALUE));