From 353c3a6490476c42dd28d3a9b9e2274cc8dadace Mon Sep 17 00:00:00 2001 From: CoderJeffrey Date: Mon, 3 Jul 2023 11:14:55 -0700 Subject: [PATCH] Remove tab space and change avg datatype to LONG (Signed-off-by: Jeffrey Liu ujeffliu@amazon.com) Signed-off-by: CoderJeffrey --- .../reader/SearchBackPressureMetricsProcessor.java | 1 - .../reader/SearchBackPressureMetricsSnapShot.java | 8 ++++---- .../reader/SearchBackPressureMetricsProcessorTest.java | 2 +- .../reader/SearchBackPressureMetricsSnapShotTest.java | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/opensearch/performanceanalyzer/reader/SearchBackPressureMetricsProcessor.java b/src/main/java/org/opensearch/performanceanalyzer/reader/SearchBackPressureMetricsProcessor.java index 766ed8bbe..6e9547754 100644 --- a/src/main/java/org/opensearch/performanceanalyzer/reader/SearchBackPressureMetricsProcessor.java +++ b/src/main/java/org/opensearch/performanceanalyzer/reader/SearchBackPressureMetricsProcessor.java @@ -56,7 +56,6 @@ static SearchBackPressureMetricsProcessor buildSearchBackPressureMetricsProcesso currentWindowStartTime, searchBackPressureMetricsSnapShot); return new SearchBackPressureMetricsProcessor(searchBackPressureMetricsSnapShot); } - return new SearchBackPressureMetricsProcessor( searchBackPressureSnapshotNavigableMap.get(currentWindowStartTime)); } diff --git a/src/main/java/org/opensearch/performanceanalyzer/reader/SearchBackPressureMetricsSnapShot.java b/src/main/java/org/opensearch/performanceanalyzer/reader/SearchBackPressureMetricsSnapShot.java index 907ab5540..1f1a05ea7 100644 --- a/src/main/java/org/opensearch/performanceanalyzer/reader/SearchBackPressureMetricsSnapShot.java +++ b/src/main/java/org/opensearch/performanceanalyzer/reader/SearchBackPressureMetricsSnapShot.java @@ -84,7 +84,7 @@ public SearchBackPressureMetricsSnapShot(Connection conn, Long windowStartTime) AllMetrics.SearchBackPressureStatsValue .SEARCHBP_SHARD_STATS_RESOURCE_HEAP_USAGE_ROLLINGAVG .toString()), - Integer.class)); + Long.class)); this.add( DSL.field( DSL.name( @@ -106,7 +106,7 @@ public SearchBackPressureMetricsSnapShot(Connection conn, Long windowStartTime) AllMetrics.SearchBackPressureStatsValue .SEARCHBP_SHARD_STATS_RESOURCE_CPU_USAGE_CURRENTAVG .toString()), - Integer.class)); + Long.class)); // Task Stats Resource Heap / CPU Usage this.add( @@ -129,7 +129,7 @@ public SearchBackPressureMetricsSnapShot(Connection conn, Long windowStartTime) AllMetrics.SearchBackPressureStatsValue .SEARCHBP_TASK_STATS_RESOURCE_HEAP_USAGE_ROLLINGAVG .toString()), - Integer.class)); + Long.class)); this.add( DSL.field( DSL.name( @@ -151,7 +151,7 @@ public SearchBackPressureMetricsSnapShot(Connection conn, Long windowStartTime) AllMetrics.SearchBackPressureStatsValue .SEARCHBP_TASK_STATS_RESOURCE_CPU_USAGE_CURRENTAVG .toString()), - Integer.class)); + Long.class)); } }; diff --git a/src/test/java/org/opensearch/performanceanalyzer/reader/SearchBackPressureMetricsProcessorTest.java b/src/test/java/org/opensearch/performanceanalyzer/reader/SearchBackPressureMetricsProcessorTest.java index 2f5fc10ed..575712a2d 100644 --- a/src/test/java/org/opensearch/performanceanalyzer/reader/SearchBackPressureMetricsProcessorTest.java +++ b/src/test/java/org/opensearch/performanceanalyzer/reader/SearchBackPressureMetricsProcessorTest.java @@ -93,7 +93,7 @@ public void testSearchBackPressureProcessEvent() throws Exception { // SEARCHBP_SHARD_STATS_RESOURCE_HEAP_USAGE_ROLLINGAVG value is 3L according to the // SERIALIZED_EVENT, should EQUAL Assert.assertEquals( - 3, + 3L, result.get(0) .get( AllMetrics.SearchBackPressureStatsValue diff --git a/src/test/java/org/opensearch/performanceanalyzer/reader/SearchBackPressureMetricsSnapShotTest.java b/src/test/java/org/opensearch/performanceanalyzer/reader/SearchBackPressureMetricsSnapShotTest.java index b2c3626d5..2e88aa574 100644 --- a/src/test/java/org/opensearch/performanceanalyzer/reader/SearchBackPressureMetricsSnapShotTest.java +++ b/src/test/java/org/opensearch/performanceanalyzer/reader/SearchBackPressureMetricsSnapShotTest.java @@ -116,7 +116,7 @@ public void testReadSearchBackPressureMetricsSnapshot() throws Exception { + " should be " + String.valueOf(i), i, - result.get(0).get(required_searchbp_dims.get((int) i))); + ((Number) result.get(0).get(required_searchbp_dims.get(i))).intValue()); } }