[Monitoring/Test] More API Integration tests (#18700) (#18732)

This commit is contained in:
Tim Sullivan 2018-05-02 14:07:11 -07:00 committed by GitHub
parent 53a0a93769
commit be27610951
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 10860 additions and 1 deletions

View file

@ -0,0 +1,39 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import expect from 'expect.js';
import beatDetailFixture from './fixtures/detail';
export default function ({ getService }) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
describe('instance detail', () => {
const archive = 'monitoring/beats-with-restarted-instance';
const timeRange = {
min: '2018-02-09T20:49:00Z',
max: '2018-02-09T21:50:00Z'
};
before('load archive', () => {
return esArchiver.load(archive);
});
after('unload archive', () => {
return esArchiver.unload(archive);
});
it('should summarize beat with metrics', async () => {
const { body } = await supertest
.post('/api/monitoring/v1/clusters/fHJwISmKTFO8bj57oFBLUQ/beats/beat/60599a4f-8139-4251-b0b9-15866df34221')
.set('kbn-xsrf', 'xxx')
.send({ timeRange })
.expect(200);
expect(body).to.eql(beatDetailFixture);
});
});
}

File diff suppressed because it is too large Load diff

View file

@ -8,5 +8,6 @@ export default function ({ loadTestFile }) {
describe('Beats', () => {
loadTestFile(require.resolve('./overview'));
loadTestFile(require.resolve('./list'));
loadTestFile(require.resolve('./detail'));
});
}

View file

@ -0,0 +1,73 @@
{
"clusterStatus": {
"status": "yellow",
"indicesCount": 20,
"documentCount": 25927,
"dataSize": 106492436,
"nodesCount": 3,
"upTime": 1187008,
"version": [
"7.0.0-alpha1"
],
"memUsed": 603241144,
"memMax": 2128871424,
"unassignedShards": 5,
"totalShards": 80
},
"rows": [
{
"name": "watermelon-tweets-2017.10.05",
"doc_count": 3,
"data_size": 232955,
"index_rate": 0,
"search_rate": 0,
"status": "yellow",
"unassigned_shards": 1
},
{
"name": "avocado-tweets-2017.10.02",
"doc_count": 628,
"data_size": 9202023,
"index_rate": 0,
"search_rate": 0,
"status": "green",
"unassigned_shards": 0
},
{
"name": "avocado-tweets-2017.10.03",
"doc_count": 1154,
"data_size": 14962115,
"index_rate": 0,
"search_rate": 0,
"status": "green",
"unassigned_shards": 0
},
{
"name": "relocation_test",
"doc_count": 1,
"data_size": 4870,
"index_rate": 0,
"search_rate": 0,
"status": "green",
"unassigned_shards": 0
},
{
"name": "avocado-tweets-2017.09.30",
"doc_count": 1991,
"data_size": 20947574,
"index_rate": 0,
"search_rate": 0,
"status": "green",
"unassigned_shards": 0
},
{
"name": "phone-home",
"doc_count": 10,
"data_size": 1278604,
"index_rate": 0,
"search_rate": 0,
"status": "yellow",
"unassigned_shards": 1
}
]
}

View file

