diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/indices_red_cluster.json b/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/indices_red_cluster.json new file mode 100644 index 00000000000000..d313af503d4e51 --- /dev/null +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/indices_red_cluster.json @@ -0,0 +1,228 @@ +{ + "clusterStatus": { + "status": "red", + "indicesCount": 19, + "documentCount": 4535, + "dataSize": 9036305, + "nodesCount": 1, + "upTime": 1403187, + "version": [ + "7.0.0-alpha1" + ], + "memUsed": 280753264, + "memMax": 709623808, + "unassignedShards": 23, + "totalShards": 46 + }, + "rows": [ + { + "name": "many-0010_dgnlpqtstfvi", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 1.9449404761904763, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": "many-0024_rixhhwzyiczb", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 1.9449404761904763, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": "many-0016_gyvtsyauoqqg", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 1.9449404761904763, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": "many-0006_gkuqbjonkjmg", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 4.0788690476190474, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": "many-0022_dqbcjopzejlk", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 1.9449404761904763, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": "many-0020_fqfovcnznbus", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 1.9449404761904763, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": "many-0012_jwomwdgfpisl", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 1.9449404761904763, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": "many-0018_ipugjcmuagih", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 1.9449404761904763, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": "many-0008_amnscruqlsnu", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 4.0788690476190474, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": "many-0014_zrukbrvuluby", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 1.9449404761904763, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": "phone-home", + "doc_count": 1, + "data_size": 67798, + "index_rate": 0, + "search_rate": 0, + "status": "yellow", + "unassigned_shards": 5 + }, + { + "name": "many-0015_vwmrucgzvohb", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0009_reolfgzjjtvh", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0011_xtkcmlwmxcov", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0019_slpgftmneikv", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0017_zpyxggzmytun", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0025_xmvpnfeuqxtp", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0013_smjuwdkhpduv", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0007_milycdknpycp", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0021_xjtlceanhvup", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0.000744047619047619, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0023_hkbvktonytxh", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0005_dnzzblxoumfe", + "status": "Deleted" + }, + { + "name": "many-0004_wzgjkelqclur", + "status": "Deleted" + }, + { + "name": "many-0002_emdkmgdeflno", + "status": "Deleted" + }, + { + "name": "many-0003_jbwrztjwhkjt", + "status": "Deleted" + }, + { + "name": "many-0001_clruksahirti", + "status": "Deleted" + } + ] +} diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/indices_red_cluster_all.json b/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/indices_red_cluster_all.json new file mode 100644 index 00000000000000..0107cc49fa9597 --- /dev/null +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/indices_red_cluster_all.json @@ -0,0 +1,300 @@ +{ + "clusterStatus": { + "status": "red", + "indicesCount": 19, + "documentCount": 4535, + "dataSize": 9036305, + "nodesCount": 1, + "upTime": 1403187, + "version": [ + "7.0.0-alpha1" + ], + "memUsed": 280753264, + "memMax": 709623808, + "unassignedShards": 23, + "totalShards": 46 + }, + "rows": [ + { + "name": ".triggered_watches", + "doc_count": 0, + "data_size": 134430, + "index_rate": 0.078125, + "search_rate": 0.001488095238095238, + "status": "yellow", + "unassigned_shards": 1 + }, + { + "name": "many-0010_dgnlpqtstfvi", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 1.9449404761904763, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": "many-0024_rixhhwzyiczb", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 1.9449404761904763, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": ".watcher-history-7-2017.10.05", + "doc_count": 404, + "data_size": 707598, + "index_rate": 0, + "search_rate": 0, + "status": "yellow", + "unassigned_shards": 1 + }, + { + "name": "many-0016_gyvtsyauoqqg", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 1.9449404761904763, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": ".watcher-history-7-2017.10.06", + "doc_count": 1978, + "data_size": 5256199, + "index_rate": 0.078125, + "search_rate": 0, + "status": "yellow", + "unassigned_shards": 1 + }, + { + "name": "many-0006_gkuqbjonkjmg", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 4.0788690476190474, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": ".monitoring-es-6-2017.10.06", + "doc_count": 2001, + "data_size": 2607666, + "index_rate": 2.2202380952380953, + "search_rate": 2.34375, + "status": "yellow", + "unassigned_shards": 1 + }, + { + "name": "many-0022_dqbcjopzejlk", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 1.9449404761904763, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": "many-0020_fqfovcnznbus", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 1.9449404761904763, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": "many-0012_jwomwdgfpisl", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 1.9449404761904763, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": ".monitoring-kibana-6-2017.10.06", + "doc_count": 134, + "data_size": 171216, + "index_rate": 0.09672619047619048, + "search_rate": 0.09672619047619048, + "status": "yellow", + "unassigned_shards": 1 + }, + { + "name": "many-0018_ipugjcmuagih", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 1.9449404761904763, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": "many-0008_amnscruqlsnu", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 4.0788690476190474, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": "many-0014_zrukbrvuluby", + "doc_count": 1, + "data_size": 3821, + "index_rate": 0, + "search_rate": 1.9449404761904763, + "status": "green", + "unassigned_shards": 0 + }, + { + "name": ".kibana", + "doc_count": 1, + "data_size": 5406, + "index_rate": 0, + "search_rate": 0.34672619047619047, + "status": "yellow", + "unassigned_shards": 1 + }, + { + "name": ".monitoring-alerts-6", + "doc_count": 1, + "data_size": 6706, + "index_rate": 0.012648809523809524, + "search_rate": 0.07738095238095238, + "status": "yellow", + "unassigned_shards": 1 + }, + { + "name": "phone-home", + "doc_count": 1, + "data_size": 67798, + "index_rate": 0, + "search_rate": 0, + "status": "yellow", + "unassigned_shards": 5 + }, + { + "name": ".watches", + "doc_count": 5, + "data_size": 41076, + "index_rate": 0.078125, + "search_rate": 0, + "status": "yellow", + "unassigned_shards": 1 + }, + { + "name": "many-0015_vwmrucgzvohb", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0009_reolfgzjjtvh", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0011_xtkcmlwmxcov", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0019_slpgftmneikv", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0017_zpyxggzmytun", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0025_xmvpnfeuqxtp", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0013_smjuwdkhpduv", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0007_milycdknpycp", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0021_xjtlceanhvup", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0.000744047619047619, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0023_hkbvktonytxh", + "doc_count": 1, + "data_size": 3728, + "index_rate": 0, + "search_rate": 0, + "status": "red", + "unassigned_shards": 1 + }, + { + "name": "many-0005_dnzzblxoumfe", + "status": "Deleted" + }, + { + "name": "many-0004_wzgjkelqclur", + "status": "Deleted" + }, + { + "name": "many-0002_emdkmgdeflno", + "status": "Deleted" + }, + { + "name": "many-0003_jbwrztjwhkjt", + "status": "Deleted" + }, + { + "name": "many-0001_clruksahirti", + "status": "Deleted" + } + ] +} diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/indices.json b/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/indices_shards_relocating.json similarity index 100% rename from x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/indices.json rename to x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/indices_shards_relocating.json diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/indices_all.json b/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/indices_shards_relocating_all.json similarity index 100% rename from x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/indices_all.json rename to x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/indices_shards_relocating_all.json diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/indices.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch/indices.js index 7ed7b81882d6ad..105c90e6d45af0 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch/indices.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/indices.js @@ -5,52 +5,97 @@ */ import expect from 'expect.js'; -import indicesFixture from './fixtures/indices'; -import indicesAllFixture from './fixtures/indices_all'; +import relocatingShardsFixture from './fixtures/indices_shards_relocating'; +import relocationShardsAllFixture from './fixtures/indices_shards_relocating_all'; +import indicesRedClusterFixture from './fixtures/indices_red_cluster'; +import indicesRedClusterAllFixture from './fixtures/indices_red_cluster_all'; export default function ({ getService }) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); - describe('index listing', () => { - const archive = 'monitoring/singlecluster-three-nodes-shard-relocation'; - const timeRange = { - min: '2017-10-05T20:31:48.000Z', - max: '2017-10-05T20:35:12.000Z' - }; + describe('indices', () => { + describe('shard-relocation', () => { + const archive = 'monitoring/singlecluster-three-nodes-shard-relocation'; + const timeRange = { + min: '2017-10-05T20:31:48.000Z', + max: '2017-10-05T20:35:12.000Z' + }; - before('load archive', () => { - return esArchiver.load(archive); - }); + before('load archive', () => { + return esArchiver.load(archive); + }); - after('unload archive', () => { - return esArchiver.unload(archive); - }); + after('unload archive', () => { + return esArchiver.unload(archive); + }); + + it('should summarize the non-system indices with stats', async () => { + const { body } = await supertest + .post('/api/monitoring/v1/clusters/YCxj-RAgSZCP6GuOQ8M1EQ/elasticsearch/indices') + .set('kbn-xsrf', 'xxx') + .send({ + timeRange, + showSystemIndices: false + }) + .expect(200); + + expect(body).to.eql(relocatingShardsFixture); + }); + + it('should summarize all indices with stats', async () => { + const { body } = await supertest + .post('/api/monitoring/v1/clusters/YCxj-RAgSZCP6GuOQ8M1EQ/elasticsearch/indices') + .set('kbn-xsrf', 'xxx') + .send({ + timeRange, + showSystemIndices: true + }) + .expect(200); - it('should summarize the non-system indices with stats', async () => { - const { body } = await supertest - .post('/api/monitoring/v1/clusters/YCxj-RAgSZCP6GuOQ8M1EQ/elasticsearch/indices') - .set('kbn-xsrf', 'xxx') - .send({ - timeRange, - showSystemIndices: false - }) - .expect(200); - - expect(body).to.eql(indicesFixture); + expect(body).to.eql(relocationShardsAllFixture); + }); }); + describe('health-red', () => { + const archive = 'monitoring/singlecluster-red-platinum'; + const timeRange = { + min: '2017-10-06T19:53:06.000Z', + max: '2017-10-06T20:15:30.000Z' + }; + + before('load clusters archive', () => { + return esArchiver.load(archive); + }); + + after('unload clusters archive', () => { + return esArchiver.unload(archive); + }); + + it('should summarize the non-system indices with stats', async () => { + const { body } = await supertest + .post('/api/monitoring/v1/clusters/1LYuyvCCQFS3FAO_h65PQw/elasticsearch/indices') + .set('kbn-xsrf', 'xxx') + .send({ + timeRange, + showSystemIndices: false + }) + .expect(200); + + expect(body).to.eql(indicesRedClusterFixture); + }); + + it('should summarize all indices with stats', async () => { + const { body } = await supertest + .post('/api/monitoring/v1/clusters/1LYuyvCCQFS3FAO_h65PQw/elasticsearch/indices') + .set('kbn-xsrf', 'xxx') + .send({ + timeRange, + showSystemIndices: true + }) + .expect(200); - it('should summarize all indices with stats', async () => { - const { body } = await supertest - .post('/api/monitoring/v1/clusters/YCxj-RAgSZCP6GuOQ8M1EQ/elasticsearch/indices') - .set('kbn-xsrf', 'xxx') - .send({ - timeRange, - showSystemIndices: true - }) - .expect(200); - - expect(body).to.eql(indicesAllFixture); + expect(body).to.eql(indicesRedClusterAllFixture); + }); }); }); }