From 81eae43b84b3cf41cc9715567613759b1d138f9e Mon Sep 17 00:00:00 2001 From: Kaushal Kumar Date: Thu, 21 Dec 2023 18:08:48 -0800 Subject: [PATCH] add shard level and co-ordinator level task completion count in SBP collector (#593) * add completionCount in search backpressure stats collector Signed-off-by: Kaushal Kumar * replace hardcoded constants for completionCounts Signed-off-by: Kaushal Kumar * rename search backpressure constants Signed-off-by: Kaushal Kumar --------- Signed-off-by: Kaushal Kumar --- .../SearchBackPressureStatsCollector.java | 267 +++++++++++------- ...SearchBackPressureStatsCollectorTests.java | 48 ++-- 2 files changed, 184 insertions(+), 131 deletions(-) diff --git a/src/main/java/org/opensearch/performanceanalyzer/collectors/SearchBackPressureStatsCollector.java b/src/main/java/org/opensearch/performanceanalyzer/collectors/SearchBackPressureStatsCollector.java index fadbf135..5e53e649 100644 --- a/src/main/java/org/opensearch/performanceanalyzer/collectors/SearchBackPressureStatsCollector.java +++ b/src/main/java/org/opensearch/performanceanalyzer/collectors/SearchBackPressureStatsCollector.java @@ -34,8 +34,6 @@ import org.opensearch.performanceanalyzer.commons.metrics.PerformanceAnalyzerMetrics; import org.opensearch.performanceanalyzer.config.PerformanceAnalyzerController; import org.opensearch.search.backpressure.SearchBackpressureService; -import org.opensearch.search.backpressure.stats.SearchShardTaskStats; -import org.opensearch.search.backpressure.stats.SearchTaskStats; public class SearchBackPressureStatsCollector extends PerformanceAnalyzerMetricsCollector implements MetricsProcessor { @@ -109,7 +107,6 @@ public void collectMetrics(long startTime) { String jsonString = mapper.writeValueAsString(getSearchBackPressureStats()); currentSearchBackPressureStats = mapper.readValue(jsonString, SearchBackPressureStats.class); - } catch (InvocationTargetException | IllegalAccessException | NoSuchMethodException @@ -254,6 +251,7 @@ public void setSearchTaskStats(SearchTaskStats searchTaskStats) { public static class SearchShardTaskStats { private long cancellationCount; private long limitReachedCount; + private long completionCount; private Map resourceUsageTrackerStats; @JsonCreator @@ -266,12 +264,17 @@ public SearchShardTaskStats( SearchBackPressureStatsValue.Constants .SEARCHBP_SEARCH_SHARD_TASK_STATS_LIMITREACHEDCOUNT) long limitReachedCount, + @JsonProperty( + SearchBackPressureStatsValue.Constants + .SEARCHBP_SEARCH_SHARD_TASK_STATS_COMPLETIONCOUNT) + long completionCount, @JsonProperty( SearchBackPressureStatsValue.Constants .SEARCHBP_SEARCH_SHARD_TASK_STATS_RESOURCE_USAGE_TRACKER_STATS) Map resourceUsageTrackerStats) { this.cancellationCount = cancellationCount; this.limitReachedCount = limitReachedCount; + this.completionCount = completionCount; this.resourceUsageTrackerStats = resourceUsageTrackerStats; } @@ -300,6 +303,14 @@ public void setResourceUsageTrackerStats( Map resourceUsageTrackerStats) { this.resourceUsageTrackerStats = resourceUsageTrackerStats; } + + public long getCompletionCount() { + return completionCount; + } + + public void setCompletionCount(long completionCount) { + this.completionCount = completionCount; + } } /* @@ -308,6 +319,7 @@ public void setResourceUsageTrackerStats( public static class SearchTaskStats { private long cancellationCount; private long limitReachedCount; + private long completionCount; private Map resourceUsageTrackerStats; @JsonCreator @@ -320,12 +332,17 @@ public SearchTaskStats( SearchBackPressureStatsValue.Constants .SEARCHBP_SEARCH_TASK_STATS_LIMITREACHEDCOUNT) long limitReachedCount, + @JsonProperty( + SearchBackPressureStatsValue.Constants + .SEARCHBP_SEARCH_TASK_STATS_COMPLETIONCOUNT) + long completionCount, @JsonProperty( SearchBackPressureStatsValue.Constants .SEARCHBP_SEARCH_TASK_STATS_RESOURCE_USAGE_TRACKER_STATS) Map resourceUsageTrackerStats) { this.cancellationCount = cancellationCount; this.limitReachedCount = limitReachedCount; + this.completionCount = completionCount; this.resourceUsageTrackerStats = resourceUsageTrackerStats; } @@ -346,6 +363,14 @@ public void setLimitReachedCount(long limitReachedCount) { this.limitReachedCount = limitReachedCount; } + public long getCompletionCount() { + return completionCount; + } + + public void setCompletionCount(long completionCount) { + this.completionCount = completionCount; + } + public Map getResourceUsageTrackerStats() { return resourceUsageTrackerStats; } @@ -444,44 +469,46 @@ public static class SearchBackPressureMetrics extends MetricStatus { private String nodeId; // SearchShardTaskStats related stats (General) - private long searchbp_shard_stats_cancellationCount; - private long searchbp_shard_stats_limitReachedCount; + private long searchbp_shard_task_stats_cancellationCount; + private long searchbp_shard_task_stats_limitReachedCount; + private long searchbp_shard_task_stats_completionCount; // SearchShardTaskStats related stats (resourceUsageTrackerStats) // HEAP_USAGE_TRACKER - private long searchbp_shard_stats_resource_heap_usage_cancellationCount; - private long searchbp_shard_stats_resource_heap_usage_currentMax; - private long searchbp_shard_stats_resource_heap_usage_rollingAvg; + private long searchbp_shard_task_stats_resource_heap_usage_cancellationCount; + private long searchbp_shard_task_stats_resource_heap_usage_currentMax; + private long searchbp_shard_task_stats_resource_heap_usage_rollingAvg; // CPU_USAGE_TRACKER - private long searchbp_shard_stats_resource_cpu_usage_cancellationCount; - private long searchbp_shard_stats_resource_cpu_usage_currentMax; + private long searchbp_shard_task_stats_resource_cpu_usage_cancellationCount; + private long searchbp_shard_task_stats_resource_cpu_usage_currentMax; private long searchbp_shard_stats_resource_cpu_usage_currentAvg; // ELAPSED_TIME_TRACKER - private long searchbp_shard_stats_resource_elaspedtime_usage_cancellationCount; - private long searchbp_shard_stats_resource_elaspedtime_usage_currentMax; - private long searchbp_shard_stats_resource_elaspedtime_usage_currentAvg; + private long searchbp_shard_task_stats_resource_elaspedtime_usage_cancellationCount; + private long searchbp_shard_task_stats_resource_elaspedtime_usage_currentMax; + private long searchbp_shard_task_stats_resource_elaspedtime_usage_currentAvg; // SearchTaskStats related stats (General) - private long searchbp_task_stats_cancellationCount; - private long searchbp_task_stats_limitReachedCount; + private long searchbp_search_task_stats_cancellationCount; + private long searchbp_search_task_stats_limitReachedCount; + private long searchbp_search_task_stats_completionCount; // SearchTaskStats related stats (resourceUsageTrackerStats) // HEAP_USAGE_TRACKER - private long searchbp_task_stats_resource_heap_usage_cancellationCount; - private long searchbp_task_stats_resource_heap_usage_currentMax; - private long searchbp_task_stats_resource_heap_usage_rollingAvg; + private long searchbp_search_task_stats_resource_heap_usage_cancellationCount; + private long searchbp_search_task_stats_resource_heap_usage_currentMax; + private long searchbp_search_task_stats_resource_heap_usage_rollingAvg; // CPU_USAGE_TRACKER - private long searchbp_task_stats_resource_cpu_usage_cancellationCount; - private long searchbp_task_stats_resource_cpu_usage_currentMax; - private long searchbp_task_stats_resource_cpu_usage_currentAvg; + private long searchbp_search_task_stats_resource_cpu_usage_cancellationCount; + private long searchbp_search_task_stats_resource_cpu_usage_currentMax; + private long searchbp_search_task_stats_resource_cpu_usage_currentAvg; // ELAPSED_TIME_TRACKER - private long searchbp_task_stats_resource_elaspedtime_usage_cancellationCount; - private long searchbp_task_stats_resource_elaspedtime_usage_currentMax; - private long searchbp_task_stats_resource_elaspedtime_usage_currentAvg; + private long searchbp_search_task_stats_resource_elaspedtime_usage_cancellationCount; + private long searchbp_search_task_stats_resource_elaspedtime_usage_currentMax; + private long searchbp_search_task_stats_resource_elaspedtime_usage_currentAvg; public SearchBackPressureMetrics( String mode, @@ -513,27 +540,29 @@ public void populate_shard_task_stats(SearchShardTaskStats searchShardTaskStats) .getResourceUsageTrackerStats() .get(ELAPSED_TIME_USAGE_TRACKER_FIELD_NAME); - this.searchbp_shard_stats_cancellationCount = + this.searchbp_shard_task_stats_cancellationCount = searchShardTaskStats.getCancellationCount(); - this.searchbp_shard_stats_limitReachedCount = + this.searchbp_shard_task_stats_limitReachedCount = searchShardTaskStats.getLimitReachedCount(); - this.searchbp_shard_stats_resource_heap_usage_cancellationCount = + this.searchbp_shard_task_stats_completionCount = + searchShardTaskStats.getCompletionCount(); + this.searchbp_shard_task_stats_resource_heap_usage_cancellationCount = shard_heap_stats.getCancellationCount(); - this.searchbp_shard_stats_resource_heap_usage_currentMax = + this.searchbp_shard_task_stats_resource_heap_usage_currentMax = shard_heap_stats.getCurrentMax(); - this.searchbp_shard_stats_resource_heap_usage_rollingAvg = + this.searchbp_shard_task_stats_resource_heap_usage_rollingAvg = shard_heap_stats.getRollingAvg(); - this.searchbp_shard_stats_resource_cpu_usage_cancellationCount = + this.searchbp_shard_task_stats_resource_cpu_usage_cancellationCount = shard_cpu_stats.getCancellationCount(); - this.searchbp_shard_stats_resource_cpu_usage_currentMax = + this.searchbp_shard_task_stats_resource_cpu_usage_currentMax = shard_cpu_stats.getCurrentMax(); this.searchbp_shard_stats_resource_cpu_usage_currentAvg = shard_cpu_stats.getCurrentAvg(); - this.searchbp_shard_stats_resource_elaspedtime_usage_cancellationCount = + this.searchbp_shard_task_stats_resource_elaspedtime_usage_cancellationCount = shard_time_stats.getCancellationCount(); - this.searchbp_shard_stats_resource_elaspedtime_usage_currentMax = + this.searchbp_shard_task_stats_resource_elaspedtime_usage_currentMax = shard_time_stats.getCurrentMax(); - this.searchbp_shard_stats_resource_elaspedtime_usage_currentAvg = + this.searchbp_shard_task_stats_resource_elaspedtime_usage_currentAvg = shard_time_stats.getCurrentAvg(); } @@ -554,23 +583,28 @@ public void populate_task_stats(SearchTaskStats searchTaskStats) { .getResourceUsageTrackerStats() .get(ELAPSED_TIME_USAGE_TRACKER_FIELD_NAME); - this.searchbp_task_stats_cancellationCount = searchTaskStats.getCancellationCount(); - this.searchbp_task_stats_limitReachedCount = searchTaskStats.getLimitReachedCount(); - this.searchbp_task_stats_resource_heap_usage_cancellationCount = + this.searchbp_search_task_stats_cancellationCount = + searchTaskStats.getCancellationCount(); + this.searchbp_search_task_stats_limitReachedCount = + searchTaskStats.getLimitReachedCount(); + this.searchbp_search_task_stats_completionCount = searchTaskStats.getCompletionCount(); + this.searchbp_search_task_stats_resource_heap_usage_cancellationCount = task_heap_stats.getCancellationCount(); - this.searchbp_task_stats_resource_heap_usage_currentMax = + this.searchbp_search_task_stats_resource_heap_usage_currentMax = task_heap_stats.getCurrentMax(); - this.searchbp_task_stats_resource_heap_usage_rollingAvg = + this.searchbp_search_task_stats_resource_heap_usage_rollingAvg = task_heap_stats.getRollingAvg(); - this.searchbp_task_stats_resource_cpu_usage_cancellationCount = + this.searchbp_search_task_stats_resource_cpu_usage_cancellationCount = task_cpu_stats.getCancellationCount(); - this.searchbp_task_stats_resource_cpu_usage_currentMax = task_cpu_stats.getCurrentMax(); - this.searchbp_task_stats_resource_cpu_usage_currentAvg = task_cpu_stats.getCurrentAvg(); - this.searchbp_task_stats_resource_elaspedtime_usage_cancellationCount = + this.searchbp_search_task_stats_resource_cpu_usage_currentMax = + task_cpu_stats.getCurrentMax(); + this.searchbp_search_task_stats_resource_cpu_usage_currentAvg = + task_cpu_stats.getCurrentAvg(); + this.searchbp_search_task_stats_resource_elaspedtime_usage_cancellationCount = task_time_stats.getCancellationCount(); - this.searchbp_task_stats_resource_elaspedtime_usage_currentMax = + this.searchbp_search_task_stats_resource_elaspedtime_usage_currentMax = task_time_stats.getCurrentMax(); - this.searchbp_task_stats_resource_elaspedtime_usage_currentAvg = + this.searchbp_search_task_stats_resource_elaspedtime_usage_currentAvg = task_time_stats.getCurrentAvg(); } @@ -584,150 +618,169 @@ public String getSearchBackPressureStats_NodeId() { return this.nodeId; } - @JsonProperty(SearchBackPressureStatsValue.Constants.SEARCHBP_SHARD_STATS_CANCELLATIONCOUNT) - public long getSearchbp_shard_stats_cancellationCount() { - return searchbp_shard_stats_cancellationCount; + @JsonProperty( + SearchBackPressureStatsValue.Constants.SEARCHBP_SHARD_TASK_STATS_CANCELLATION_COUNT) + public long getSearchbp_shard_task_stats_cancellationCount() { + return searchbp_shard_task_stats_cancellationCount; } - @JsonProperty(SearchBackPressureStatsValue.Constants.SEARCHBP_SHARD_STATS_LIMITREACHEDCOUNT) - public long getSearchbp_shard_stats_limitReachedCount() { - return searchbp_shard_stats_limitReachedCount; + @JsonProperty( + SearchBackPressureStatsValue.Constants + .SEARCHBP_SHARD_TASK_STATS_LIMIT_REACHED_COUNT) + public long getSearchbp_shard_task_stats_limitReachedCount() { + return searchbp_shard_task_stats_limitReachedCount; + } + + @JsonProperty( + SearchBackPressureStatsValue.Constants.SEARCHBP_SHARD_TASK_STATS_COMPLETION_COUNT) + public long getSearchbp_shard_task_stats_completionCount() { + return searchbp_shard_task_stats_completionCount; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_SHARD_STATS_RESOURCE_HEAP_USAGE_CANCELLATIONCOUNT) - public long getSearchbp_shard_stats_resource_heap_usage_cancellationCount() { - return searchbp_shard_stats_resource_heap_usage_cancellationCount; + .SEARCHBP_SHARD_TASK_STATS_RESOURCE_HEAP_USAGE_CANCELLATION_COUNT) + public long getSearchbp_shard_task_stats_resource_heap_usage_cancellationCount() { + return searchbp_shard_task_stats_resource_heap_usage_cancellationCount; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_SHARD_STATS_RESOURCE_HEAP_USAGE_CURRENTMAX) - public long getSearchbp_shard_stats_resource_heap_usage_currentMax() { - return searchbp_shard_stats_resource_heap_usage_currentMax; + .SEARCHBP_SHARD_TASK_STATS_RESOURCE_HEAP_USAGE_CURRENT_MAX) + public long getSearchbp_shard_task_stats_resource_heap_usage_currentMax() { + return searchbp_shard_task_stats_resource_heap_usage_currentMax; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_SHARD_STATS_RESOURCE_HEAP_USAGE_ROLLINGAVG) + .SEARCHBP_SHARD_TASK_STATS_RESOURCE_HEAP_USAGE_ROLLING_AVG) public long getsearchbp_shard_stats_resource_heap_usage_rollingAvg() { - return searchbp_shard_stats_resource_heap_usage_rollingAvg; + return searchbp_shard_task_stats_resource_heap_usage_rollingAvg; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_SHARD_STATS_RESOURCE_CPU_USAGE_CANCELLATIONCOUNT) - public long getSearchbp_shard_stats_resource_cpu_usage_cancellationCount() { - return searchbp_shard_stats_resource_cpu_usage_cancellationCount; + .SEARCHBP_SHARD_TASK_STATS_RESOURCE_CPU_USAGE_CANCELLATION_COUNT) + public long getSearchbp_shard_task_stats_resource_cpu_usage_cancellationCount() { + return searchbp_shard_task_stats_resource_cpu_usage_cancellationCount; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_SHARD_STATS_RESOURCE_CPU_USAGE_CURRENTMAX) - public long getSearchbp_shard_stats_resource_cpu_usage_currentMax() { - return searchbp_shard_stats_resource_cpu_usage_currentMax; + .SEARCHBP_SHARD_TASK_STATS_RESOURCE_CPU_USAGE_CURRENT_MAX) + public long getSearchbp_shard_task_stats_resource_cpu_usage_currentMax() { + return searchbp_shard_task_stats_resource_cpu_usage_currentMax; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_SHARD_STATS_RESOURCE_CPU_USAGE_CURRENTAVG) + .SEARCHBP_SHARD_TASK_STATS_RESOURCE_CPU_USAGE_CURRENT_AVG) public long getSearchbp_shard_stats_resource_cpu_usage_currentAvg() { return searchbp_shard_stats_resource_cpu_usage_currentAvg; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_SHARD_STATS_RESOURCE_ELASPEDTIME_USAGE_CANCELLATIONCOUNT) - public long getSearchbp_shard_stats_resource_elaspedtime_usage_cancellationCount() { - return searchbp_shard_stats_resource_elaspedtime_usage_cancellationCount; + .SEARCHBP_SHARD_TASK_STATS_RESOURCE_ELASPEDTIME_USAGE_CANCELLATION_COUNT) + public long getSearchbp_shard_task_stats_resource_elaspedtime_usage_cancellationCount() { + return searchbp_shard_task_stats_resource_elaspedtime_usage_cancellationCount; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_SHARD_STATS_RESOURCE_ELASPEDTIME_USAGE_CURRENTMAX) - public long getSearchbp_shard_stats_resource_elaspedtime_usage_currentMax() { - return searchbp_shard_stats_resource_elaspedtime_usage_currentMax; + .SEARCHBP_SHARD_TASK_STATS_RESOURCE_ELASPEDTIME_USAGE_CURRENT_MAX) + public long getSearchbp_shard_task_stats_resource_elaspedtime_usage_currentMax() { + return searchbp_shard_task_stats_resource_elaspedtime_usage_currentMax; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_SHARD_STATS_RESOURCE_ELASPEDTIME_USAGE_CURRENTAVG) - public long getSearchbp_shard_stats_resource_elaspedtime_usage_currentAvg() { - return searchbp_shard_stats_resource_elaspedtime_usage_currentAvg; + .SEARCHBP_SHARD_TASK_STATS_RESOURCE_ELASPEDTIME_USAGE_CURRENT_AVG) + public long getSearchbp_shard_task_stats_resource_elaspedtime_usage_currentAvg() { + return searchbp_shard_task_stats_resource_elaspedtime_usage_currentAvg; } - @JsonProperty(SearchBackPressureStatsValue.Constants.SEARCHBP_TASK_STATS_CANCELLATIONCOUNT) - public long getSearchbp_task_stats_cancellationCount() { - return searchbp_task_stats_cancellationCount; + @JsonProperty( + SearchBackPressureStatsValue.Constants + .SEARCHBP_SEARCH_TASK_STATS_CANCELLATION_COUNT) + public long getSearchbp_search_task_stats_cancellationCount() { + return searchbp_search_task_stats_cancellationCount; + } + + @JsonProperty( + SearchBackPressureStatsValue.Constants + .SEARCHBP_SEARCH_TASK_STATS_LIMIT_REACHED_COUNT) + public long getSearchbp_search_task_stats_limitReachedCount() { + return searchbp_search_task_stats_limitReachedCount; } - @JsonProperty(SearchBackPressureStatsValue.Constants.SEARCHBP_TASK_STATS_LIMITREACHEDCOUNT) - public long getSearchbp_task_stats_limitReachedCount() { - return searchbp_task_stats_limitReachedCount; + @JsonProperty( + SearchBackPressureStatsValue.Constants.SEARCHBP_SEARCH_TASK_STATS_COMPLETION_COUNT) + public long getSearchbp_search_task_stats_completionCount() { + return searchbp_search_task_stats_completionCount; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_TASK_STATS_RESOURCE_HEAP_USAGE_CANCELLATIONCOUNT) - public long getSearchbp_task_stats_resource_heap_usage_cancellationCount() { - return searchbp_task_stats_resource_heap_usage_cancellationCount; + .SEARCHBP_SEARCH_TASK_STATS_RESOURCE_HEAP_USAGE_CANCELLATION_COUNT) + public long getSearchbp_search_task_stats_resource_heap_usage_cancellationCount() { + return searchbp_search_task_stats_resource_heap_usage_cancellationCount; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_TASK_STATS_RESOURCE_HEAP_USAGE_CURRENTMAX) - public long getSearchbp_task_stats_resource_heap_usage_currentMax() { - return searchbp_task_stats_resource_heap_usage_currentMax; + .SEARCHBP_SEARCH_TASK_STATS_RESOURCE_HEAP_USAGE_CURRENT_MAX) + public long getSearchbp_search_task_stats_resource_heap_usage_currentMax() { + return searchbp_search_task_stats_resource_heap_usage_currentMax; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_TASK_STATS_RESOURCE_HEAP_USAGE_ROLLINGAVG) + .SEARCHBP_SEARCH_TASK_STATS_RESOURCE_HEAP_USAGE_ROLLING_AVG) public long getsearchbp_task_stats_resource_heap_usage_rollingAvg() { - return searchbp_task_stats_resource_heap_usage_rollingAvg; + return searchbp_search_task_stats_resource_heap_usage_rollingAvg; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_TASK_STATS_RESOURCE_CPU_USAGE_CANCELLATIONCOUNT) - public long getSearchbp_task_stats_resource_cpu_usage_cancellationCount() { - return searchbp_task_stats_resource_cpu_usage_cancellationCount; + .SEARCHBP_SEARCH_TASK_STATS_RESOURCE_CPU_USAGE_CANCELLATION_COUNT) + public long getSearchbp_search_task_stats_resource_cpu_usage_cancellationCount() { + return searchbp_search_task_stats_resource_cpu_usage_cancellationCount; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_TASK_STATS_RESOURCE_CPU_USAGE_CURRENTMAX) - public long getSearchbp_task_stats_resource_cpu_usage_currentMax() { - return searchbp_task_stats_resource_cpu_usage_currentMax; + .SEARCHBP_SEARCH_TASK_STATS_RESOURCE_CPU_USAGE_CURRENT_MAX) + public long getSearchbp_search_task_stats_resource_cpu_usage_currentMax() { + return searchbp_search_task_stats_resource_cpu_usage_currentMax; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_TASK_STATS_RESOURCE_CPU_USAGE_CURRENTAVG) - public long getSearchbp_task_stats_resource_cpu_usage_currentAvg() { - return searchbp_task_stats_resource_cpu_usage_currentAvg; + .SEARCHBP_SEARCH_TASK_STATS_RESOURCE_CPU_USAGE_CURRENT_AVG) + public long getSearchbp_search_task_stats_resource_cpu_usage_currentAvg() { + return searchbp_search_task_stats_resource_cpu_usage_currentAvg; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_TASK_STATS_RESOURCE_ELASPEDTIME_USAGE_CANCELLATIONCOUNT) - public long getSearchbp_task_stats_resource_elaspedtime_usage_cancellationCount() { - return searchbp_task_stats_resource_elaspedtime_usage_cancellationCount; + .SEARCHBP_SEARCH_TASK_STATS_RESOURCE_ELASPEDTIME_USAGE_CANCELLATION_COUNT) + public long getSearchbp_search_task_stats_resource_elaspedtime_usage_cancellationCount() { + return searchbp_search_task_stats_resource_elaspedtime_usage_cancellationCount; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_TASK_STATS_RESOURCE_ELASPEDTIME_USAGE_CURRENTMAX) - public long getSearchbp_task_stats_resource_elaspedtime_usage_currentMax() { - return searchbp_task_stats_resource_elaspedtime_usage_currentMax; + .SEARCHBP_SEARCH_TASK_STATS_RESOURCE_ELASPEDTIME_USAGE_CURRENT_MAX) + public long getSearchbp_search_task_stats_resource_elaspedtime_usage_currentMax() { + return searchbp_search_task_stats_resource_elaspedtime_usage_currentMax; } @JsonProperty( SearchBackPressureStatsValue.Constants - .SEARCHBP_TASK_STATS_RESOURCE_ELASPEDTIME_USAGE_CURRENTAVG) - public long getSearchbp_task_stats_resource_elaspedtime_usage_currentAvg() { - return searchbp_task_stats_resource_elaspedtime_usage_currentAvg; + .SEARCHBP_SEARCH_TASK_STATS_RESOURCE_ELASPEDTIME_USAGE_CURRENT_AVG) + public long getSearchbp_search_task_stats_resource_elaspedtime_usage_currentAvg() { + return searchbp_search_task_stats_resource_elaspedtime_usage_currentAvg; } } } diff --git a/src/test/java/org/opensearch/performanceanalyzer/collectors/SearchBackPressureStatsCollectorTests.java b/src/test/java/org/opensearch/performanceanalyzer/collectors/SearchBackPressureStatsCollectorTests.java index 059a9302..6f75890f 100644 --- a/src/test/java/org/opensearch/performanceanalyzer/collectors/SearchBackPressureStatsCollectorTests.java +++ b/src/test/java/org/opensearch/performanceanalyzer/collectors/SearchBackPressureStatsCollectorTests.java @@ -37,28 +37,28 @@ public class SearchBackPressureStatsCollectorTests { // Required fields needed for search back pressure stats private List required_fields_for_searchBackPressureStats = Arrays.asList( - "searchbp_shard_stats_cancellationCount", - "searchbp_shard_stats_limitReachedCount", - "searchbp_shard_stats_resource_heap_usage_cancellationCount", - "searchbp_shard_stats_resource_heap_usage_currentMax", - "searchbp_shard_stats_resource_heap_usage_rollingAvg", - "searchbp_shard_stats_resource_cpu_usage_cancellationCount", - "searchbp_shard_stats_resource_cpu_usage_currentMax", - "searchbp_shard_stats_resource_cpu_usage_currentAvg", - "searchbp_shard_stats_resource_elaspedtime_usage_cancellationCount", - "searchbp_shard_stats_resource_elaspedtime_usage_currentMax", - "searchbp_shard_stats_resource_elaspedtime_usage_currentAvg", - "searchbp_task_stats_cancellationCount", - "searchbp_task_stats_limitReachedCount", - "searchbp_task_stats_resource_heap_usage_cancellationCount", - "searchbp_task_stats_resource_heap_usage_currentMax", - "searchbp_task_stats_resource_heap_usage_rollingAvg", - "searchbp_task_stats_resource_cpu_usage_cancellationCount", - "searchbp_task_stats_resource_cpu_usage_currentMax", - "searchbp_task_stats_resource_cpu_usage_currentAvg", - "searchbp_task_stats_resource_elaspedtime_usage_cancellationCount", - "searchbp_task_stats_resource_elaspedtime_usage_currentMax", - "searchbp_task_stats_resource_elaspedtime_usage_currentAvg", + "searchbp_shard_task_stats_cancellationCount", + "searchbp_shard_task_stats_limitReachedCount", + "searchbp_shard_task_stats_resource_heap_usage_cancellationCount", + "searchbp_shard_task_stats_resource_heap_usage_currentMax", + "searchbp_shard_task_stats_resource_heap_usage_rollingAvg", + "searchbp_shard_task_stats_resource_cpu_usage_cancellationCount", + "searchbp_shard_task_stats_resource_cpu_usage_currentMax", + "searchbp_shard_task_stats_resource_cpu_usage_currentAvg", + "searchbp_shard_task_stats_resource_elaspedtime_usage_cancellationCount", + "searchbp_shard_task_stats_resource_elaspedtime_usage_currentMax", + "searchbp_shard_task_stats_resource_elaspedtime_usage_currentAvg", + "searchbp_search_task_stats_cancellationCount", + "searchbp_search_task_stats_limitReachedCount", + "searchbp_search_task_stats_resource_heap_usage_cancellationCount", + "searchbp_search_task_stats_resource_heap_usage_currentMax", + "searchbp_search_task_stats_resource_heap_usage_rollingAvg", + "searchbp_search_task_stats_resource_cpu_usage_cancellationCount", + "searchbp_search_task_stats_resource_cpu_usage_currentMax", + "searchbp_search_task_stats_resource_cpu_usage_currentAvg", + "searchbp_search_task_stats_resource_elaspedtime_usage_cancellationCount", + "searchbp_search_task_stats_resource_elaspedtime_usage_currentMax", + "searchbp_search_task_stats_resource_elaspedtime_usage_currentAvg", "searchbp_mode", "searchbp_nodeid"); @@ -145,10 +145,10 @@ public void testSearchBackPressureStats_collectMetrics() Mockito.doReturn( new SearchBackPressureStatsCollector.SearchBackPressureStats( new SearchBackPressureStatsCollector.SearchShardTaskStats( - 0, 0, resource_usage_mock_stats), + 0, 0, 0, resource_usage_mock_stats), "MONITOR_ONLY", new SearchBackPressureStatsCollector.SearchTaskStats( - 0, 0, resource_usage_mock_stats))) + 0, 0, 0, resource_usage_mock_stats))) .when(spyCollector) .getSearchBackPressureStats();