@ -0,0 +1,199 @@
{
"clusterStatus": {
"status": "yellow",
"indicesCount": 20,
"documentCount": 25927,
"dataSize": 106492436,
"nodesCount": 3,
"upTime": 1187008,
"version": [
"7.0.0-alpha1"
],
"memUsed": 603241144,
"memMax": 2128871424,
"unassignedShards": 5,
"totalShards": 80
},
"rows": [
{
"name": ".triggered_watches",
"doc_count": 0,
"data_size": 28561,
"index_rate": 0.08823529411764706,
"search_rate": 0,
"status": "green",
"unassigned_shards": 0
},
{
"name": "watermelon-tweets-2017.10.05",
"doc_count": 3,
"data_size": 232955,
"index_rate": 0,
"search_rate": 0,
"status": "yellow",
"unassigned_shards": 1
},
{
"name": "avocado-tweets-2017.10.02",
"doc_count": 628,
"data_size": 9202023,
"index_rate": 0,
"search_rate": 0,
"status": "green",
"unassigned_shards": 0
},
{
"name": ".watcher-history-7-2017.09.29",
"doc_count": 1743,
"data_size": 4640398,
"index_rate": 0,
"search_rate": 0,
"status": "green",
"unassigned_shards": 0
},
{
"name": "avocado-tweets-2017.10.03",
"doc_count": 1154,
"data_size": 14962115,
"index_rate": 0,
"search_rate": 0,
"status": "green",
"unassigned_shards": 0
},
{
"name": ".watcher-history-7-2017.10.05",
"doc_count": 2304,
"data_size": 11481351,
"index_rate": 0.08823529411764706,
"search_rate": 0,
"status": "green",
"unassigned_shards": 0
},
{
"name": ".watcher-history-7-2017.10.03",
"doc_count": 3242,
"data_size": 8986146,
"index_rate": 0,
"search_rate": 0,
"status": "green",
"unassigned_shards": 0
},
{
"name": ".watcher-history-7-2017.10.04",
"doc_count": 3815,
"data_size": 9433688,
"index_rate": 0,
"search_rate": 0,
"status": "green",
"unassigned_shards": 0
},
{
"name": ".watcher-history-7-2017.10.01",
"doc_count": 35,
"data_size": 486636,
"index_rate": 0,
"search_rate": 0,
"status": "green",
"unassigned_shards": 0
},
{
"name": ".watcher-history-7-2017.10.02",
"doc_count": 3185,
"data_size": 8140314,
"index_rate": 0,
"search_rate": 0,
"status": "green",
"unassigned_shards": 0
},
{
"name": ".monitoring-es-6-2017.10.05",
"doc_count": 1077,
"data_size": 516721,
"index_rate": 9.117647058823529,
"search_rate": 1.7352941176470589,
"status": "yellow",
"unassigned_shards": 1
},
{
"name": ".security-v6",
"doc_count": 7,
"data_size": 61276,
"index_rate": 0,
"search_rate": 0,
"status": "yellow",
"unassigned_shards": 1
},
{
"name": ".watcher-history-7-2017.09.30",
"doc_count": 6706,
"data_size": 15809068,
"index_rate": 0,
"search_rate": 0,
"status": "green",
"unassigned_shards": 0
},
{
"name": ".kibana",
"doc_count": 2,
"data_size": 44821,
"index_rate": 0,
"search_rate": 0.7058823529411765,
"status": "green",
"unassigned_shards": 0
},
{
"name": ".monitoring-alerts-6",
"doc_count": 1,
"data_size": 13650,
"index_rate": 0.00980392156862745,
"search_rate": 0.05392156862745098,
"status": "green",
"unassigned_shards": 0
},
{
"name": "relocation_test",
"doc_count": 1,
"data_size": 4870,
"index_rate": 0,
"search_rate": 0,
"status": "green",
"unassigned_shards": 0
},
{
"name": "avocado-tweets-2017.09.30",
"doc_count": 1991,
"data_size": 20947574,
"index_rate": 0,
"search_rate": 0,
"status": "green",
"unassigned_shards": 0
},
{
"name": ".watches",
"doc_count": 5,
"data_size": 96351,
"index_rate": 0.08823529411764706,
"search_rate": 0.00980392156862745,
"status": "green",
"unassigned_shards": 0
},
{
"name": "phone-home",
"doc_count": 10,
"data_size": 1278604,
"index_rate": 0,
"search_rate": 0,
"status": "yellow",
"unassigned_shards": 1
},
{
"name": ".monitoring-kibana-6-2017.10.05",
"doc_count": 18,
"data_size": 125314,
"index_rate": 0.08333333333333333,
"search_rate": 0.11764705882352941,
"status": "yellow",
"unassigned_shards": 1
}
]
}

View file

@ -9,5 +9,7 @@ export default function ({ loadTestFile }) {
loadTestFile(require.resolve('./overview'));
loadTestFile(require.resolve('./nodes'));
loadTestFile(require.resolve('./node_detail'));
loadTestFile(require.resolve('./indices'));
loadTestFile(require.resolve('./index_detail'));
});
}

View file

@ -0,0 +1,56 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import expect from 'expect.js';
import indexDetailFixture from './fixtures/index_detail';
import indexDetailAdvancedFixture from './fixtures/index_detail_advanced';
export default function ({ getService }) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
describe('index detail', () => {
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);
});
after('unload archive', () => {
return esArchiver.unload(archive);
});
it('should summarize index with chart metrics data for the non-advanced view', async () => {
const { body } = await supertest
.post('/api/monitoring/v1/clusters/YCxj-RAgSZCP6GuOQ8M1EQ/elasticsearch/indices/avocado-tweets-2017.10.02')
.set('kbn-xsrf', 'xxx')
.send({
timeRange,
is_advanced: false
})
.expect(200);
expect(body).to.eql(indexDetailFixture);
});
it('should summarize index with chart metrics data for the advanced view', async () => {
const { body } = await supertest
.post('/api/monitoring/v1/clusters/YCxj-RAgSZCP6GuOQ8M1EQ/elasticsearch/indices/avocado-tweets-2017.10.02')
.set('kbn-xsrf', 'xxx')
.send({
timeRange,
is_advanced: true
})
.expect(200);
expect(body).to.eql(indexDetailAdvancedFixture);
});
});
}

