forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Monitoring] De-duplicate pipeline ids based on the ephemeral_id chan…
…ging (elastic#49978) (elastic#50672) * De-duplicate pipeline ids based on the ephemeral_id changing * Add tests
- Loading branch information
1 parent
500b40e
commit f2e71f4
Showing
6 changed files
with
1,662 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
x-pack/test/api_integration/apis/monitoring/logstash/fixtures/pipelines.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"pipelines":[{"id":"eight","metrics":{"throughput":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.pipelines.events.out","label":"Pipeline Throughput","description":"Number of events emitted per second by the Logstash pipeline at the outputs stage.","units":"e/s","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,0],[1572882260000,0],[1572882270000,0]]},"nodesCount":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.logstash.uuid","label":"Pipeline Node Count","description":"Number of nodes on which the Logstash pipeline is running.","units":"","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,1],[1572882260000,1],[1572882270000,1]]}},"latestThroughput":0,"latestNodesCount":1},{"id":"eighteen","metrics":{"throughput":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.pipelines.events.out","label":"Pipeline Throughput","description":"Number of events emitted per second by the Logstash pipeline at the outputs stage.","units":"e/s","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,0],[1572882260000,0],[1572882270000,0]]},"nodesCount":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.logstash.uuid","label":"Pipeline Node Count","description":"Number of nodes on which the Logstash pipeline is running.","units":"","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,1],[1572882260000,1],[1572882270000,1]]}},"latestThroughput":0,"latestNodesCount":1},{"id":"eleven","metrics":{"throughput":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.pipelines.events.out","label":"Pipeline Throughput","description":"Number of events emitted per second by the Logstash pipeline at the outputs stage.","units":"e/s","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,0],[1572882260000,0],[1572882270000,0]]},"nodesCount":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.logstash.uuid","label":"Pipeline Node Count","description":"Number of nodes on which the Logstash pipeline is running.","units":"","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,1],[1572882260000,1],[1572882270000,1]]}},"latestThroughput":0,"latestNodesCount":1},{"id":"fifteen","metrics":{"throughput":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.pipelines.events.out","label":"Pipeline Throughput","description":"Number of events emitted per second by the Logstash pipeline at the outputs stage.","units":"e/s","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,0],[1572882260000,0],[1572882270000,0]]},"nodesCount":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.logstash.uuid","label":"Pipeline Node Count","description":"Number of nodes on which the Logstash pipeline is running.","units":"","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,1],[1572882260000,1],[1572882270000,1]]}},"latestThroughput":0,"latestNodesCount":1},{"id":"five","metrics":{"throughput":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.pipelines.events.out","label":"Pipeline Throughput","description":"Number of events emitted per second by the Logstash pipeline at the outputs stage.","units":"e/s","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,0],[1572882260000,0],[1572882270000,0]]},"nodesCount":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.logstash.uuid","label":"Pipeline Node Count","description":"Number of nodes on which the Logstash pipeline is running.","units":"","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,1],[1572882260000,1],[1572882270000,1]]}},"latestThroughput":0,"latestNodesCount":1},{"id":"four","metrics":{"throughput":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.pipelines.events.out","label":"Pipeline Throughput","description":"Number of events emitted per second by the Logstash pipeline at the outputs stage.","units":"e/s","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,0],[1572882260000,0],[1572882270000,0]]},"nodesCount":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.logstash.uuid","label":"Pipeline Node Count","description":"Number of nodes on which the Logstash pipeline is running.","units":"","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,1],[1572882260000,1],[1572882270000,1]]}},"latestThroughput":0,"latestNodesCount":1},{"id":"fourteen","metrics":{"throughput":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.pipelines.events.out","label":"Pipeline Throughput","description":"Number of events emitted per second by the Logstash pipeline at the outputs stage.","units":"e/s","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,0],[1572882260000,0],[1572882270000,0]]},"nodesCount":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.logstash.uuid","label":"Pipeline Node Count","description":"Number of nodes on which the Logstash pipeline is running.","units":"","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,1],[1572882260000,1],[1572882270000,1]]}},"latestThroughput":0,"latestNodesCount":1},{"id":"nine","metrics":{"throughput":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.pipelines.events.out","label":"Pipeline Throughput","description":"Number of events emitted per second by the Logstash pipeline at the outputs stage.","units":"e/s","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,0],[1572882260000,0],[1572882270000,0]]},"nodesCount":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.logstash.uuid","label":"Pipeline Node Count","description":"Number of nodes on which the Logstash pipeline is running.","units":"","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,1],[1572882260000,1],[1572882270000,1]]}},"latestThroughput":0,"latestNodesCount":1},{"id":"nineteen","metrics":{"throughput":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.pipelines.events.out","label":"Pipeline Throughput","description":"Number of events emitted per second by the Logstash pipeline at the outputs stage.","units":"e/s","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,0],[1572882260000,0],[1572882270000,0]]},"nodesCount":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.logstash.uuid","label":"Pipeline Node Count","description":"Number of nodes on which the Logstash pipeline is running.","units":"","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,1],[1572882260000,1],[1572882270000,1]]}},"latestThroughput":0,"latestNodesCount":1},{"id":"one","metrics":{"throughput":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.pipelines.events.out","label":"Pipeline Throughput","description":"Number of events emitted per second by the Logstash pipeline at the outputs stage.","units":"e/s","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,0],[1572882260000,0],[1572882270000,0]]},"nodesCount":{"bucket_size":"10 seconds","timeRange":{"min":1572882044855,"max":1572882638667},"metric":{"app":"logstash","field":"logstash_stats.logstash.uuid","label":"Pipeline Node Count","description":"Number of nodes on which the Logstash pipeline is running.","units":"","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1572882220000,1],[1572882260000,1],[1572882270000,1]]}},"latestThroughput":0,"latestNodesCount":1}],"clusterStatus":{"node_count":1,"events_in_total":312,"events_out_total":234,"avg_memory":1037959168,"avg_memory_used":205063840,"max_uptime":40598,"pipeline_count":26,"queue_types":{"memory":26,"persisted":0},"versions":["8.0.0"]},"totalPipelineCount":26} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
x-pack/test/api_integration/apis/monitoring/logstash/pipelines.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* 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 '@kbn/expect'; | ||
import pipelinesFixture from './fixtures/pipelines'; | ||
|
||
export default function ({ getService }) { | ||
const supertest = getService('supertest'); | ||
const esArchiver = getService('esArchiver'); | ||
|
||
describe('pipelines', () => { | ||
const archive = 'monitoring/logstash/changing_pipelines'; | ||
const timeRange = { | ||
min: '2019-11-04T15:40:44.855Z', | ||
max: '2019-11-04T15:50:38.667Z' | ||
}; | ||
const pagination = { | ||
size: 10, | ||
index: 0 | ||
}; | ||
const sort = { | ||
field: 'id', | ||
direction: 'asc' | ||
}; | ||
|
||
before('load archive', () => { | ||
return esArchiver.load(archive); | ||
}); | ||
|
||
after('unload archive', () => { | ||
return esArchiver.unload(archive); | ||
}); | ||
|
||
it('should return paginated pipelines', async () => { | ||
const { body } = await supertest | ||
.post('/api/monitoring/v1/clusters/TUjQLdHNTh2SB9Wy0gOtWg/logstash/pipelines') | ||
.set('kbn-xsrf', 'xxx') | ||
.send({ timeRange, pagination, sort }) | ||
.expect(200); | ||
|
||
expect(body).to.eql(pipelinesFixture); | ||
}); | ||
|
||
it('should get one of each after enough pagination', async () => { | ||
async function getIds(page) { | ||
const { body } = await supertest | ||
.post('/api/monitoring/v1/clusters/TUjQLdHNTh2SB9Wy0gOtWg/logstash/pipelines') | ||
.set('kbn-xsrf', 'xxx') | ||
.send({ timeRange, pagination: { ...pagination, index: page }, sort }) | ||
.expect(200); | ||
|
||
return body.pipelines.map(pipeline => pipeline.id); | ||
} | ||
|
||
const ids = [ | ||
...await getIds(0), | ||
...await getIds(1), | ||
...await getIds(2), | ||
]; | ||
expect(ids.length).to.be(26); | ||
}); | ||
}); | ||
} |
Binary file added
BIN
+113 KB
x-pack/test/functional/es_archives/monitoring/logstash/changing_pipelines/data.json.gz
Binary file not shown.
Oops, something went wrong.