Skip to content

Commit

Permalink
test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gagan Juneja committed May 6, 2024
1 parent 8ee3d10 commit 9df5cdd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ public class PerformanceAnalyzerSearchListener
private static final SearchListener NO_OP_SEARCH_LISTENER = new NoOpSearchListener();
private static final int KEYS_PATH_LENGTH = 4;
private final PerformanceAnalyzerController controller;
private final MetricsRegistry metricsRegistry;
private MetricsRegistry metricsRegistry;
private final Counter searchCPUUtilizationCounter;

public PerformanceAnalyzerSearchListener(final PerformanceAnalyzerController controller) {
this.controller = controller;
this.metricsRegistry =
OpenSearchResources.INSTANCE.getClusterService().getMetricsRegistry();
if (metricsRegistry != null) {
if (OpenSearchResources.INSTANCE.getClusterService() != null && OpenSearchResources.INSTANCE.getClusterService().getMetricsRegistry() != null) {
this.metricsRegistry =
OpenSearchResources.INSTANCE.getClusterService().getMetricsRegistry();
searchCPUUtilizationCounter =
metricsRegistry.createCounter(
"pa.core.search.cpuUtilization", "test counter", "1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ public class PerformanceAnalyzerTransportRequestHandler<T extends TransportReque

private ClusterService clusterService = OpenSearchResources.INSTANCE.getClusterService();

private MetricsRegistry metricsRegistry = clusterService.getMetricsRegistry();
private MetricsRegistry metricsRegistry;
private Counter cpuUtilizationCounter;

PerformanceAnalyzerTransportRequestHandler(
TransportRequestHandler<T> actualHandler, PerformanceAnalyzerController controller) {
this.actualHandler = actualHandler;
this.controller = controller;
this.metricsRegistry = clusterService.getMetricsRegistry();
this.cpuUtilizationCounter =
metricsRegistry.createCounter(
"pa.core.cpuUtilizationCounter", "cpuUtilizationCounter", "time");
metricsRegistry = clusterService.getMetricsRegistry();
}

PerformanceAnalyzerTransportRequestHandler<T> set(TransportRequestHandler<T> actualHandler) {
Expand Down

0 comments on commit 9df5cdd

Please sign in to comment.