View file

@ -0,0 +1,56 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import expect from 'expect.js';
import indicesFixture from './fixtures/indices';
import indicesAllFixture from './fixtures/indices_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'
};
before('load archive', () => {
return esArchiver.load(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(indicesFixture);
});
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);
});
});
}

View file

@ -0,0 +1,596 @@
{
"metrics": {
"kibana_os_load": [
{
"bucket_size": "10 seconds",
"timeRange": {
"min": 1504027457000,
"max": 1504027568000
},
"metric": {
"app": "kibana",
"field": "kibana_stats.os.load.1m",
"metricAgg": "max",
"label": "1m",
"title": "System Load",
"description": "Load average over the last minute.",
"units": "",
"format": "0,0.[00]",
"hasCalculation": false,
"isDerivative": false
},
"data": [
[
1504027460000,
5.87109375
],
[
1504027470000,
5.84375
],
[
1504027480000,
5.08984375
],
[
1504027490000,
4.53515625
],
[
1504027500000,
3.990234375
],
[
1504027510000,
3.537109375
],
[
1504027520000,
3.29296875
],
[
1504027530000,
3.2421875
],
[
1504027540000,
3.19140625
]
]
},
{
"bucket_size": "10 seconds",
"timeRange": {
"min": 1504027457000,
"max": 1504027568000
},
"metric": {
"app": "kibana",
"field": "kibana_stats.os.load.5m",
"metricAgg": "max",
"label": "5m",
"title": "System Load",
"description": "Load average over the last 5 minutes.",
"units": "",
"format": "0,0.[00]",
"hasCalculation": false,
"isDerivative": false
},
"data": [
[
1504027460000,
4.92578125
],
[
1504027470000,
4.9453125
],
[
1504027480000,
4.81640625
],
[
1504027490000,
4.70703125
],
[
1504027500000,
4.58203125
],
[
1504027510000,
4.46484375
],
[
1504027520000,
4.3828125
],
[
1504027530000,
4.3359375
],
[
1504027540000,
4.29296875
]
]
},
{
"bucket_size": "10 seconds",
"timeRange": {
"min": 1504027457000,
"max": 1504027568000
},
"metric": {
"app": "kibana",
"field": "kibana_stats.os.load.15m",
"metricAgg": "max",
"label": "15m",
"title": "System Load",
"description": "Load average over the last 15 minutes.",
"units": "",
"format": "0,0.[00]",
"hasCalculation": false,
"isDerivative": false
},
"data": [
[
1504027460000,
4.5390625
],
[
1504027470000,
4.546875
],
[
1504027480000,
4.5078125
],
[
1504027490000,
4.46875
],
[
1504027500000,
4.4296875
],
[
1504027510000,
4.390625
],
[
1504027520000,
4.359375
],
[
1504027530000,
4.34375
],
[
1504027540000,
4.328125
]
]
}
],
"kibana_average_concurrent_connections": [
{
"bucket_size": "10 seconds",
"timeRange": {
"min": 1504027457000,
"max": 1504027568000
},
"metric": {
"app": "kibana",
"field": "kibana_stats.concurrent_connections",
"metricAgg": "max",
"label": "HTTP Connections",
"description": "Total number of open socket connections to the Kibana instance.",
"units": "",
"format": "0.[00]",
"hasCalculation": false,
"isDerivative": false
},
"data": [
[
1504027460000,
78
],
[
1504027470000,
90
],
[
1504027480000,
102
],
[
1504027490000,
114
],
[
1504027500000,
126
],
[
1504027510000,
138
],
[
1504027520000,
150
],
[
1504027530000,
162
],
[
1504027540000,
174
]
]
}
],
"kibana_process_delay": [
{
"bucket_size": "10 seconds",
"timeRange": {
"min": 1504027457000,
"max": 1504027568000
},
"metric": {
"app": "kibana",
"field": "kibana_stats.process.event_loop_delay",
"metricAgg": "max",
"label": "Event Loop Delay",
"description": "Delay in Kibana server event loops. Longer delays may indicate blocking events in server thread, such as synchronous functions taking large amount of CPU time.",
"units": "ms",
"format": "0.[00]",
"hasCalculation": false,
"isDerivative": false
},
"data": [
[
1504027460000,
9.576263427734375
],
[
1504027470000,
10.395200729370117
],
[
1504027480000,
11.072744369506836
],
[
1504027490000,
11.617706298828125
],
[
1504027500000,
12.510245323181152
],
[
1504027510000,
13.343531608581543
],
[
1504027520000,
14.059904098510742
],
[
1504027530000,
14.816107749938965
],
[
1504027540000,
15.663384437561035
]
]
}
],
"kibana_memory": [
{
"bucket_size": "10 seconds",
"timeRange": {
"min": 1504027457000,
"max": 1504027568000
},
"metric": {
"app": "kibana",
"field": "kibana_stats.process.memory.heap.size_limit",
"metricAgg": "max",
"label": "Heap Size Limit",
"title": "Memory Size",
"description": "Limit of memory usage before garbage collection.",
"units": "B",
"format": "0,0.0 b",
"hasCalculation": false,
"isDerivative": false
},
"data": [
[
1504027460000,
1501560832
],
[
1504027470000,
1501560832
],
[
1504027480000,
1501560832
],
[
1504027490000,
1501560832
],
[
1504027500000,
1501560832
],
[
1504027510000,
1501560832
],
[
1504027520000,
1501560832
],
[
1504027530000,
1501560832
],
[
1504027540000,
1501560832
]
]
},
{
"bucket_size": "10 seconds",
"timeRange": {
"min": 1504027457000,
"max": 1504027568000
},
"metric": {
"app": "kibana",
"field": "kibana_stats.process.memory.resident_set_size_in_bytes",
"metricAgg": "max",
"label": "Memory Size",
"title": "Memory Size",
"description": "Total heap used by Kibana running in Node.js.",
"units": "B",
"format": "0,0.0 b",
"hasCalculation": false,
"isDerivative": false
},
"data": [
[
1504027460000,
228552704
],
[
1504027470000,
231333888
],
[
1504027480000,
232230912
],
[
1504027490000,
229707776
],
[
1504027500000,
230150144
],
[
1504027510000,
230617088
],
[
1504027520000,
229924864
],
[
1504027530000,
230363136
],
[
1504027540000,
230227968
]
]
}
],
"kibana_response_times": [
{
"bucket_size": "10 seconds",
"timeRange": {
"min": 1504027457000,
"max": 1504027568000
},
"metric": {
"app": "kibana",
"field": "kibana_stats.response_times.max",
"metricAgg": "max",
"label": "Max",
"title": "Client Response Time",
"description": "Maximum response time for client requests to the Kibana instance.",
"units": "ms",
"format": "0.[00]",
"hasCalculation": false,
"isDerivative": false
},
"data": [
[
1504027460000,
2203
],
[
1504027470000,
2203
],
[
1504027480000,
2203
],
[
1504027490000,
2203
],
[
1504027500000,
2203
],
[
1504027510000,
2203
],
[
1504027520000,
2203
],
[
1504027530000,
2203
],
[
1504027540000,
2203
]
]
},
{
"bucket_size": "10 seconds",
"timeRange": {
"min": 1504027457000,
"max": 1504027568000
},
"metric": {
"app": "kibana",
"field": "kibana_stats.response_times.average",
"metricAgg": "max",
"label": "Average",
"title": "Client Response Time",
"description": "Average response time for client requests to the Kibana instance.",
"units": "ms",
"format": "0.[00]",
"hasCalculation": false,
"isDerivative": false
},
"data": [
[
1504027460000,
171.05714416503906
],
[
1504027470000,
171.05714416503906
],
[
1504027480000,
171.05714416503906
],
[
1504027490000,
171.05714416503906
],
[
1504027500000,
171.05714416503906
],
[
1504027510000,
171.05714416503906
],
[
1504027520000,
171.05714416503906
],
[
1504027530000,
171.05714416503906
],
[
1504027540000,
171.05714416503906
]
]
}
],
"kibana_requests": [
{
"bucket_size": "10 seconds",
"timeRange": {
"min": 1504027457000,
"max": 1504027568000
},
"metric": {
"app": "kibana",
"field": "kibana_stats.requests.total",
"metricAgg": "max",
"label": "Client Requests",
"description": "Total number of client requests received by the Kibana instance.",
"units": "",
"format": "0.[00]",
"hasCalculation": false,
"isDerivative": false
},
"data": [
[
1504027460000,
113
],
[
1504027470000,
146
],
[
1504027480000,
162
],
[
1504027490000,
164
],
[
1504027500000,
166
],
[
1504027510000,
168
],
[
1504027520000,
170
],
[
1504027530000,
172
],
[
1504027540000,
174
]
]
}
]
},
"kibanaSummary": {
"uuid": "de3b8f2a-7bb9-4931-9bf3-997ba7824cf9",
"name": "tsullivan.local",
"index": ".kibana",
"host": "tsullivan.local",
"transport_address": "tsullivan.local:5601",
"version": "7.0.0-alpha1",
"snapshot": false,
"status": "green",
"availability": false,
"os_memory_free": 1645989888,
"uptime": 200102
}
}

