@@ -72,7 +72,7 @@ public void init() {
7272 .thenReturn (heapUsedHistogram );
7373 Mockito .when (
7474 metricsRegistry .createHistogram (
75- Mockito .eq ("search_latency " ),
75+ Mockito .eq ("shard_search_latency " ),
7676 Mockito .anyString (),
7777 Mockito .eq ("ms" )))
7878 .thenReturn (searchLatencyHistogram );
@@ -104,6 +104,9 @@ public void testQueryPhase() {
104104 initializeValidSearchContext (true );
105105 Mockito .when (controller .getCollectorsRunModeValue ())
106106 .thenReturn (Util .CollectorMode .TELEMETRY .getValue ());
107+ Mockito .when (shardId .getIndex ()).thenReturn (index );
108+ Mockito .when (index .getName ()).thenReturn ("myTestIndex" );
109+ Mockito .when (index .getUUID ()).thenReturn ("abc-def" );
107110 searchListener .preQueryPhase (searchContext );
108111 searchListener .queryPhase (searchContext , 0l );
109112 Mockito .verify (task ).addResourceTrackingCompletionListener (Mockito .any ());
@@ -115,6 +118,9 @@ public void testQueryPhaseFailed() {
115118 initializeValidSearchContext (true );
116119 Mockito .when (controller .getCollectorsRunModeValue ())
117120 .thenReturn (Util .CollectorMode .TELEMETRY .getValue ());
121+ Mockito .when (shardId .getIndex ()).thenReturn (index );
122+ Mockito .when (index .getName ()).thenReturn ("myTestIndex" );
123+ Mockito .when (index .getUUID ()).thenReturn ("abc-def" );
118124 searchListener .preQueryPhase (searchContext );
119125 searchListener .failedQueryPhase (searchContext );
120126 Mockito .verify (task ).addResourceTrackingCompletionListener (Mockito .any ());
@@ -125,6 +131,9 @@ public void testFetchPhase() {
125131 initializeValidSearchContext (true );
126132 Mockito .when (controller .getCollectorsRunModeValue ())
127133 .thenReturn (Util .CollectorMode .TELEMETRY .getValue ());
134+ Mockito .when (shardId .getIndex ()).thenReturn (index );
135+ Mockito .when (index .getName ()).thenReturn ("myTestIndex" );
136+ Mockito .when (index .getUUID ()).thenReturn ("abc-def" );
128137 searchListener .preFetchPhase (searchContext );
129138 searchListener .fetchPhase (searchContext , 0l );
130139 Mockito .verify (task ).addResourceTrackingCompletionListener (Mockito .any ());
@@ -136,6 +145,9 @@ public void testFetchPhaseFailed() {
136145 initializeValidSearchContext (true );
137146 Mockito .when (controller .getCollectorsRunModeValue ())
138147 .thenReturn (Util .CollectorMode .TELEMETRY .getValue ());
148+ Mockito .when (shardId .getIndex ()).thenReturn (index );
149+ Mockito .when (index .getName ()).thenReturn ("myTestIndex" );
150+ Mockito .when (index .getUUID ()).thenReturn ("abc-def" );
139151 searchListener .preFetchPhase (searchContext );
140152 searchListener .failedFetchPhase (searchContext );
141153 Mockito .verify (task ).addResourceTrackingCompletionListener (Mockito .any ());
0 commit comments