Skip to content

Commit

Permalink
Merge branch 'master' into api-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankHassanabad committed Nov 13, 2019
2 parents b16e661 + cf435b8 commit 936e50b
Show file tree
Hide file tree
Showing 9 changed files with 1,645 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/plugins/newsfeed/public/lib/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -631,10 +631,7 @@ describe('getApi', () => {
.mockImplementationOnce(getHttpMockWithItems(successItems));

getApi(httpMock, configMock.newsfeed, '6.8.2')
.pipe(
take(4),
toArray()
)
.pipe(take(4), toArray())
.subscribe(result => {
expect(result).toMatchInlineSnapshot(`
Array [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function logstashClusterPipelinesRoute(server) {
}

const { pageOfPipelines, totalPipelineCount } =
await getPaginatedPipelines(req, lsIndexPattern, {}, metricSet, pagination, sort, queryText);
await getPaginatedPipelines(req, lsIndexPattern, { clusterUuid }, metricSet, pagination, sort, queryText);

// Just the IDs for the rest
const pipelineIds = pageOfPipelines.map(pipeline => pipeline.id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@

import { EVENTS_VIEWER_FIELDS_BUTTON, KQL_SEARCH_BAR } from './selectors';
import { FIELDS_BROWSER_CONTAINER } from '../fields_browser/selectors';
import { SERVER_SIDE_EVENT_COUNT } from '../timeline/selectors';
import { DEFAULT_TIMEOUT } from '../util/helpers';

/** Opens the eventsViewer Field Browser */
export const openEventsViewerFieldsBrowser = () => {
cy.get(EVENTS_VIEWER_FIELDS_BUTTON, { timeout: DEFAULT_TIMEOUT }).click({ force: true });

cy.get(SERVER_SIDE_EVENT_COUNT, { timeout: DEFAULT_TIMEOUT })
.invoke('text')
.should('not.equal', '0');

cy.get(FIELDS_BROWSER_CONTAINER).should('exist');
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export const EVENTS_VIEWER_PANEL = '[data-test-subj="events-viewer-panel"]';
export const EVENTS_VIEWER_FIELDS_BUTTON = `${EVENTS_VIEWER_PANEL} [data-test-subj="show-field-browser-gear"]`;

/** The KQL search bar that exists at the top of most pages */
export const KQL_SEARCH_BAR = '[data-test-subj="kqlInput"]';
export const KQL_SEARCH_BAR = '[data-test-subj="queryInput"]';

/** The Events Viewer Showing N events header subtitle */
export const HEADER_SUBTITLE = `${EVENTS_VIEWER_PANEL} [data-test-subj="subtitle"]`;
export const HEADER_SUBTITLE = `${EVENTS_VIEWER_PANEL} [data-test-subj="header-panel-subtitle"]`;

/** The inspect query modal */
export const INSPECT_MODAL = '[data-test-subj="modal-inspect-euiModal"]';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"pipelines":[{"id":"uno","metrics":{"throughput":{"bucket_size":"10 seconds","timeRange":{"min":1573485225266,"max":1573485425399},"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":[[1573485230000,0]]},"nodesCount":{"bucket_size":"10 seconds","timeRange":{"min":1573485225266,"max":1573485425399},"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":[[1573485230000,1]]}},"latestThroughput":0,"latestNodesCount":1}],"clusterStatus":{"node_count":1,"events_in_total":0,"events_out_total":0,"avg_memory":1037959168,"avg_memory_used":203687512,"max_uptime":863288,"pipeline_count":1,"queue_types":{"memory":1,"persisted":0},"versions":["8.0.0"]},"totalPipelineCount":1}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default function ({ loadTestFile }) {
loadTestFile(require.resolve('./overview'));
loadTestFile(require.resolve('./nodes'));
loadTestFile(require.resolve('./node_detail'));
loadTestFile(require.resolve('./multicluster_pipelines'));
});
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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 fixture from './fixtures/multicluster_pipelines';

export default function ({ getService }) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');

describe('pipelines listing multicluster', () => {
const archive = 'monitoring/logstash_pipelines_multicluster';
const timeRange = {
min: '2019-11-11T15:13:45.266Z',
max: '2019-11-11T15:17:05.399Z'
};
const pagination = {
size: 10,
index: 0
};

before('load archive', () => {
return esArchiver.load(archive);
});

after('unload archive', () => {
return esArchiver.unload(archive);
});

it('should get the pipelines', async () => {
const { body } = await supertest
.post('/api/monitoring/v1/clusters/hJS0FZ7wR9GGdYs8RNW8pw/logstash/pipelines')
.set('kbn-xsrf', 'xxx')
.send({ timeRange, pagination })
.expect(200);

expect(body).to.eql(fixture);
});
});
}
Binary file not shown.
Loading

0 comments on commit 936e50b

Please sign in to comment.