View file

@ -0,0 +1,44 @@
{
"clusterStatus": {
"uuids": [
"de3b8f2a-7bb9-4931-9bf3-997ba7824cf9"
],
"status": "green",
"requests_total": 174,
"concurrent_connections": 174,
"response_time_max": 2203,
"memory_size": 230227968,
"memory_limit": 1501560832,
"count": 1
},
"kibanas": [
{
"process": {
"memory": {
"resident_set_size_in_bytes": 230227968
}
},
"os": {
"load": {
"1m": 3.19091796875
}
},
"response_times": {
"average": 171.05714285714285,
"max": 2203
},
"requests": {
"total": 174
},
"concurrent_connections": 174,
"kibana": {
"transport_address": "tsullivan.local:5601",
"name": "tsullivan.local",
"host": "tsullivan.local",
"uuid": "de3b8f2a-7bb9-4931-9bf3-997ba7824cf9",
"status": "green"
},
"availability": false
}
]
}

View file

@ -7,6 +7,8 @@
export default function ({ loadTestFile }) {
describe('Kibana', () => {
loadTestFile(require.resolve('./overview'));
loadTestFile(require.resolve('./listing'));
loadTestFile(require.resolve('./instance'));
});
}

View file

@ -0,0 +1,39 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import expect from 'expect.js';
import instanceFixture from './fixtures/instance';
export default function ({ getService }) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
describe('instance detail', () => {
const archive = 'monitoring/singlecluster-yellow-platinum';
const timeRange = {
min: '2017-08-29T17:24:17.000Z',
max: '2017-08-29T17:26:08.000Z'
};
before('load archive', () => {
return esArchiver.load(archive);
});
after('unload archive', () => {
return esArchiver.unload(archive);
});
it('should summarize single kibana instance with metrics', async () => {
const { body } = await supertest
.post('/api/monitoring/v1/clusters/DFDDUmKHR0Ge0mkdYW2bew/kibana/de3b8f2a-7bb9-4931-9bf3-997ba7824cf9')
.set('kbn-xsrf', 'xxx')
.send({ timeRange })
.expect(200);
expect(body).to.eql(instanceFixture);
});
});
}

