Skip to content

Commit

Permalink
Fix tests and spotless apply
Browse files Browse the repository at this point in the history
Signed-off-by: Siddhant Deshmukh <[email protected]>
  • Loading branch information
deshsidd committed Aug 28, 2024
1 parent 0828b9d commit 886ca2f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

package org.opensearch.plugin.insights.core.listener;

import static org.opensearch.plugin.insights.settings.QueryInsightsSettings.TOP_N_QUERIES_GROUP_BY;
import static org.opensearch.plugin.insights.settings.QueryCategorizationSettings.SEARCH_QUERY_METRICS_ENABLED_SETTING;
import static org.opensearch.plugin.insights.settings.QueryInsightsSettings.TOP_N_QUERIES_GROUP_BY;
import static org.opensearch.plugin.insights.settings.QueryInsightsSettings.getTopNEnabledSetting;
import static org.opensearch.plugin.insights.settings.QueryInsightsSettings.getTopNSizeSetting;
import static org.opensearch.plugin.insights.settings.QueryInsightsSettings.getTopNWindowSizeSetting;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

package org.opensearch.plugin.insights.core.service;

import static org.opensearch.plugin.insights.settings.QueryCategorizationSettings.SEARCH_QUERY_METRICS_ENABLED_SETTING;
import static org.opensearch.plugin.insights.settings.QueryInsightsSettings.DEFAULT_GROUPING_TYPE;
import static org.opensearch.plugin.insights.settings.QueryInsightsSettings.getExporterSettings;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,26 +90,6 @@ public void testSearchQueryMetricsEnabled() {

}

public void testFeaturesEnableDisable() {
// Test case 1: All metric type collection disabled and search query metrics disabled, enable search query metrics
queryInsightsServiceSpy.enableCollection(MetricType.LATENCY, false);
queryInsightsServiceSpy.enableCollection(MetricType.CPU, false);
queryInsightsServiceSpy.enableCollection(MetricType.MEMORY, false);
queryInsightsServiceSpy.setSearchQueryMetricsEnabled(false);

queryInsightsServiceSpy.setSearchQueryMetricsEnabled(true);
verify(queryInsightsServiceSpy).checkAndRestartQueryInsights();

// Test case 2: All metric type collection disabled and search query metrics enabled, disable search query metrics
queryInsightsServiceSpy.enableCollection(MetricType.LATENCY, false);
queryInsightsServiceSpy.enableCollection(MetricType.CPU, false);
queryInsightsServiceSpy.enableCollection(MetricType.MEMORY, false);
queryInsightsServiceSpy.setSearchQueryMetricsEnabled(true);

queryInsightsServiceSpy.setSearchQueryMetricsEnabled(false);
verify(queryInsightsServiceSpy).checkAndStopQueryInsights();
}

public void testAddRecordGroupBySimilarityWithDifferentGroups() {

int numberOfRecordsRequired = 10;
Expand Down

0 comments on commit 886ca2f

Please sign in to comment.