From 90530f7d4548a4a7fa4ac85e454be7945a5e1a4d Mon Sep 17 00:00:00 2001 From: Ruizhen Date: Tue, 1 Dec 2020 13:30:47 -0800 Subject: [PATCH 1/2] Add integ tests for OS metrics(cpu, page fault) --- .../integ_test/CpuMetricsIT.java | 83 ++++++++ .../MetricCollectorIntegTestBase.java | 72 +++++++ .../integ_test/PageFaultMetricsIT.java | 183 ++++++++++++++++++ .../integ_test/json/JsonResponseData.java | 63 ++++++ .../integ_test/json/JsonResponseField.java | 62 ++++++ .../integ_test/json/JsonResponseNode.java | 41 ++++ 6 files changed, 504 insertions(+) create mode 100644 src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/CpuMetricsIT.java create mode 100644 src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/MetricCollectorIntegTestBase.java create mode 100644 src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/PageFaultMetricsIT.java create mode 100644 src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseData.java create mode 100644 src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseField.java create mode 100644 src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseNode.java diff --git a/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/CpuMetricsIT.java b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/CpuMetricsIT.java new file mode 100644 index 00000000..cac1498e --- /dev/null +++ b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/CpuMetricsIT.java @@ -0,0 +1,83 @@ +/* + * Copyright <2020> Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file 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. + */ + +package com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test; + +import com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test.json.JsonResponseData; +import com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test.json.JsonResponseField.Type.Constants; +import com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test.json.JsonResponseNode; +import com.amazon.opendistro.elasticsearch.performanceanalyzer.metrics.AllMetrics.OSMetrics; +import java.util.List; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +public class CpuMetricsIT extends MetricCollectorIntegTestBase { + private List nodeIDs; + + @Before + public void init() throws Exception { + nodeIDs = getNodeID(); + } + + @Test + public void checkCPUUtilization() throws Exception { + //read metric from local node + List responseNodeList = + readMetric(PERFORMANCE_ANALYZER_BASE_ENDPOINT + "/metrics/?metrics=CPU_Utilization&agg=sum"); + Assert.assertEquals(1, responseNodeList.size()); + validatePerNodeCPUMetric(responseNodeList.get(0)); + + //read metric from all nodes in cluster + responseNodeList = + readMetric(PERFORMANCE_ANALYZER_BASE_ENDPOINT + "/metrics/?metrics=CPU_Utilization&agg=sum&nodes=all"); + int nodeNum = nodeIDs.size(); + Assert.assertEquals(nodeNum, responseNodeList.size()); + for (int i = 0; i < nodeNum; i++) { + validatePerNodeCPUMetric(responseNodeList.get(i)); + } + } + + /** + * check if cpu usage is non zero + * { + * "JtlEoRowSI6iNpzpjlbp_Q": { + * "data": { + * "fields": [ + * { + * "name": "CPU_Utilization", + * "type": "DOUBLE" + * } + * ], + * "records": [ + * [ + * 0.005275218803760752 + * ] + * ] + * }, + * "timestamp": 1606861740000 + * } + * } + */ + private void validatePerNodeCPUMetric(JsonResponseNode responseNode) throws Exception { + Assert.assertTrue(responseNode.getTimestamp() > 0); + JsonResponseData responseData = responseNode.getData(); + Assert.assertEquals(1, responseData.getFieldDimensionSize()); + Assert.assertEquals(OSMetrics.CPU_UTILIZATION.toString(), responseData.getField(0).getName()); + Assert.assertEquals(Constants.DOUBLE, responseData.getField(0).getType()); + Assert.assertEquals(1, responseData.getRecordSize()); + Assert.assertTrue(responseData.getRecordAsDouble(0, OSMetrics.CPU_UTILIZATION.toString()) > 0); + } +} diff --git a/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/MetricCollectorIntegTestBase.java b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/MetricCollectorIntegTestBase.java new file mode 100644 index 00000000..b7ef23b3 --- /dev/null +++ b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/MetricCollectorIntegTestBase.java @@ -0,0 +1,72 @@ +/* + * Copyright <2020> Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file 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. + */ + +package com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test; + +import com.amazon.opendistro.elasticsearch.performanceanalyzer.PerformanceAnalyzerIntegTestBase; +import com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test.json.JsonResponseNode; +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import org.apache.http.HttpStatus; +import org.apache.http.util.EntityUtils; +import org.elasticsearch.client.Request; +import org.elasticsearch.client.Response; +import org.junit.Assert; + +public class MetricCollectorIntegTestBase extends PerformanceAnalyzerIntegTestBase { + + protected List readMetric(String endpoint) throws Exception { + String jsonString; + //read metric from local node + Request request = new Request("GET", endpoint); + Response resp = paClient.performRequest(request); + Assert.assertEquals(HttpStatus.SC_OK, resp.getStatusLine().getStatusCode()); + jsonString = EntityUtils.toString(resp.getEntity()); + JsonObject jsonObject = new JsonParser().parse(jsonString).getAsJsonObject(); + return parseJsonResponse(jsonObject); + } + + protected List getNodeID() throws Exception { + final Request request = new Request("GET", "/_cat/nodes?full_id&h=id"); + final Response response = adminClient().performRequest(request); + List nodeIDs = new ArrayList<>(); + if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { + try (BufferedReader responseReader = new BufferedReader( + new InputStreamReader(response.getEntity().getContent(), StandardCharsets.UTF_8))) { + String line; + while ((line = responseReader.readLine()) != null) { + nodeIDs.add(line); + } + } + } + return nodeIDs; + } + + private List parseJsonResponse(JsonObject jsonObject) throws JsonParseException { + List responseNodeList = new ArrayList<>(); + jsonObject.entrySet().forEach(n -> { + JsonResponseNode responseNode = new Gson().fromJson(n.getValue(), JsonResponseNode.class); + responseNodeList.add(responseNode); + }); + return responseNodeList; + } +} diff --git a/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/PageFaultMetricsIT.java b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/PageFaultMetricsIT.java new file mode 100644 index 00000000..7dfb9ed8 --- /dev/null +++ b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/PageFaultMetricsIT.java @@ -0,0 +1,183 @@ +/* + * Copyright <2020> Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file 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. + */ + +package com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test; + +import com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test.json.JsonResponseData; +import com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test.json.JsonResponseField.Type.Constants; +import com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test.json.JsonResponseNode; +import com.amazon.opendistro.elasticsearch.performanceanalyzer.metrics.AllMetrics.OSMetrics; +import java.util.List; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +public class PageFaultMetricsIT extends MetricCollectorIntegTestBase { + private List nodeIDs; + + @Before + public void init() throws Exception { + nodeIDs = getNodeID(); + } + + @Test + public void checkPaging_MajfltRate() throws Exception { + //read metric from local node + List responseNodeList = + readMetric(PERFORMANCE_ANALYZER_BASE_ENDPOINT + "/metrics/?metrics=Paging_MajfltRate&agg=max"); + Assert.assertEquals(1, responseNodeList.size()); + validateMajorPageFaultMetric(responseNodeList.get(0)); + + //read metric from all nodes in cluster + responseNodeList = + readMetric(PERFORMANCE_ANALYZER_BASE_ENDPOINT + "/metrics/?metrics=Paging_MajfltRate&agg=max&nodes=all"); + int nodeNum = nodeIDs.size(); + Assert.assertEquals(nodeNum, responseNodeList.size()); + for (int i = 0; i < nodeNum; i++) { + validateMajorPageFaultMetric(responseNodeList.get(i)); + } + } + + @Test + public void checkPaging_MinfltRate() throws Exception { + //read metric from local node + List responseNodeList = + readMetric(PERFORMANCE_ANALYZER_BASE_ENDPOINT + "/metrics/?metrics=Paging_MinfltRate&agg=max"); + Assert.assertEquals(1, responseNodeList.size()); + validateMinorPageFaultMetric(responseNodeList.get(0)); + + //read metric from all nodes in cluster + responseNodeList = + readMetric(PERFORMANCE_ANALYZER_BASE_ENDPOINT + "/metrics/?metrics=Paging_MinfltRate&agg=max&nodes=all"); + int nodeNum = nodeIDs.size(); + Assert.assertEquals(nodeNum, responseNodeList.size()); + for (int i = 0; i < nodeNum; i++) { + validateMinorPageFaultMetric(responseNodeList.get(i)); + } + } + + @Test + public void checkPaging_RSS() throws Exception { + //read metric from local node + List responseNodeList = + readMetric(PERFORMANCE_ANALYZER_BASE_ENDPOINT + "/metrics/?metrics=Paging_RSS&agg=max"); + Assert.assertEquals(1, responseNodeList.size()); + validatePagingRSSMetric(responseNodeList.get(0)); + + //read metric from all nodes in cluster + responseNodeList = + readMetric(PERFORMANCE_ANALYZER_BASE_ENDPOINT + "/metrics/?metrics=Paging_RSS&agg=max&nodes=all"); + int nodeNum = nodeIDs.size(); + Assert.assertEquals(nodeNum, responseNodeList.size()); + for (int i = 0; i < nodeNum; i++) { + validatePagingRSSMetric(responseNodeList.get(i)); + } + } + + /** + * check if major page fault is greater or equals to 0. major page fault heavily depends on the workload on OS. + * if docker image is running on a OS without heavy workload, we might unlikely observe any major + * page fault during the 5s interval. + * We might want to revisit this and see if we can run some workload to trigger page fault + * { + * "JtlEoRowSI6iNpzpjlbp_Q": { + * "data": { + * "fields": [ + * { + * "name": "Paging_MajfltRate", + * "type": "DOUBLE" + * } + * ], + * "records": [ + * [ + * 0.0 + * ] + * ] + * }, + * "timestamp": 1606861150000 + * } + * } + */ + private void validateMajorPageFaultMetric(JsonResponseNode responseNode) throws Exception { + Assert.assertTrue(responseNode.getTimestamp() > 0); + JsonResponseData responseData = responseNode.getData(); + Assert.assertEquals(1, responseData.getFieldDimensionSize()); + Assert.assertEquals(OSMetrics.PAGING_MAJ_FLT_RATE.toString(), responseData.getField(0).getName()); + Assert.assertEquals(Constants.DOUBLE, responseData.getField(0).getType()); + Assert.assertEquals(1, responseData.getRecordSize()); + Assert.assertTrue(responseData.getRecordAsDouble(0, OSMetrics.PAGING_MAJ_FLT_RATE.toString()) >= 0); + } + + /** + * { + * "JtlEoRowSI6iNpzpjlbp_Q": { + * "data": { + * "fields": [ + * { + * "name": "Paging_MinfltRate", + * "type": "DOUBLE" + * } + * ], + * "records": [ + * [ + * 0.28116752649470106 + * ] + * ] + * }, + * "timestamp": 1606861625000 + * } + * } + */ + private void validateMinorPageFaultMetric(JsonResponseNode responseNode) throws Exception { + Assert.assertTrue(responseNode.getTimestamp() > 0); + JsonResponseData responseData = responseNode.getData(); + Assert.assertEquals(1, responseData.getFieldDimensionSize()); + Assert.assertEquals(OSMetrics.PAGING_MIN_FLT_RATE.toString(), responseData.getField(0).getName()); + Assert.assertEquals(Constants.DOUBLE, responseData.getField(0).getType()); + Assert.assertEquals(1, responseData.getRecordSize()); + Assert.assertTrue(responseData.getRecordAsDouble(0, OSMetrics.PAGING_MIN_FLT_RATE.toString()) >= 0); + } + + /** + * number of pages in OS should be a non-zero value + * { + * "JtlEoRowSI6iNpzpjlbp_Q": { + * "data": { + * "fields": [ + * { + * "name": "Paging_RSS", + * "type": "DOUBLE" + * } + * ], + * "records": [ + * [ + * 666034.0 + * ] + * ] + * }, + * "timestamp": 1606866110000 + * } + * } + */ + private void validatePagingRSSMetric(JsonResponseNode responseNode) throws Exception { + Assert.assertTrue(responseNode.getTimestamp() > 0); + JsonResponseData responseData = responseNode.getData(); + Assert.assertEquals(1, responseData.getFieldDimensionSize()); + Assert.assertEquals(OSMetrics.PAGING_RSS.toString(), responseData.getField(0).getName()); + Assert.assertEquals(Constants.DOUBLE, responseData.getField(0).getType()); + Assert.assertEquals(1, responseData.getRecordSize()); + Assert.assertTrue(responseData.getRecordAsDouble(0, OSMetrics.PAGING_RSS.toString()) > 0); + } +} diff --git a/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseData.java b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseData.java new file mode 100644 index 00000000..f5a80189 --- /dev/null +++ b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseData.java @@ -0,0 +1,63 @@ +/* + * Copyright <2020> Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file 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. + */ + +package com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test.json; + +import com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test.json.JsonResponseField.Type.Constants; +import com.google.gson.annotations.SerializedName; + +public class JsonResponseData { + private static final String FIELDS = "fields"; + private static final String RECORDS = "records"; + @SerializedName(FIELDS) + private JsonResponseField[] fields; + @SerializedName(RECORDS) + private String[][] records; + + public JsonResponseData(JsonResponseField[] fields, String[][] records) { + this.fields = fields; + this.records = records; + } + + public int getFieldDimensionSize() { + return fields.length; + } + + public int getRecordSize() { + return records.length; + } + + public JsonResponseField getField(int index) throws IndexOutOfBoundsException { + return fields[index]; + } + + public String getRecord(int index, String fieldName) throws Exception { + for (int i = 0; i < getFieldDimensionSize(); i++) { + if (fieldName.equals(fields[i].getName())) { + return records[index][i]; + } + } + throw new IllegalArgumentException(); + } + + public Double getRecordAsDouble(int index, String fieldName) throws Exception { + String recordStr = getRecord(index, fieldName); + JsonResponseField field = getField(index); + if (!field.getType().equals(Constants.DOUBLE)) { + throw new IllegalArgumentException(); + } + return Double.parseDouble(recordStr); + } +} diff --git a/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseField.java b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseField.java new file mode 100644 index 00000000..13302517 --- /dev/null +++ b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseField.java @@ -0,0 +1,62 @@ +/* + * Copyright <2020> Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file 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. + */ + +package com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test.json; + +import com.google.gson.annotations.SerializedName; + +public class JsonResponseField { + private static final String NAME = "name"; + private static final String TYPE = "type"; + @SerializedName(NAME) + private String name; + @SerializedName(TYPE) + private String type; + + public JsonResponseField(String name, String type) { + this.name = name; + this.type = type; + } + + public String getName() { + return this.name; + } + + public String getType() { + return this.type; + } + + //SQLite data type + public enum Type { + VARCHAR(Constants.VARCHAR), + DOUBLE(Constants.DOUBLE); + + private final String value; + + Type(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + + public static class Constants { + public static final String VARCHAR = "VARCHAR"; + public static final String DOUBLE = "DOUBLE"; + } + } +} diff --git a/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseNode.java b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseNode.java new file mode 100644 index 00000000..6c6168c7 --- /dev/null +++ b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseNode.java @@ -0,0 +1,41 @@ +/* + * Copyright <2020> Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file 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. + */ + +package com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test.json; + +import com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test.json.JsonResponseData; +import com.google.gson.annotations.SerializedName; + +public class JsonResponseNode { + private static final String DATA = "data"; + private static final String TIMESTAMP = "timestamp"; + @SerializedName(DATA) + private JsonResponseData data; + @SerializedName(TIMESTAMP) + private long timestamp; + + public JsonResponseNode(JsonResponseData data, long timestamp) { + this.data = data; + this.timestamp = timestamp; + } + + public JsonResponseData getData() { + return data; + } + + public long getTimestamp() { + return timestamp; + } +} From 5475bd81cc451a8b815ad28ae1371b58c22dc933 Mon Sep 17 00:00:00 2001 From: Ruizhen Date: Mon, 11 Jan 2021 12:58:23 -0800 Subject: [PATCH 2/2] Address PR comments --- .../integ_test/json/JsonResponseData.java | 15 +++++++++++++++ .../integ_test/json/JsonResponseField.java | 8 ++++++++ .../integ_test/json/JsonResponseNode.java | 9 ++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseData.java b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseData.java index f5a80189..c6a2da5c 100644 --- a/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseData.java +++ b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseData.java @@ -18,6 +18,21 @@ import com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test.json.JsonResponseField.Type.Constants; import com.google.gson.annotations.SerializedName; +/** + * "data": { + * "fields": [ + * { + * "name": "CPU_Utilization", + * "type": "DOUBLE" + * } + * ], + * "records": [ + * [ + * 0.005275218803760752 + * ] + * ] + * } + */ public class JsonResponseData { private static final String FIELDS = "fields"; private static final String RECORDS = "records"; diff --git a/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseField.java b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseField.java index 13302517..9964d1e3 100644 --- a/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseField.java +++ b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseField.java @@ -17,6 +17,14 @@ import com.google.gson.annotations.SerializedName; +/** + * "fields": [ + * { + * "name": "CPU_Utilization", + * "type": "DOUBLE" + * } + * ] + */ public class JsonResponseField { private static final String NAME = "name"; private static final String TYPE = "type"; diff --git a/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseNode.java b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseNode.java index 6c6168c7..bf3bca14 100644 --- a/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseNode.java +++ b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/integ_test/json/JsonResponseNode.java @@ -15,9 +15,16 @@ package com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test.json; -import com.amazon.opendistro.elasticsearch.performanceanalyzer.integ_test.json.JsonResponseData; import com.google.gson.annotations.SerializedName; +/** + * "node1": { + * "data": { + * ....... + * }, + * "timestamp": 1606861740000 + * } + */ public class JsonResponseNode { private static final String DATA = "data"; private static final String TIMESTAMP = "timestamp";