View file

@ -0,0 +1,39 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import expect from 'expect.js';
import listingFixture from './fixtures/listing';
export default function ({ getService }) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
describe('listing', () => {
const archive = 'monitoring/singlecluster-yellow-platinum';
const timeRange = {
min: '2017-08-29T17:24:17.000Z',
max: '2017-08-29T17:26:08.000Z'
};
before('load archive', () => {
return esArchiver.load(archive);
});
after('unload archive', () => {
return esArchiver.unload(archive);
});
it('should summarize list of kibana instances with stats', async () => {
const { body } = await supertest
.post('/api/monitoring/v1/clusters/DFDDUmKHR0Ge0mkdYW2bew/kibana/instances')
.set('kbn-xsrf', 'xxx')
.send({ timeRange })
.expect(200);
expect(body).to.eql(listingFixture);
});
});
}

View file

@ -26,7 +26,7 @@ export default function ({ getService }) {
return esArchiver.unload(archive);
});
it('should summarize single kibana instance with metrics', async () => {
it('should summarize kibana instances with stats', async () => {
const { body } = await supertest
.post('/api/monitoring/v1/clusters/DFDDUmKHR0Ge0mkdYW2bew/kibana')
.set('kbn-xsrf', 'xxx')

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,98 @@
{
"clusterStatus": {
"node_count": 2,
"events_in_total": 120439,
"events_out_total": 114557,
"avg_memory": 2075918336,
"avg_memory_used": 595127568,
"max_uptime": 502472,
"pipeline_count": 4,
"queue_types": {
"memory": 4,
"persisted": 0
},
"versions": [
"7.0.0-alpha1"
]
},
"nodes": [
{
"jvm": {
"mem": {
"heap_used_percent": 24
}
},
"logstash": {
"pipeline": {
"batch_size": 125,
"workers": 8
},
"http_address": "127.0.0.1:9601",
"name": "Shaunaks-MacBook-Pro.local",
"host": "Shaunaks-MacBook-Pro.local",
"uuid": "838a2ada-1951-4043-8a23-4b450f6160a4",
"version": "7.0.0-alpha1",
"status": "green"
},
"process": {
"cpu": {
"percent": 0
}
},
"os": {
"cpu": {
"load_average": {
"1m": 4.30224609375
}
}
},
"events": {
"out": 75125
},
"reloads": {
"failures": 0,
"successes": 0
},
"availability": false
},
{
"jvm": {
"mem": {
"heap_used_percent": 33
}
},
"logstash": {
"pipeline": {
"batch_size": 125,
"workers": 8
},
"http_address": "127.0.0.1:9600",
"name": "Shaunaks-MacBook-Pro.local",
"host": "Shaunaks-MacBook-Pro.local",
"uuid": "29a3dfa6-c146-4534-9bc0-be475d2ce950",
"version": "7.0.0-alpha1",
"status": "green"
},
"process": {
"cpu": {
"percent": 2
}
},
"os": {
"cpu": {
"load_average": {
"1m": 4.416015625
}
}
},
"events": {
"out": 39432
},
"reloads": {
"failures": 0,
"successes": 0
},
"availability": false
}
]
}

View file

@ -7,6 +7,8 @@
export default function ({ loadTestFile }) {
describe('Logstash', () => {
loadTestFile(require.resolve('./overview'));
loadTestFile(require.resolve('./nodes'));
loadTestFile(require.resolve('./node_detail'));
});
}

View file

@ -0,0 +1,50 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import expect from 'expect.js';
import nodeDetailFixture from './fixtures/node_detail';
import nodeDetailAdvancedFixture from './fixtures/node_detail_advanced';
export default function ({ getService }) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
describe('node detail', () => {
const archive = 'monitoring/logstash-pipelines';
const timeRange = {
min: '2018-01-22T09:33:13.000Z',
max: '2018-01-22T09:41:04.000Z'
};
before('load archive', () => {
return esArchiver.load(archive);
});
after('unload archive', () => {
return esArchiver.unload(archive);
});
it('should summarize the Logstash node with non-advanced chart data metrics', async () => {
const { body } = await supertest
.post('/api/monitoring/v1/clusters/1rhApLfQShSh3JsNqYCkmA/logstash/node/838a2ada-1951-4043-8a23-4b450f6160a4')
.set('kbn-xsrf', 'xxx')
.send({ timeRange, is_advanced: false })
.expect(200);
expect(body).to.eql(nodeDetailFixture);
});
it('should summarize the Logstash node with advanced chart data metrics', async () => {
const { body } = await supertest
.post('/api/monitoring/v1/clusters/1rhApLfQShSh3JsNqYCkmA/logstash/node/838a2ada-1951-4043-8a23-4b450f6160a4')
.set('kbn-xsrf', 'xxx')
.send({ timeRange, is_advanced: true })
.expect(200);
expect(body).to.eql(nodeDetailAdvancedFixture);
});
});
}

View file

@ -0,0 +1,39 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import expect from 'expect.js';
import nodesFixture from './fixtures/nodes';
export default function ({ getService }) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
describe('node listing', () => {
const archive = 'monitoring/logstash-pipelines';
const timeRange = {
min: '2018-01-22T09:33:13.000Z',
max: '2018-01-22T09:41:04.000Z'
};
before('load archive', () => {
return esArchiver.load(archive);
});
after('unload archive', () => {
return esArchiver.unload(archive);
});
it('should summarize the Logstash nodes with stats', async () => {
const { body } = await supertest
.post('/api/monitoring/v1/clusters/1rhApLfQShSh3JsNqYCkmA/logstash/nodes')
.set('kbn-xsrf', 'xxx')
.send({ timeRange })
.expect(200);
expect(body).to.eql(nodesFixture);
});
});
}