Skip to content

Commit 8cb0de3

Browse files
committed
update spot
1 parent 463e995 commit 8cb0de3

File tree

9 files changed

+49
-13
lines changed

9 files changed

+49
-13
lines changed

server/src/internalClusterTest/java/org/elasticsearch/monitor/metrics/IndicesMetricsIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ public void testIndicesMetrics() {
273273
)
274274
);
275275

276-
277276
client(searchNode).prepareSearch("time*").setPreference(preference).setSize(100).get().decRef();
278277
var search2 = indicesService.stats(CommonStatsFlags.ALL, false).getSearch().getTotal();
279278
collectThenAssertMetrics(

server/src/internalClusterTest/java/org/elasticsearch/search/stats/SearchStatsIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public void testSimpleStats() throws Exception {
130130

131131
IndicesStatsResponse indicesStats = indicesAdmin().prepareStats().get();
132132
logger.debug("###### indices search stats: {}", indicesStats.getTotal().getSearch());
133-
assertThat(indicesStats.getTotal().getSearch().getTotal().getDfsCount(),equalTo(0L));
133+
assertThat(indicesStats.getTotal().getSearch().getTotal().getDfsCount(), equalTo(0L));
134134
assertThat(indicesStats.getTotal().getSearch().getTotal().getDfsTimeInMillis(), equalTo(0L));
135135
assertThat(indicesStats.getTotal().getSearch().getTotal().getQueryCount(), greaterThan(0L));
136136
assertThat(indicesStats.getTotal().getSearch().getTotal().getQueryTimeInMillis(), greaterThan(0L));

server/src/main/java/org/elasticsearch/index/search/stats/ShardSearchStats.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ public void onFetchPhase(SearchContext searchContext, long tookInNanos) {
107107
});
108108
}
109109

110-
@Override
111-
public void onPreDfsPhase(SearchContext searchContext) {
110+
@Override
111+
public void onPreDfsPhase(SearchContext searchContext) {
112112
computeStats(searchContext, statsHolder -> statsHolder.dfsCurrent.inc());
113113
}
114114

115115
@Override
116-
public void onDfsPhase(SearchContext searchContext, long tookInNanos) {
116+
public void onDfsPhase(SearchContext searchContext, long tookInNanos) {
117117
computeStats(searchContext, statsHolder -> {
118118
statsHolder.dfsMetric.inc(tookInNanos);
119119
statsHolder.dfsCurrent.dec();

server/src/main/java/org/elasticsearch/index/shard/SearchOperationListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ default void onPreDfsPhase(SearchContext searchContext) {}
7979
*
8080
* @see #onFailedQueryPhase(SearchContext)
8181
*/
82-
default void onDfsPhase(SearchContext searchContext, long tookInNanos) {}
82+
default void onDfsPhase(SearchContext searchContext, long tookInNanos) {}
8383

8484
/**
8585
* Executed if a dfs phased failed.

server/src/test/java/org/elasticsearch/index/search/stats/SearchStatsTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public void testShardLevelSearchGroupStats() throws Exception {
2222
// let's create two dummy search stats with groups
2323
Map<String, Stats> groupStats1 = new HashMap<>();
2424
Map<String, Stats> groupStats2 = new HashMap<>();
25-
groupStats2.put("group1", new Stats(1,1,1,1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1));
26-
SearchStats searchStats1 = new SearchStats(new Stats(1,1,1,1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), 0, groupStats1);
27-
SearchStats searchStats2 = new SearchStats(new Stats(1,1,1,1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), 0, groupStats2);
25+
groupStats2.put("group1", new Stats(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1));
26+
SearchStats searchStats1 = new SearchStats(new Stats(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), 0, groupStats1);
27+
SearchStats searchStats2 = new SearchStats(new Stats(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), 0, groupStats2);
2828

2929
// adding these two search stats and checking group stats are correct
3030
searchStats1.add(searchStats2);

server/src/test/java/org/elasticsearch/index/shard/SearchOperationListenerTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ public void validateReaderContext(ReaderContext readerContext, TransportRequest
177177
assertEquals(0, freeScrollContext.get());
178178
assertEquals(0, validateSearchContext.get());
179179

180-
181180
compositeListener.onQueryPhase(ctx, timeInNanos.get());
182181
assertEquals(0, preDfs.get());
183182
assertEquals(0, preFetch.get());

x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexStatsMonitoringDocTests.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,26 @@ private static CommonStats mockCommonStats() {
408408
);
409409
commonStats.getIndexing().add(new IndexingStats(indexingStats));
410410

411-
final SearchStats.Stats searchStats = new SearchStats.Stats(++iota, ++iota, no, no, no, no, no, no, no, no, no, no, no, no);
411+
final SearchStats.Stats searchStats = new SearchStats.Stats(
412+
no,
413+
no,
414+
no,
415+
no,
416+
++iota,
417+
++iota,
418+
no,
419+
no,
420+
no,
421+
no,
422+
no,
423+
no,
424+
no,
425+
no,
426+
no,
427+
no,
428+
no,
429+
no
430+
);
412431
commonStats.getSearch().add(new SearchStats(searchStats, no, null));
413432

414433
final SegmentsStats segmentsStats = new SegmentsStats();

x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndicesStatsMonitoringDocTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ private CommonStats mockCommonStats() {
186186
final IndexingStats.Stats indexingStats = new IndexingStats.Stats(3L, 4L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, true, 5L, 0, 0, 0.0, 0.0);
187187
commonStats.getIndexing().add(new IndexingStats(indexingStats));
188188

189-
final SearchStats.Stats searchStats = new SearchStats.Stats(6L, 7L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L);
189+
final SearchStats.Stats searchStats = new SearchStats.Stats(0L, 0L, 0L, 0L, 6L, 7L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L);
190190
commonStats.getSearch().add(new SearchStats(searchStats, 0L, null));
191191

192192
final BulkStats bulkStats = new BulkStats(0L, 0L, 0L, 0L, 0L);

x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/node/NodeStatsMonitoringDocTests.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,26 @@ private static NodeStats mockNodeStats() {
356356
indicesCommonStats.getQueryCache().add(new QueryCacheStats(++iota, ++iota, ++iota, ++iota, no));
357357
indicesCommonStats.getRequestCache().add(new RequestCacheStats(++iota, ++iota, ++iota, ++iota));
358358

359-
final SearchStats.Stats searchStats = new SearchStats.Stats(++iota, ++iota, no, no, no, no, no, no, no, no, no, no, no, no);
359+
final SearchStats.Stats searchStats = new SearchStats.Stats(
360+
no,
361+
no,
362+
no,
363+
no,
364+
++iota,
365+
++iota,
366+
no,
367+
no,
368+
no,
369+
no,
370+
no,
371+
no,
372+
no,
373+
no,
374+
no,
375+
no,
376+
no,
377+
no
378+
);
360379
indicesCommonStats.getSearch().add(new SearchStats(searchStats, no, null));
361380

362381
final SegmentsStats segmentsStats = new SegmentsStats();

0 commit comments

Comments
 (0)