Fix issue with no logstash monitoring data in the top end of the time series (#61273)
This commit is contained in:
parent
72406f3d5c
commit
6c8cc4cf74
|
@ -118,6 +118,9 @@ async function getPaginatedThroughputData(pipelines, req, lsIndexPattern, throug
|
|||
for (const pipeline of pipelines) {
|
||||
if (pipelineAggregationData.id === pipeline.id) {
|
||||
const dataSeries = get(pipelineAggregationData, `metrics.${throughputMetric}.data`, [[]]);
|
||||
if (dataSeries.length === 0) {
|
||||
continue;
|
||||
}
|
||||
pipeline[throughputMetric] = dataSeries.pop()[1];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,5 +58,27 @@ export default function({ getService }) {
|
|||
const ids = [...(await getIds(0)), ...(await getIds(1)), ...(await getIds(2))];
|
||||
expect(ids.length).to.be(26);
|
||||
});
|
||||
|
||||
it('should not error out if there is missing data for part of the time series', async () => {
|
||||
const customTimeRange = {
|
||||
...timeRange,
|
||||
max: '2019-11-04T15:59:38.667Z',
|
||||
};
|
||||
|
||||
const customSort = {
|
||||
...sort,
|
||||
field: 'logstash_cluster_pipeline_throughput',
|
||||
};
|
||||
|
||||
await supertest
|
||||
.post('/api/monitoring/v1/clusters/TUjQLdHNTh2SB9Wy0gOtWg/logstash/pipelines')
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.send({
|
||||
timeRange: customTimeRange,
|
||||
pagination: { ...pagination, index: 1 },
|
||||
sort: customSort,
|
||||
})
|
||||
.expect(200);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue