67
67
import static org .elasticsearch .threadpool .ThreadPool .Names .WRITE ;
68
68
import static org .elasticsearch .xpack .core .monitoring .exporter .MonitoringTemplateUtils .TEMPLATE_VERSION ;
69
69
import static org .hamcrest .Matchers .containsString ;
70
+ import static org .hamcrest .Matchers .empty ;
70
71
import static org .hamcrest .Matchers .equalTo ;
71
72
import static org .hamcrest .Matchers .greaterThan ;
72
73
import static org .hamcrest .Matchers .greaterThanOrEqualTo ;
@@ -339,7 +340,7 @@ private void assertClusterStatsMonitoringDoc(final Map<String, Object> document,
339
340
340
341
final Map <String , Object > clusterStats = (Map <String , Object >) source .get ("cluster_stats" );
341
342
assertThat (clusterStats , notNullValue ());
342
- assertThat (clusterStats .size (), equalTo (4 ));
343
+ assertThat (clusterStats .size (), equalTo (5 ));
343
344
344
345
final Map <String , Object > stackStats = (Map <String , Object >) source .get ("stack_stats" );
345
346
assertThat (stackStats , notNullValue ());
@@ -349,7 +350,7 @@ private void assertClusterStatsMonitoringDoc(final Map<String, Object> document,
349
350
assertThat (apm , notNullValue ());
350
351
assertThat (apm .size (), equalTo (1 ));
351
352
assertThat (apm .remove ("found" ), is (apmIndicesExist ));
352
- assertThat (apm .isEmpty (), is ( true ));
353
+ assertThat (apm .keySet (), empty ( ));
353
354
354
355
final Map <String , Object > xpackStats = (Map <String , Object >) stackStats .get ("xpack" );
355
356
assertThat (xpackStats , notNullValue ());
@@ -361,14 +362,14 @@ private void assertClusterStatsMonitoringDoc(final Map<String, Object> document,
361
362
362
363
final Map <String , Object > clusterState = (Map <String , Object >) source .get ("cluster_state" );
363
364
assertThat (clusterState , notNullValue ());
364
- assertThat (clusterState .size (), equalTo (6 ));
365
365
assertThat (clusterState .remove ("nodes_hash" ), notNullValue ());
366
366
assertThat (clusterState .remove ("status" ), notNullValue ());
367
367
assertThat (clusterState .remove ("version" ), notNullValue ());
368
368
assertThat (clusterState .remove ("state_uuid" ), notNullValue ());
369
+ assertThat (clusterState .remove ("cluster_uuid" ), notNullValue ());
369
370
assertThat (clusterState .remove ("master_node" ), notNullValue ());
370
371
assertThat (clusterState .remove ("nodes" ), notNullValue ());
371
- assertThat (clusterState .isEmpty (), is ( true ));
372
+ assertThat (clusterState .keySet (), empty ( ));
372
373
}
373
374
374
375
/**
@@ -454,6 +455,11 @@ private void assertNodeStatsMonitoringDoc(final Map<String, Object> document) {
454
455
return ;
455
456
}
456
457
458
+ // bulk is not a thread pool in the current version but we allow it to support mixed version clusters
459
+ if (filter .startsWith ("node_stats.thread_pool.bulk" )) {
460
+ return ;
461
+ }
462
+
457
463
assertThat (filter + " must not be null in the monitoring document" , extractValue (filter , source ), notNullValue ());
458
464
});
459
465
}
0 commit comments