diff --git a/src/core_plugins/console/api_server/server.js b/src/core_plugins/console/api_server/server.js index 6697dbe4d37a7..913d27c98dbad 100644 --- a/src/core_plugins/console/api_server/server.js +++ b/src/core_plugins/console/api_server/server.js @@ -19,13 +19,17 @@ import _ from 'lodash'; +const KNOWN_APIS = ['es_6_0']; + export function resolveApi(senseVersion, apis, reply) { const result = {}; _.each(apis, function (name) { { - // for now we ignore sense_version. might add it in the api name later - const api = require('./' + name); - result[name] = api.asJson(); + if (KNOWN_APIS.includes(name)) { + // for now we ignore sense_version. might add it in the api name later + const api = require('./' + name); + result[name] = api.asJson(); + } } }); diff --git a/src/core_plugins/console/api_server/server.test.js b/src/core_plugins/console/api_server/server.test.js new file mode 100644 index 0000000000000..cf61246471031 --- /dev/null +++ b/src/core_plugins/console/api_server/server.test.js @@ -0,0 +1,51 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { resolveApi } from './server'; + +describe('resolveApi', () => { + it('allows known APIs to be resolved', () => { + const mockReply = jest.fn((result) => ({ type: () => result })); + const result = resolveApi('Sense Version', ['es_6_0'], mockReply); + expect(result).toMatchObject({ + es_6_0: { + endpoints: expect.any(Object), + globals: expect.any(Object), + name: expect.any(String), + } + }); + }); + + it('does not resolve APIs that are not known', () => { + const mockReply = jest.fn((result) => ({ type: () => result })); + const result = resolveApi('Sense Version', ['unknown'], mockReply); + expect(result).toEqual({}); + }); + + it('handles request for apis that are known and unknown', () => { + const mockReply = jest.fn((result) => ({ type: () => result })); + const result = resolveApi('Sense Version', ['es_6_0'], mockReply); + expect(result).toMatchObject({ + es_6_0: { + endpoints: expect.any(Object), + globals: expect.any(Object), + name: expect.any(String), + } + }); + }); +}); \ No newline at end of file diff --git a/src/core_plugins/kibana/public/dashboard/dashboard_app.html b/src/core_plugins/kibana/public/dashboard/dashboard_app.html index 66a2f65e47173..cc020f33e3dba 100644 --- a/src/core_plugins/kibana/public/dashboard/dashboard_app.html +++ b/src/core_plugins/kibana/public/dashboard/dashboard_app.html @@ -28,10 +28,9 @@ - + > diff --git a/src/core_plugins/kibana/public/dashboard/dashboard_app.js b/src/core_plugins/kibana/public/dashboard/dashboard_app.js index 58cad9edd5440..b69fab6c43635 100644 --- a/src/core_plugins/kibana/public/dashboard/dashboard_app.js +++ b/src/core_plugins/kibana/public/dashboard/dashboard_app.js @@ -63,7 +63,6 @@ const app = uiModules.get('app/dashboard', [ 'react', 'kibana/courier', 'kibana/config', - 'kibana/typeahead', ]); app.directive('dashboardViewportProvider', function (reactDirective) { diff --git a/src/core_plugins/kibana/public/discover/index.html b/src/core_plugins/kibana/public/discover/index.html index 7a6fdbdbbff23..4735b852a96e0 100644 --- a/src/core_plugins/kibana/public/discover/index.html +++ b/src/core_plugins/kibana/public/discover/index.html @@ -26,11 +26,10 @@

- + >
diff --git a/src/core_plugins/kibana/public/index.scss b/src/core_plugins/kibana/public/index.scss index a7b2b0b3ce534..390694b0a52c2 100644 --- a/src/core_plugins/kibana/public/index.scss +++ b/src/core_plugins/kibana/public/index.scss @@ -1,5 +1,7 @@ @import 'ui/public/styles/styling_constants'; +@import 'ui/public/query_bar/index'; + // Context styles @import './context/index'; diff --git a/src/core_plugins/kibana/public/visualize/editor/editor.html b/src/core_plugins/kibana/public/visualize/editor/editor.html index cc05d1c48ff3e..c73805e4eb678 100644 --- a/src/core_plugins/kibana/public/visualize/editor/editor.html +++ b/src/core_plugins/kibana/public/visualize/editor/editor.html @@ -40,11 +40,10 @@ - + > diff --git a/src/core_plugins/vega/public/_vega_editor.scss b/src/core_plugins/vega/public/_vega_editor.scss index 93199b4a7580e..94ba9a9c6bc43 100644 --- a/src/core_plugins/vega/public/_vega_editor.scss +++ b/src/core_plugins/vega/public/_vega_editor.scss @@ -1,6 +1,8 @@ .visEditor--vega { .visEditorSidebar__config { padding: 0; + // Makes sure the vega options dropdown menu is visible + overflow: inherit; } // The following is necessary for the Vega editor to expand to full height of the editor panel diff --git a/src/ui/public/agg_types/buckets/_terms_other_bucket_helper.js b/src/ui/public/agg_types/buckets/_terms_other_bucket_helper.js index 2840da808b752..7e2d4070189d4 100644 --- a/src/ui/public/agg_types/buckets/_terms_other_bucket_helper.js +++ b/src/ui/public/agg_types/buckets/_terms_other_bucket_helper.js @@ -112,6 +112,8 @@ const buildOtherBucketAgg = (aggConfigs, aggWithOtherBucket, response) => { const filterAgg = aggConfigs.createAggConfig({ type: 'filters', id: 'other', + }, { + addToAggConfigs: false, }); // nest all the child aggregations of aggWithOtherBucket @@ -129,8 +131,8 @@ const buildOtherBucketAgg = (aggConfigs, aggWithOtherBucket, response) => { if (aggIndex < index) { _.each(agg.buckets, (bucket, bucketObjKey) => { const bucketKey = currentAgg.getKey(bucket, Number.isInteger(bucketObjKey) ? null : bucketObjKey); - const filter = _.cloneDeep(bucket.filter) || currentAgg.createFilter(bucketKey); - const newFilters = [...filters, filter]; + const filter = _.cloneDeep(bucket.filters) || currentAgg.createFilter(bucketKey); + const newFilters = _.flatten([...filters, filter]); walkBucketTree(newAggIndex, bucket, newAgg.id, newFilters, `${key}-${bucketKey.toString()}`); }); return; diff --git a/src/ui/public/autocomplete_providers/index.d.ts b/src/ui/public/autocomplete_providers/index.d.ts index 4f18ca62d29de..9c252bb05e52b 100644 --- a/src/ui/public/autocomplete_providers/index.d.ts +++ b/src/ui/public/autocomplete_providers/index.d.ts @@ -28,7 +28,7 @@ export type AutocompleteProvider = ( get(configKey: string): any; }; indexPatterns: StaticIndexPattern[]; - boolFilter: any; + boolFilter?: any; } ) => GetSuggestions; @@ -40,10 +40,15 @@ export type GetSuggestions = ( } ) => Promise; -export type AutocompleteSuggestionType = 'field' | 'value' | 'operator' | 'conjunction'; +export type AutocompleteSuggestionType = + | 'field' + | 'value' + | 'operator' + | 'conjunction' + | 'recentSearch'; export interface AutocompleteSuggestion { - description: string; + description?: string; end: number; start: number; text: string; diff --git a/src/ui/public/autoload/modules.js b/src/ui/public/autoload/modules.js index e4058ec22a427..107be2145995c 100644 --- a/src/ui/public/autoload/modules.js +++ b/src/ui/public/autoload/modules.js @@ -47,10 +47,10 @@ import '../style_compile'; import '../timefilter'; import '../timepicker'; import '../tooltip'; -import '../typeahead'; import '../url'; import '../validate_date_interval'; import '../watch_multi'; import '../courier/saved_object/ui/saved_object_save_as_checkbox'; import '../react_components'; import '../i18n'; +import '../query_bar/directive'; diff --git a/src/ui/public/directives/__tests__/parse_query.js b/src/ui/public/directives/__tests__/parse_query.js index b3c24cc9deb8b..3239bbceae248 100644 --- a/src/ui/public/directives/__tests__/parse_query.js +++ b/src/ui/public/directives/__tests__/parse_query.js @@ -25,26 +25,23 @@ import ngMock from 'ng_mock'; let $rootScope; let $compile; -let Private; let config; let $elemScope; let $elem; let cycleIndex = 0; const markup = ''; -let fromUser; import { toUser } from '../../parse_query/lib/to_user'; -import '../../parse_query'; -import { ParseQueryLibFromUserProvider } from '../../parse_query/lib/from_user'; +import '../../parse_query/index'; +import { fromUser } from '../../parse_query/lib/from_user'; const init = function () { // Load the application ngMock.module('kibana'); // Create the scope - ngMock.inject(function ($injector, _$rootScope_, _$compile_, _$timeout_, _Private_, _config_) { + ngMock.inject(function ($injector, _$rootScope_, _$compile_, _$timeout_, _config_) { $compile = _$compile_; - Private = _Private_; config = _config_; // Give us a scope @@ -77,7 +74,6 @@ describe('parse-query directive', function () { describe('user input parser', function () { beforeEach(function () { - fromUser = Private(ParseQueryLibFromUserProvider); config.set('query:queryString:options', {}); }); diff --git a/src/ui/public/documentation_links/documentation_links.js b/src/ui/public/documentation_links/documentation_links.ts similarity index 93% rename from src/ui/public/documentation_links/documentation_links.js rename to src/ui/public/documentation_links/documentation_links.ts index 484a48a5765bd..7eb91d2f3be83 100644 --- a/src/ui/public/documentation_links/documentation_links.js +++ b/src/ui/public/documentation_links/documentation_links.ts @@ -29,16 +29,15 @@ export const documentationLinks = { installation: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/filebeat-installation.html`, configuration: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/filebeat-configuration.html`, elasticsearchOutput: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/elasticsearch-output.html`, - elasticsearchOutputAnchorParameters: - `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/elasticsearch-output.html#_parameters`, + elasticsearchOutputAnchorParameters: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/elasticsearch-output.html#_parameters`, startup: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/filebeat-starting.html`, - exportedFields: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/exported-fields.html` + exportedFields: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/exported-fields.html`, }, metricbeat: { - base: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}` + base: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}`, }, logstash: { - base: `${ELASTIC_WEBSITE_URL}guide/en/logstash/${DOC_LINK_VERSION}` + base: `${ELASTIC_WEBSITE_URL}guide/en/logstash/${DOC_LINK_VERSION}`, }, aggs: { date_histogram: `${ELASTIC_DOCS}search-aggregations-bucket-datehistogram-aggregation.html`, @@ -78,19 +77,18 @@ export const documentationLinks = { painless: `${ELASTIC_DOCS}modules-scripting-painless.html`, painlessApi: `${ELASTIC_DOCS}modules-scripting-painless.html#painless-api`, painlessSyntax: `${ELASTIC_DOCS}modules-scripting-painless-syntax.html`, - luceneExpressions: `${ELASTIC_DOCS}modules-scripting-expression.html` + luceneExpressions: `${ELASTIC_DOCS}modules-scripting-expression.html`, }, indexPatterns: { loadingData: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/tutorial-load-dataset.html`, introduction: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/index-patterns.html`, }, query: { - luceneQuerySyntax: - `${ELASTIC_DOCS}query-dsl-query-string-query.html#query-string-syntax`, + luceneQuerySyntax: `${ELASTIC_DOCS}query-dsl-query-string-query.html#query-string-syntax`, queryDsl: `${ELASTIC_DOCS}query-dsl.html`, kueryQuerySyntax: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kuery-query.html`, }, date: { - dateMath: `${ELASTIC_DOCS}common-options.html#date-math` + dateMath: `${ELASTIC_DOCS}common-options.html#date-math`, }, }; diff --git a/src/ui/public/filter_bar/push_filters.js b/src/ui/public/filter_bar/push_filters.js new file mode 100644 index 0000000000000..cce206c922b7b --- /dev/null +++ b/src/ui/public/filter_bar/push_filters.js @@ -0,0 +1,29 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import _ from 'lodash'; + +export function FilterBarPushFiltersProvider() { + return function ($state) { + if (!_.isObject($state)) throw new Error('pushFilters requires a state object'); + return function (filters) { + $state.$newFilters = filters; + }; + }; +} diff --git a/src/ui/public/index_patterns/static_utils/index.d.ts b/src/ui/public/index_patterns/static_utils/index.d.ts new file mode 100644 index 0000000000000..6d387bb95882f --- /dev/null +++ b/src/ui/public/index_patterns/static_utils/index.d.ts @@ -0,0 +1,29 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { StaticIndexPattern } from 'ui/index_patterns'; + +interface SavedObject { + attributes: { + fields: string; + title: string; + }; +} + +export function getFromLegacyIndexPattern(indexPatterns: any[]): StaticIndexPattern[]; diff --git a/src/ui/public/index_patterns/static_utils/index.js b/src/ui/public/index_patterns/static_utils/index.js index 09ff813bd6737..2cf43c319b10a 100644 --- a/src/ui/public/index_patterns/static_utils/index.js +++ b/src/ui/public/index_patterns/static_utils/index.js @@ -19,9 +19,7 @@ import { KBN_FIELD_TYPES } from '../../../../utils/kbn_field_types'; -const filterableTypes = KBN_FIELD_TYPES.filter(type => type.filterable).map( - type => type.name -); +const filterableTypes = KBN_FIELD_TYPES.filter(type => type.filterable).map(type => type.name); export function isFilterable(field) { return filterableTypes.includes(field.type); diff --git a/src/ui/public/metadata.d.ts b/src/ui/public/metadata.d.ts new file mode 100644 index 0000000000000..d604838bd046b --- /dev/null +++ b/src/ui/public/metadata.d.ts @@ -0,0 +1,27 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +declare class Metadata { + public branch: string; + public version: string; +} + +declare const metadata: Metadata; + +export { metadata }; diff --git a/src/ui/public/parse_query/index.ts b/src/ui/public/parse_query/index.ts new file mode 100644 index 0000000000000..75c311e9e6f05 --- /dev/null +++ b/src/ui/public/parse_query/index.ts @@ -0,0 +1,23 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import './parse_query'; + +export * from './lib/from_user'; +export * from './lib/to_user'; diff --git a/src/ui/public/parse_query/lib/from_user.js b/src/ui/public/parse_query/lib/from_user.ts similarity index 64% rename from src/ui/public/parse_query/lib/from_user.js rename to src/ui/public/parse_query/lib/from_user.ts index 46d6ca96bcc80..bd2cb08667a07 100644 --- a/src/ui/public/parse_query/lib/from_user.js +++ b/src/ui/public/parse_query/lib/from_user.ts @@ -19,27 +19,29 @@ import _ from 'lodash'; -export function ParseQueryLibFromUserProvider() { +/** + * Take userInput from the user and make it into a query object + * @returns {object} + * @param userInput + */ - /** - * Take userInput from the user and make it into a query object - * @param {userInput} user's query input - * @returns {object} - */ - return function (userInput) { - const matchAll = ''; +export function fromUser(userInput: object | string) { + const matchAll = ''; - if (_.isObject(userInput)) { - // If we get an empty object, treat it as a * - if (!Object.keys(userInput).length) { - return matchAll; - } - return userInput; + if (_.isObject(userInput)) { + // If we get an empty object, treat it as a * + if (!Object.keys(userInput).length) { + return matchAll; } + return userInput; + } - // Nope, not an object. - userInput = (userInput || '').trim(); - if (userInput.length === 0) return matchAll; + userInput = userInput || ''; + if (typeof userInput === 'string') { + userInput = userInput.trim(); + if (userInput.length === 0) { + return matchAll; + } if (userInput[0] === '{') { try { @@ -50,6 +52,5 @@ export function ParseQueryLibFromUserProvider() { } else { return userInput; } - }; + } } - diff --git a/src/ui/public/parse_query/lib/to_user.js b/src/ui/public/parse_query/lib/to_user.ts similarity index 71% rename from src/ui/public/parse_query/lib/to_user.js rename to src/ui/public/parse_query/lib/to_user.ts index a6bea74b9e0aa..dfae965d64344 100644 --- a/src/ui/public/parse_query/lib/to_user.js +++ b/src/ui/public/parse_query/lib/to_user.ts @@ -17,7 +17,6 @@ * under the License. */ -import _ from 'lodash'; import angular from 'angular'; /** @@ -25,12 +24,27 @@ import angular from 'angular'; * @param {text} model value * @returns {string} */ -export function toUser(text) { - if (text == null) return ''; - if (_.isObject(text)) { - if (text.match_all) return ''; - if (text.query_string) return toUser(text.query_string.query); +export function toUser(text: ToUserQuery | string): string { + if (text == null) { + return ''; + } + if (typeof text === 'object') { + if (text.match_all) { + return ''; + } + if (text.query_string) { + return toUser(text.query_string.query); + } return angular.toJson(text); } return '' + text; } + +interface ToUserQuery { + match_all: object; + query_string: ToUserQueryString; +} + +interface ToUserQueryString { + query: string; +} diff --git a/src/ui/public/parse_query/parse_query.js b/src/ui/public/parse_query/parse_query.js index 2c8252f9dc9a0..4b3f9d24f72de 100644 --- a/src/ui/public/parse_query/parse_query.js +++ b/src/ui/public/parse_query/parse_query.js @@ -18,13 +18,12 @@ */ import { toUser } from './lib/to_user'; -import { ParseQueryLibFromUserProvider } from './lib/from_user'; +import { fromUser } from './lib/from_user'; import { uiModules } from '../modules'; uiModules .get('kibana') - .directive('parseQuery', function (Private) { - const fromUser = Private(ParseQueryLibFromUserProvider); + .directive('parseQuery', function () { return { restrict: 'A', diff --git a/src/ui/public/persisted_log/directive.js b/src/ui/public/persisted_log/directive.js new file mode 100644 index 0000000000000..29f2f93093aeb --- /dev/null +++ b/src/ui/public/persisted_log/directive.js @@ -0,0 +1,26 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { uiModules } from '../modules'; +import { PersistedLog } from './persisted_log'; + +uiModules.get('kibana/persisted_log') + .factory('PersistedLog', function () { + return PersistedLog; + }); diff --git a/src/ui/public/persisted_log/index.d.ts b/src/ui/public/persisted_log/index.d.ts new file mode 100644 index 0000000000000..8d22b28c7d3ec --- /dev/null +++ b/src/ui/public/persisted_log/index.d.ts @@ -0,0 +1,20 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export { PersistedLog } from './persisted_log'; diff --git a/src/ui/public/persisted_log/index.js b/src/ui/public/persisted_log/index.js index bb2ffadbd11c6..3d8bec771dc74 100644 --- a/src/ui/public/persisted_log/index.js +++ b/src/ui/public/persisted_log/index.js @@ -17,7 +17,7 @@ * under the License. */ -import './persisted_log'; +import './directive'; export { PersistedLog } from './persisted_log'; export { recentlyAccessed } from './recently_accessed'; diff --git a/src/ui/public/persisted_log/persisted_log.test.js b/src/ui/public/persisted_log/persisted_log.test.ts similarity index 52% rename from src/ui/public/persisted_log/persisted_log.test.js rename to src/ui/public/persisted_log/persisted_log.test.ts index ee9c26d573573..e0bc8f2c3525f 100644 --- a/src/ui/public/persisted_log/persisted_log.test.js +++ b/src/ui/public/persisted_log/persisted_log.test.ts @@ -17,14 +17,28 @@ * under the License. */ +import { PersistedLog } from './persisted_log'; + +const createMockWebStorage = () => ({ + clear: jest.fn(), + getItem: jest.fn(), + key: jest.fn(), + removeItem: jest.fn(), + setItem: jest.fn(), + length: 0, +}); -import sinon from 'sinon'; -import expect from 'expect.js'; -import { PersistedLog } from './'; +const createMockStorage = () => ({ + store: createMockWebStorage(), + get: jest.fn(), + set: jest.fn(), + remove: jest.fn(), + clear: jest.fn(), +}); jest.mock('ui/chrome', () => { return { - getBasePath: () => `/some/base/path` + getBasePath: () => `/some/base/path`, }; }); @@ -33,107 +47,102 @@ const historyLimit = 10; const payload = [ { first: 'clark', last: 'kent' }, { first: 'peter', last: 'parker' }, - { first: 'bruce', last: 'wayne' } + { first: 'bruce', last: 'wayne' }, ]; -describe('PersistedLog', function () { - - let storage; - beforeEach(function () { - storage = { - get: sinon.stub(), - set: sinon.stub(), - remove: sinon.spy(), - clear: sinon.spy() - }; +describe('PersistedLog', () => { + let storage = createMockStorage(); + beforeEach(() => { + storage = createMockStorage(); }); - describe('expected API', function () { - test('has expected methods', function () { - const log = new PersistedLog(historyName); + describe('expected API', () => { + test('has expected methods', () => { + const log = new PersistedLog(historyName, {}, storage); - expect(log.add).to.be.a('function'); - expect(log.get).to.be.a('function'); + expect(typeof log.add).toBe('function'); + expect(typeof log.get).toBe('function'); }); }); - describe('internal functionality', function () { - test('reads from storage', function () { - new PersistedLog(historyName, {}, storage); + describe('internal functionality', () => { + test('reads from storage', () => { + // @ts-ignore + const log = new PersistedLog(historyName, {}, storage); - expect(storage.get.calledOnce).to.be(true); - expect(storage.get.calledWith(historyName)).to.be(true); + expect(storage.get).toHaveBeenCalledTimes(1); + expect(storage.get).toHaveBeenCalledWith(historyName); }); - test('writes to storage', function () { + test('writes to storage', () => { const log = new PersistedLog(historyName, {}, storage); const newItem = { first: 'diana', last: 'prince' }; const data = log.add(newItem); - expect(storage.set.calledOnce).to.be(true); - expect(data).to.eql([newItem]); + expect(storage.set).toHaveBeenCalledTimes(1); + expect(data).toEqual([newItem]); }); }); - describe('persisting data', function () { - test('fetches records from storage', function () { - storage.get.returns(payload); + describe('persisting data', () => { + test('fetches records from storage', () => { + storage.get.mockReturnValue(payload); const log = new PersistedLog(historyName, {}, storage); const items = log.get(); - expect(items.length).to.equal(3); - expect(items).to.eql(payload); + expect(items.length).toBe(3); + expect(items).toEqual(payload); }); - test('prepends new records', function () { - storage.get.returns(payload.slice(0)); + test('prepends new records', () => { + storage.get.mockReturnValue(payload.slice(0)); const log = new PersistedLog(historyName, {}, storage); const newItem = { first: 'selina', last: 'kyle' }; const items = log.add(newItem); - expect(items.length).to.equal(payload.length + 1); - expect(items[0]).to.eql(newItem); + expect(items.length).toBe(payload.length + 1); + expect(items[0]).toEqual(newItem); }); }); - describe('stack options', function () { - test('should observe the maxLength option', function () { + describe('stack options', () => { + test('should observe the maxLength option', () => { const bulkData = []; for (let i = 0; i < historyLimit; i++) { bulkData.push(['record ' + i]); } - storage.get.returns(bulkData); + storage.get.mockReturnValue(bulkData); const log = new PersistedLog(historyName, { maxLength: historyLimit }, storage); log.add(['new array 1']); const items = log.add(['new array 2']); - expect(items.length).to.equal(historyLimit); + expect(items.length).toBe(historyLimit); }); - test('should observe the filterDuplicates option', function () { - storage.get.returns(payload.slice(0)); + test('should observe the filterDuplicates option', () => { + storage.get.mockReturnValue(payload.slice(0)); const log = new PersistedLog(historyName, { filterDuplicates: true }, storage); const newItem = payload[1]; const items = log.add(newItem); - expect(items.length).to.equal(payload.length); + expect(items.length).toBe(payload.length); }); test('should truncate the list upon initialization if too long', () => { - storage.get.returns(payload.slice(0)); + storage.get.mockReturnValue(payload.slice(0)); const log = new PersistedLog(historyName, { maxLength: 1 }, storage); const items = log.get(); - expect(items.length).to.equal(1); + expect(items.length).toBe(1); }); test('should allow a maxLength of 0', () => { - storage.get.returns(payload.slice(0)); + storage.get.mockReturnValue(payload.slice(0)); const log = new PersistedLog(historyName, { maxLength: 0 }, storage); const items = log.get(); - expect(items.length).to.equal(0); + expect(items.length).toBe(0); }); }); }); diff --git a/src/ui/public/persisted_log/persisted_log.js b/src/ui/public/persisted_log/persisted_log.ts similarity index 61% rename from src/ui/public/persisted_log/persisted_log.js rename to src/ui/public/persisted_log/persisted_log.ts index 01ad38b815b2c..eee1d4b9a03ec 100644 --- a/src/ui/public/persisted_log/persisted_log.js +++ b/src/ui/public/persisted_log/persisted_log.ts @@ -17,35 +17,46 @@ * under the License. */ -import { uiModules } from '../modules'; import _ from 'lodash'; -import { Storage } from '../storage'; +import { Storage } from 'ui/storage'; const localStorage = new Storage(window.localStorage); -const defaultIsDuplicate = (oldItem, newItem) => { +const defaultIsDuplicate = (oldItem: string, newItem: string) => { return _.isEqual(oldItem, newItem); }; export class PersistedLog { - constructor(name, options = {}, storage = localStorage) { + public name: string; + public maxLength?: number; + public filterDuplicates?: boolean; + public isDuplicate: (oldItem: any, newItem: any) => boolean; + public storage: Storage; + public items: any[]; + + constructor(name: string, options: PersistedLogOptions = {}, storage = localStorage) { this.name = name; - this.maxLength = parseInt(options.maxLength, 10); + this.maxLength = + typeof options.maxLength === 'string' + ? (this.maxLength = parseInt(options.maxLength, 10)) + : options.maxLength; this.filterDuplicates = options.filterDuplicates || false; this.isDuplicate = options.isDuplicate || defaultIsDuplicate; this.storage = storage; this.items = this.storage.get(this.name) || []; - if (!isNaN(this.maxLength)) this.items = _.take(this.items, this.maxLength); + if (this.maxLength !== undefined && !isNaN(this.maxLength)) { + this.items = _.take(this.items, this.maxLength); + } } - add(val) { + public add(val: any) { if (val == null) { return this.items; } // remove any matching items from the stack if option is set if (this.filterDuplicates) { - _.remove(this.items, (item) => { + _.remove(this.items, item => { return this.isDuplicate(item, val); }); } @@ -53,19 +64,22 @@ export class PersistedLog { this.items.unshift(val); // if maxLength is set, truncate the stack - if (!isNaN(this.maxLength)) this.items = _.take(this.items, this.maxLength); + if (this.maxLength && !isNaN(this.maxLength)) { + this.items = _.take(this.items, this.maxLength); + } // persist the stack this.storage.set(this.name, this.items); return this.items; } - get() { + public get() { return _.cloneDeep(this.items); } } -uiModules.get('kibana/persisted_log') - .factory('PersistedLog', function () { - return PersistedLog; - }); +interface PersistedLogOptions { + maxLength?: number | string; + filterDuplicates?: boolean; + isDuplicate?: (oldItem: string, newItem: string) => boolean; +} diff --git a/src/ui/public/query_bar/_index.scss b/src/ui/public/query_bar/_index.scss new file mode 100644 index 0000000000000..81a69fd89db99 --- /dev/null +++ b/src/ui/public/query_bar/_index.scss @@ -0,0 +1,4 @@ +// SASSTODO: Formalize this color in Kibana's styling constants +$typeaheadConjunctionColor: #7800A6; + +@import 'components/typeahead/index'; \ No newline at end of file diff --git a/src/ui/public/query_bar/components/__snapshots__/language_switcher.test.tsx.snap b/src/ui/public/query_bar/components/__snapshots__/language_switcher.test.tsx.snap new file mode 100644 index 0000000000000..d0c5fd332de2c --- /dev/null +++ b/src/ui/public/query_bar/components/__snapshots__/language_switcher.test.tsx.snap @@ -0,0 +1,189 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`LanguageSwitcher should toggle off if language is lucene 1`] = ` + + Options + + } + closePopover={[Function]} + hasArrow={true} + id="popover" + isOpen={false} + ownFocus={true} + panelPaddingSize="m" + withTitle={true} +> + + Syntax options + +
+ +

+ Our experimental autocomplete and simple syntax features can help you create your queries. Just start typing and you’ll see matches related to your data. See docs + + + here + + . +

+
+ + + + + + + + +

+ Not ready yet? Find our lucene docs + + + here + + . +

+
+
+
+`; + +exports[`LanguageSwitcher should toggle on if language is kuery 1`] = ` + + Options + + } + closePopover={[Function]} + hasArrow={true} + id="popover" + isOpen={false} + ownFocus={true} + panelPaddingSize="m" + withTitle={true} +> + + Syntax options + +
+ +

+ Our experimental autocomplete and simple syntax features can help you create your queries. Just start typing and you’ll see matches related to your data. See docs + + + here + + . +

+
+ + + + + + + + +

+ Not ready yet? Find our lucene docs + + + here + + . +

+
+
+
+`; diff --git a/src/ui/public/query_bar/components/__snapshots__/query_bar.test.tsx.snap b/src/ui/public/query_bar/components/__snapshots__/query_bar.test.tsx.snap new file mode 100644 index 0000000000000..dd74731f5817b --- /dev/null +++ b/src/ui/public/query_bar/components/__snapshots__/query_bar.test.tsx.snap @@ -0,0 +1,217 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`QueryBar Should disable autoFocus on EuiFieldText when disableAutoFocus prop is true 1`] = ` + +
+
+
+
+ +
+ +
+
+
+
+ +
+
+`; + +exports[`QueryBar Should pass the query language to the language switcher 1`] = ` + +
+
+
+
+ +
+ +
+
+
+
+ +
+
+`; + +exports[`QueryBar Should render the given query 1`] = ` + +
+
+
+
+ +
+ +
+
+
+
+ +
+
+`; diff --git a/src/ui/public/query_bar/index.js b/src/ui/public/query_bar/components/index.ts similarity index 95% rename from src/ui/public/query_bar/index.js rename to src/ui/public/query_bar/components/index.ts index 23566906b6487..ed4266589478e 100644 --- a/src/ui/public/query_bar/index.js +++ b/src/ui/public/query_bar/components/index.ts @@ -17,4 +17,4 @@ * under the License. */ -import './directive/query_bar'; +export { QueryBar } from './query_bar'; diff --git a/src/ui/public/query_bar/components/language_switcher.test.tsx b/src/ui/public/query_bar/components/language_switcher.test.tsx new file mode 100644 index 0000000000000..1bc43920f4cc6 --- /dev/null +++ b/src/ui/public/query_bar/components/language_switcher.test.tsx @@ -0,0 +1,65 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +jest.mock('../../metadata', () => ({ + metadata: { + branch: 'foo', + }, +})); + +import { shallow } from 'enzyme'; +import React from 'react'; +import { QueryLanguageSwitcher } from './language_switcher'; + +describe('LanguageSwitcher', () => { + it('should toggle off if language is lucene', () => { + const component = shallow( + { + return; + }} + /> + ); + + expect(component).toMatchSnapshot(); + }); + + it('should toggle on if language is kuery', () => { + const component = shallow( + { + return; + }} + /> + ); + + expect(component).toMatchSnapshot(); + }); + + it('call onSelectLanguage when the toggle is clicked', () => { + const callback = jest.fn(); + const component = shallow( + + ); + component.find('[data-test-subj="languageToggle"]').simulate('change'); + expect(callback).toHaveBeenCalledTimes(1); + }); +}); diff --git a/src/ui/public/query_bar/components/language_switcher.tsx b/src/ui/public/query_bar/components/language_switcher.tsx new file mode 100644 index 0000000000000..5c5283520424a --- /dev/null +++ b/src/ui/public/query_bar/components/language_switcher.tsx @@ -0,0 +1,137 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +declare module '@elastic/eui' { + export const EuiPopoverTitle: React.SFC; +} + +import { + EuiButtonEmpty, + EuiForm, + EuiFormRow, + EuiHorizontalRule, + EuiLink, + EuiPopover, + EuiPopoverTitle, + EuiSpacer, + EuiSwitch, + EuiText, +} from '@elastic/eui'; +import React, { Component } from 'react'; +import { documentationLinks } from '../../documentation_links/documentation_links'; + +const luceneQuerySyntaxDocs = documentationLinks.query.luceneQuerySyntax; +const kueryQuerySyntaxDocs = documentationLinks.query.kueryQuerySyntax; + +interface State { + isPopoverOpen: boolean; +} + +interface Props { + language: string; + onSelectLanguage: (newLanguage: string) => void; +} + +export class QueryLanguageSwitcher extends Component { + public state = { + isPopoverOpen: false, + }; + + public render() { + const button = ( + + Options + + ); + + return ( + + Syntax options +
+ +

+ Our experimental autocomplete and simple syntax features can help you create your + queries. Just start typing and you’ll see matches related to your data. See docs{' '} + { + + here + + } + . +

+
+ + + + + + + + + + + + +

+ Not ready yet? Find our lucene docs{' '} + { + + here + + } + . +

+
+
+
+ ); + } + + private togglePopover = () => { + this.setState({ + isPopoverOpen: !this.state.isPopoverOpen, + }); + }; + + private closePopover = () => { + this.setState({ + isPopoverOpen: false, + }); + }; + + private onSwitchChange = () => { + const newLanguage = this.props.language === 'lucene' ? 'kuery' : 'lucene'; + this.props.onSelectLanguage(newLanguage); + }; +} diff --git a/src/ui/public/query_bar/components/query_bar.test.tsx b/src/ui/public/query_bar/components/query_bar.test.tsx new file mode 100644 index 0000000000000..7309cc13a1b23 --- /dev/null +++ b/src/ui/public/query_bar/components/query_bar.test.tsx @@ -0,0 +1,276 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +const mockChromeFactory = jest.fn(() => { + return { + getBasePath: () => `foo`, + getUiSettingsClient: () => { + return { + get: (key: string) => { + switch (key) { + case 'history:limit': + return 10; + default: + throw new Error(`Unexpected config key: ${key}`); + } + }, + }; + }, + }; +}); + +const mockPersistedLog = { + add: jest.fn(), + get: jest.fn(() => ['response:200']), +}; + +const mockPersistedLogFactory = jest.fn(() => { + return mockPersistedLog; +}); + +const mockGetAutocompleteSuggestions = jest.fn(() => Promise.resolve([])); +const mockAutocompleteProvider = jest.fn(() => mockGetAutocompleteSuggestions); +const mockGetAutocompleteProvider = jest.fn(() => mockAutocompleteProvider); + +jest.mock('ui/chrome', () => mockChromeFactory()); +jest.mock('../../chrome', () => mockChromeFactory()); +jest.mock('ui/persisted_log', () => ({ + PersistedLog: mockPersistedLogFactory, +})); +jest.mock('../../metadata', () => ({ + metadata: { + branch: 'foo', + }, +})); +jest.mock('../../autocomplete_providers', () => ({ + getAutocompleteProvider: mockGetAutocompleteProvider, +})); + +import _ from 'lodash'; +// Using doMock to avoid hoisting so that I can override only the debounce method in lodash +jest.doMock('lodash', () => ({ + ..._, + debounce: (func: () => any) => func, +})); + +import { EuiFieldText } from '@elastic/eui'; +import { mount, shallow } from 'enzyme'; +import React from 'react'; +import { QueryBar } from 'ui/query_bar'; +import { QueryLanguageSwitcher } from 'ui/query_bar/components/language_switcher'; + +const noop = () => { + return; +}; + +const kqlQuery = { + query: 'response:200', + language: 'kuery', +}; + +const luceneQuery = { + query: 'response:200', + language: 'lucene', +}; + +const createMockWebStorage = () => ({ + clear: jest.fn(), + getItem: jest.fn(), + key: jest.fn(), + removeItem: jest.fn(), + setItem: jest.fn(), + length: 0, +}); + +const createMockStorage = () => ({ + store: createMockWebStorage(), + get: jest.fn(), + set: jest.fn(), + remove: jest.fn(), + clear: jest.fn(), +}); + +const mockIndexPattern = { + title: 'logstash-*', + fields: { + raw: [ + { + name: 'response', + type: 'number', + aggregatable: true, + searchable: true, + }, + ], + }, +}; + +describe('QueryBar', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('Should render the given query', () => { + const component = shallow( + + ); + + expect(component).toMatchSnapshot(); + }); + + it('Should pass the query language to the language switcher', () => { + const component = shallow( + + ); + + expect(component).toMatchSnapshot(); + }); + + it('Should disable autoFocus on EuiFieldText when disableAutoFocus prop is true', () => { + const component = shallow( + + ); + + expect(component).toMatchSnapshot(); + }); + + it('Should create a unique PersistedLog based on the appName and query language', () => { + shallow( + + ); + + expect(mockPersistedLogFactory.mock.calls[0][0]).toBe('typeahead:discover-kuery'); + }); + + it("On language selection, should store the user's preference in localstorage and reset the query", () => { + const mockStorage = createMockStorage(); + const mockCallback = jest.fn(); + + const component = shallow( + + ); + + component.find(QueryLanguageSwitcher).simulate('selectLanguage', 'lucene'); + expect(mockStorage.set).toHaveBeenCalledWith('kibana.userQueryLanguage', 'lucene'); + expect(mockCallback).toHaveBeenCalledWith({ + query: '', + language: 'lucene', + }); + }); + + it('Should call onSubmit with the current query when the user hits enter inside the query bar', () => { + const mockCallback = jest.fn(); + + const component = mount( + + ); + + const instance = component.instance() as QueryBar; + const input = instance.inputRef; + const inputWrapper = component.find(EuiFieldText).find('input'); + inputWrapper.simulate('change', { target: { value: 'extension:jpg' } }); + inputWrapper.simulate('keyDown', { target: input, keyCode: 13, key: 'Enter', metaKey: true }); + + expect(mockCallback).toHaveBeenCalledTimes(1); + expect(mockCallback).toHaveBeenCalledWith({ + query: 'extension:jpg', + language: 'kuery', + }); + }); + + it('Should use PersistedLog for recent search suggestions', async () => { + const component = mount( + + ); + + const instance = component.instance() as QueryBar; + const input = instance.inputRef; + const inputWrapper = component.find(EuiFieldText).find('input'); + inputWrapper.simulate('change', { target: { value: 'extension:jpg' } }); + inputWrapper.simulate('keyDown', { target: input, keyCode: 13, key: 'Enter', metaKey: true }); + + expect(mockPersistedLog.add).toHaveBeenCalledWith('extension:jpg'); + + mockPersistedLog.get.mockClear(); + inputWrapper.simulate('change', { target: { value: 'extensi' } }); + expect(mockPersistedLog.get).toHaveBeenCalledTimes(1); + }); + + it('Should get suggestions from the autocomplete provider for the current language', () => { + mount( + + ); + + expect(mockGetAutocompleteProvider).toHaveBeenCalledWith('kuery'); + expect(mockGetAutocompleteSuggestions).toHaveBeenCalled(); + }); +}); diff --git a/src/ui/public/query_bar/components/query_bar.tsx b/src/ui/public/query_bar/components/query_bar.tsx new file mode 100644 index 0000000000000..bbffb5ab755f8 --- /dev/null +++ b/src/ui/public/query_bar/components/query_bar.tsx @@ -0,0 +1,502 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { IndexPattern } from 'ui/index_patterns'; + +declare module '@elastic/eui' { + export const EuiOutsideClickDetector: SFC; +} + +import { debounce } from 'lodash'; +import React, { Component, SFC } from 'react'; +import { getFromLegacyIndexPattern } from 'ui/index_patterns/static_utils'; +import { kfetch } from 'ui/kfetch'; +import { PersistedLog } from 'ui/persisted_log'; +import { Storage } from 'ui/storage'; +import { + AutocompleteSuggestion, + AutocompleteSuggestionType, + getAutocompleteProvider, +} from '../../autocomplete_providers'; +import chrome from '../../chrome'; +import { fromUser, toUser } from '../../parse_query'; +import { matchPairs } from '../lib/match_pairs'; +import { QueryLanguageSwitcher } from './language_switcher'; +import { SuggestionsComponent } from './typeahead/suggestions_component'; + +import { EuiFieldText, EuiOutsideClickDetector } from '@elastic/eui'; + +const KEY_CODES = { + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + ENTER: 13, + ESC: 27, + TAB: 9, + HOME: 36, + END: 35, +}; + +const config = chrome.getUiSettingsClient(); +const recentSearchType: AutocompleteSuggestionType = 'recentSearch'; + +interface Query { + query: string; + language: string; +} + +interface Props { + query: Query; + onSubmit: (query: { query: string | object; language: string }) => void; + disableAutoFocus?: boolean; + appName: string; + indexPatterns: IndexPattern[]; + store: Storage; +} + +interface State { + query: Query; + inputIsPristine: boolean; + isSuggestionsVisible: boolean; + index: number | null; + suggestions: AutocompleteSuggestion[]; + suggestionLimit: number; +} + +export class QueryBar extends Component { + public static getDerivedStateFromProps(nextProps: Props, prevState: State) { + if (nextProps.query.query !== prevState.query.query) { + return { + query: { + query: toUser(nextProps.query.query), + language: nextProps.query.language, + }, + }; + } else if (nextProps.query.language !== prevState.query.language) { + return { + query: { + query: '', + language: nextProps.query.language, + }, + }; + } + + return null; + } + + /* + Keep the "draft" value in local state until the user actually submits the query. There are a couple advantages: + + 1. Each app doesn't have to maintain its own "draft" value if it wants to put off updating the query in app state + until the user manually submits their changes. Most apps have watches on the query value in app state so we don't + want to trigger those on every keypress. Also, some apps (e.g. dashboard) already juggle multiple query values, + each with slightly different semantics and I'd rather not add yet another variable to the mix. + + 2. Changes to the local component state won't trigger an Angular digest cycle. Triggering digest cycles on every + keypress has been a major source of performance issues for us in previous implementations of the query bar. + See https://github.com/elastic/kibana/issues/14086 + */ + public state = { + query: { + query: toUser(this.props.query.query), + language: this.props.query.language, + }, + inputIsPristine: true, + isSuggestionsVisible: false, + index: null, + suggestions: [], + suggestionLimit: 50, + }; + + public updateSuggestions = debounce(async () => { + const suggestions = (await this.getSuggestions()) || []; + if (!this.componentIsUnmounting) { + this.setState({ suggestions }); + } + }, 100); + + public inputRef: HTMLInputElement | null = null; + + private componentIsUnmounting = false; + private persistedLog: PersistedLog | null = null; + + public increaseLimit = () => { + this.setState({ + suggestionLimit: this.state.suggestionLimit + 50, + }); + }; + + public incrementIndex = (currentIndex: number) => { + let nextIndex = currentIndex + 1; + if (currentIndex === null || nextIndex >= this.state.suggestions.length) { + nextIndex = 0; + } + this.setState({ index: nextIndex }); + }; + + public decrementIndex = (currentIndex: number) => { + const previousIndex = currentIndex - 1; + if (previousIndex < 0) { + this.setState({ index: this.state.suggestions.length - 1 }); + } else { + this.setState({ index: previousIndex }); + } + }; + + public getSuggestions = async () => { + if (!this.inputRef) { + return; + } + + const { + query: { query, language }, + } = this.state; + const recentSearchSuggestions = this.getRecentSearchSuggestions(query); + + const autocompleteProvider = getAutocompleteProvider(language); + if (!autocompleteProvider) { + return recentSearchSuggestions; + } + + const indexPatterns = getFromLegacyIndexPattern(this.props.indexPatterns); + const getAutocompleteSuggestions = autocompleteProvider({ config, indexPatterns }); + + const { selectionStart, selectionEnd } = this.inputRef; + if (selectionStart === null || selectionEnd === null) { + return; + } + + const suggestions: AutocompleteSuggestion[] = await getAutocompleteSuggestions({ + query, + selectionStart, + selectionEnd, + }); + return [...suggestions, ...recentSearchSuggestions]; + }; + + public selectSuggestion = ({ + type, + text, + start, + end, + }: { + type: AutocompleteSuggestionType; + text: string; + start: number; + end: number; + }) => { + if (!this.inputRef) { + return; + } + + const query = this.state.query.query; + const { selectionStart, selectionEnd } = this.inputRef; + if (selectionStart === null || selectionEnd === null) { + return; + } + + const value = query.substr(0, selectionStart) + query.substr(selectionEnd); + + this.setState( + { + query: { + ...this.state.query, + query: value.substr(0, start) + text + value.substr(end), + }, + index: null, + }, + () => { + if (!this.inputRef) { + return; + } + + this.inputRef.setSelectionRange(start + text.length, start + text.length); + + if (type === recentSearchType) { + this.onSubmit(); + } else { + this.updateSuggestions(); + } + } + ); + }; + + public getRecentSearchSuggestions = (query: string) => { + if (!this.persistedLog) { + return []; + } + const recentSearches = this.persistedLog.get(); + const matchingRecentSearches = recentSearches.filter(recentQuery => { + const recentQueryString = typeof recentQuery === 'object' ? toUser(recentQuery) : recentQuery; + return recentQueryString.includes(query); + }); + return matchingRecentSearches.map(recentSearch => { + const text = recentSearch; + const start = 0; + const end = query.length; + return { type: recentSearchType, text, start, end }; + }); + }; + + public onOutsideClick = () => { + this.setState({ isSuggestionsVisible: false, index: null }); + }; + + public onClickInput = (event: React.MouseEvent) => { + if (event.target instanceof HTMLInputElement) { + this.onInputChange(event.target.value); + } + }; + + public onClickSuggestion = (suggestion: AutocompleteSuggestion) => { + if (!this.inputRef) { + return; + } + this.selectSuggestion(suggestion); + this.inputRef.focus(); + }; + + public onMouseEnterSuggestion = (index: number) => { + this.setState({ index }); + }; + + public onInputChange = (value: string) => { + const hasValue = Boolean(value.trim()); + + this.setState({ + query: { + query: value, + language: this.state.query.language, + }, + inputIsPristine: false, + isSuggestionsVisible: hasValue, + index: null, + suggestionLimit: 50, + }); + }; + + public onChange = (event: React.ChangeEvent) => { + this.updateSuggestions(); + this.onInputChange(event.target.value); + }; + + public onKeyUp = (event: React.KeyboardEvent) => { + if ([KEY_CODES.LEFT, KEY_CODES.RIGHT, KEY_CODES.HOME, KEY_CODES.END].includes(event.keyCode)) { + this.setState({ isSuggestionsVisible: true }); + if (event.target instanceof HTMLInputElement) { + this.onInputChange(event.target.value); + } + } + }; + + public onKeyDown = (event: React.KeyboardEvent) => { + if (event.target instanceof HTMLInputElement) { + const { isSuggestionsVisible, index } = this.state; + const preventDefault = event.preventDefault.bind(event); + const { target, key, metaKey } = event; + const { value, selectionStart, selectionEnd } = target; + const updateQuery = (query: string, newSelectionStart: number, newSelectionEnd: number) => { + this.setState( + { + query: { + ...this.state.query, + query, + }, + }, + () => { + target.setSelectionRange(newSelectionStart, newSelectionEnd); + } + ); + }; + + switch (event.keyCode) { + case KEY_CODES.DOWN: + event.preventDefault(); + if (isSuggestionsVisible && index !== null) { + this.incrementIndex(index); + } else { + this.setState({ isSuggestionsVisible: true, index: 0 }); + } + break; + case KEY_CODES.UP: + event.preventDefault(); + if (isSuggestionsVisible && index !== null) { + this.decrementIndex(index); + } + break; + case KEY_CODES.ENTER: + event.preventDefault(); + if (isSuggestionsVisible && index !== null && this.state.suggestions[index]) { + this.selectSuggestion(this.state.suggestions[index]); + } else { + this.onSubmit(() => event.preventDefault()); + } + break; + case KEY_CODES.ESC: + event.preventDefault(); + this.setState({ isSuggestionsVisible: false, index: null }); + break; + case KEY_CODES.TAB: + this.setState({ isSuggestionsVisible: false, index: null }); + break; + default: + if (selectionStart !== null && selectionEnd !== null) { + matchPairs({ + value, + selectionStart, + selectionEnd, + key, + metaKey, + updateQuery, + preventDefault, + }); + } + + break; + } + } + }; + + public onSubmit = (preventDefault?: () => void) => { + if (preventDefault) { + preventDefault(); + } + + if (this.persistedLog) { + this.persistedLog.add(this.state.query.query); + } + + this.props.onSubmit({ + query: fromUser(this.state.query.query), + language: this.state.query.language, + }); + this.setState({ isSuggestionsVisible: false }); + }; + + public onSelectLanguage = (language: string) => { + // Send telemetry info every time the user opts in or out of kuery + // As a result it is important this function only ever gets called in the + // UI component's change handler. + kfetch({ + pathname: '/api/kibana/kql_opt_in_telemetry', + method: 'POST', + body: JSON.stringify({ opt_in: language === 'kuery' }), + }); + + this.props.store.set('kibana.userQueryLanguage', language); + this.props.onSubmit({ + query: '', + language, + }); + }; + + public componentDidMount() { + this.persistedLog = new PersistedLog( + `typeahead:${this.props.appName}-${this.state.query.language}`, + { + maxLength: config.get('history:limit'), + filterDuplicates: true, + } + ); + this.updateSuggestions(); + } + + public componentDidUpdate(prevProps: Props) { + if (prevProps.query.language !== this.props.query.language) { + this.persistedLog = new PersistedLog( + `typeahead:${this.props.appName}-${this.state.query.language}`, + { + maxLength: config.get('history:limit'), + filterDuplicates: true, + } + ); + this.updateSuggestions(); + } + } + + public componentWillUnmount() { + this.updateSuggestions.cancel(); + this.componentIsUnmounting = true; + } + + public render() { + return ( + + {/* position:relative required on container so the suggestions appear under the query bar*/} +
+
+
+
+ { + if (node) { + this.inputRef = node; + } + }} + autoComplete="off" + spellCheck={false} + icon="console" + aria-label="Search input" + type="text" + data-test-subj="queryInput" + aria-autocomplete="list" + aria-controls="typeahead-items" + aria-activedescendant={ + this.state.isSuggestionsVisible ? 'suggestion-' + this.state.index : '' + } + role="textbox" + /> +
+ +
+
+
+
+ + +
+
+ ); + } +} diff --git a/src/ui/public/query_bar/components/typeahead/__snapshots__/suggestion_component.test.tsx.snap b/src/ui/public/query_bar/components/typeahead/__snapshots__/suggestion_component.test.tsx.snap new file mode 100644 index 0000000000000..0e3ce952d69e2 --- /dev/null +++ b/src/ui/public/query_bar/components/typeahead/__snapshots__/suggestion_component.test.tsx.snap @@ -0,0 +1,73 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`SuggestionComponent Should display the suggestion and use the provided ariaId 1`] = ` +
+
+
+ +
+
+ as promised, not helpful +
+
+
+
+`; + +exports[`SuggestionComponent Should make the element active if the selected prop is true 1`] = ` +
+
+
+ +
+
+ as promised, not helpful +
+
+
+
+`; diff --git a/src/ui/public/query_bar/components/typeahead/__snapshots__/suggestions_component.test.tsx.snap b/src/ui/public/query_bar/components/typeahead/__snapshots__/suggestions_component.test.tsx.snap new file mode 100644 index 0000000000000..1b8fc29858c83 --- /dev/null +++ b/src/ui/public/query_bar/components/typeahead/__snapshots__/suggestions_component.test.tsx.snap @@ -0,0 +1,113 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`SuggestionsComponent Passing the index should control which suggestion is selected 1`] = ` +
+
+
+
+ + +
+
+
+
+`; + +exports[`SuggestionsComponent Should display given suggestions if the show prop is true 1`] = ` +
+
+
+
+ + +
+
+
+
+`; diff --git a/src/ui/public/query_bar/components/typeahead/_index.scss b/src/ui/public/query_bar/components/typeahead/_index.scss new file mode 100644 index 0000000000000..8ff2965158ad9 --- /dev/null +++ b/src/ui/public/query_bar/components/typeahead/_index.scss @@ -0,0 +1 @@ +@import 'suggestion'; \ No newline at end of file diff --git a/src/ui/public/query_bar/components/typeahead/_suggestion.scss b/src/ui/public/query_bar/components/typeahead/_suggestion.scss new file mode 100644 index 0000000000000..5fbb4a791ffcd --- /dev/null +++ b/src/ui/public/query_bar/components/typeahead/_suggestion.scss @@ -0,0 +1,195 @@ +.typeahead { + position: relative; + + .typeahead-popover { + @include euiBottomShadow($adjustBorders: true); + border: 1px solid; + border-color: $euiBorderColor; + color: $euiTextColor; + background-color: $euiColorEmptyShade; + position: absolute; + top: -10px; + z-index: $euiZContentMenu; + width: 100%; + border-radius: $euiBorderRadius; + + .typeahead-items { + max-height: 60vh; + overflow-y: auto; + } + + .typeahead-item { + height: $euiSizeXL; + white-space: nowrap; + font-size: $euiFontSizeXS; + vertical-align: middle; + padding: 0; + border-bottom: none; + line-height: normal; + } + + .typeahead-item:hover { + cursor: pointer; + } + + .typeahead-item:last-child { + border-bottom: 0px; + border-radius: 0 0 $euiBorderRadius $euiBorderRadius; + } + + .typeahead-item:first-child { + border-bottom: 0px; + border-radius: $euiBorderRadius $euiBorderRadius 0 0; + } + + .typeahead-item.active { + background-color: $euiColorLightestShade; + + + .suggestionItem__callout { + background: $euiColorEmptyShade; + } + + .suggestionItem__text { + color: $euiColorFullShade; + } + + .suggestionItem__type { + color: $euiColorFullShade; + } + + .suggestionItem--field { + .suggestionItem__type { + background-color: tint($euiColorWarning, 80%); + } + } + + .suggestionItem--value { + .suggestionItem__type { + background-color: tint($euiColorSecondary, 80%); + } + } + + .suggestionItem--operator { + .suggestionItem__type { + background-color: tint($euiColorPrimary, 80%); + } + } + + .suggestionItem--conjunction { + .suggestionItem__type { + background-color: tint($typeaheadConjunctionColor, 80%); + } + } + + } + } +} + +.inline-form .typeahead.visible .input-group { + > :first-child { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + } + > :last-child { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + } +} + +.suggestionItem { + display: flex; + align-items: stretch; + flex-grow: 1; + align-items: center; + font-size: $euiFontSizeXS; + white-space: nowrap; + &.suggestionItem--field { + .suggestionItem__type { + background-color: tint($euiColorWarning, 90%); + color: makeHighContrastColor($euiColorWarning, tint($euiColorWarning, 90%)); + } + } + + &.suggestionItem--value { + .suggestionItem__type { + background-color: tint($euiColorSecondary, 90%); + color: makeHighContrastColor($euiColorSecondary, tint($euiColorSecondary, 90%)); + } + + .suggestionItem__text { + width: auto; + } + } + + &.suggestionItem--operator { + .suggestionItem__type { + background-color: tint($euiColorPrimary, 90%); + color: makeHighContrastColor($euiColorPrimary, tint($euiColorSecondary, 90%)); + } + } + + &.suggestionItem--conjunction { + .suggestionItem__type { + background-color: tint($typeaheadConjunctionColor, 90%); + color: makeHighContrastColor($typeaheadConjunctionColor, tint($typeaheadConjunctionColor, 90%)); + } + } + + &.suggestionItem--recentSearch { + .suggestionItem__type { + background-color: $euiColorLightShade; + color: $euiColorMediumShade; + } + + .suggestionItem__text { + width: auto; + } + } +} + +.suggestionItem__text, .suggestionItem__type, .suggestionItem__description { + flex-grow: 1; + flex-basis: 0%; + display: flex; + flex-direction: column; +} + +.suggestionItem__type { + flex-grow: 0; + flex-basis: auto; + width: $euiSizeXL; + height: $euiSizeXL; + text-align: center; + overflow: hidden; + padding: $euiSizeXS; + justify-content: center; + align-items: center; +} + + +.suggestionItem__text { + flex-grow: 0; /* 2 */ + flex-basis: auto; /* 2 */ + font-family: $euiCodeFontFamily; + margin-right: $euiSizeXL; + width: 250px; + overflow: hidden; + text-overflow: ellipsis; + padding: $euiSizeXS $euiSizeS; + color: #111; +} + +.suggestionItem__description { + color: $euiColorDarkShade; + overflow: hidden; + text-overflow: ellipsis; +} + +.suggestionItem__callout { + font-family: $euiCodeFontFamily; + background: $euiColorLightestShade; + color: $euiColorFullShade; + padding: 0 $euiSizeXS; + display: inline-block; +} diff --git a/src/ui/public/query_bar/components/typeahead/suggestion_component.test.tsx b/src/ui/public/query_bar/components/typeahead/suggestion_component.test.tsx new file mode 100644 index 0000000000000..ee6eb994f32f4 --- /dev/null +++ b/src/ui/public/query_bar/components/typeahead/suggestion_component.test.tsx @@ -0,0 +1,122 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { mount, shallow } from 'enzyme'; +import React from 'react'; +import { AutocompleteSuggestion } from 'ui/autocomplete_providers'; +import { SuggestionComponent } from 'ui/query_bar/components/typeahead/suggestion_component'; + +const noop = () => { + return; +}; + +const mockSuggestion: AutocompleteSuggestion = { + description: 'This is not a helpful suggestion', + end: 0, + start: 42, + text: 'as promised, not helpful', + type: 'value', +}; + +describe('SuggestionComponent', () => { + it('Should display the suggestion and use the provided ariaId', () => { + const component = shallow( + + ); + + expect(component).toMatchSnapshot(); + }); + + it('Should make the element active if the selected prop is true', () => { + const component = shallow( + + ); + + expect(component).toMatchSnapshot(); + }); + + it('Should call innerRef with a reference to the root div element', () => { + const innerRefCallback = (ref: HTMLDivElement) => { + expect(ref.className).toBe('typeahead-item'); + expect(ref.id).toBe('suggestion-1'); + }; + + mount( + + ); + }); + + it('Should call onClick with the provided suggestion', () => { + const mockHandler = jest.fn(); + + const component = shallow( + + ); + + component.simulate('click'); + expect(mockHandler).toHaveBeenCalledTimes(1); + expect(mockHandler).toHaveBeenCalledWith(mockSuggestion); + }); + + it('Should call onMouseEnter when user mouses over the element', () => { + const mockHandler = jest.fn(); + + const component = shallow( + + ); + + component.simulate('mouseenter'); + expect(mockHandler).toHaveBeenCalledTimes(1); + }); +}); diff --git a/src/ui/public/query_bar/components/typeahead/suggestion_component.tsx b/src/ui/public/query_bar/components/typeahead/suggestion_component.tsx new file mode 100644 index 0000000000000..424afa2974773 --- /dev/null +++ b/src/ui/public/query_bar/components/typeahead/suggestion_component.tsx @@ -0,0 +1,80 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { EuiIcon } from '@elastic/eui'; +import classNames from 'classnames'; +import React, { SFC } from 'react'; +import { AutocompleteSuggestion } from 'ui/autocomplete_providers'; + +function getEuiIconType(type: string) { + switch (type) { + case 'field': + return 'kqlField'; + case 'value': + return 'kqlValue'; + case 'recentSearch': + return 'search'; + case 'conjunction': + return 'kqlSelector'; + case 'operator': + return 'kqlOperand'; + default: + throw new Error(`Unknown type: ${type}`); + } +} + +interface Props { + onClick: (suggestion: AutocompleteSuggestion) => void; + onMouseEnter: () => void; + selected: boolean; + suggestion: AutocompleteSuggestion; + innerRef: (node: HTMLDivElement) => void; + ariaId: string; +} + +export const SuggestionComponent: SFC = props => { + return ( +
props.onClick(props.suggestion)} + onMouseEnter={props.onMouseEnter} + ref={props.innerRef} + id={props.ariaId} + > +
+
+ +
+
{props.suggestion.text}
+
+
+
+ ); +}; diff --git a/src/ui/public/query_bar/components/typeahead/suggestions_component.test.tsx b/src/ui/public/query_bar/components/typeahead/suggestions_component.test.tsx new file mode 100644 index 0000000000000..910633a8c5afc --- /dev/null +++ b/src/ui/public/query_bar/components/typeahead/suggestions_component.test.tsx @@ -0,0 +1,150 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { mount, shallow } from 'enzyme'; +import React from 'react'; +import { AutocompleteSuggestion } from 'ui/autocomplete_providers'; +import { SuggestionComponent } from 'ui/query_bar/components/typeahead/suggestion_component'; +import { SuggestionsComponent } from 'ui/query_bar/components/typeahead/suggestions_component'; + +const noop = () => { + return; +}; + +const mockSuggestions: AutocompleteSuggestion[] = [ + { + description: 'This is not a helpful suggestion', + end: 0, + start: 42, + text: 'as promised, not helpful', + type: 'value', + }, + { + description: 'This is another unhelpful suggestion', + end: 0, + start: 42, + text: 'yep', + type: 'field', + }, +]; + +describe('SuggestionsComponent', () => { + it('Should not display anything if the show prop is false', () => { + const component = shallow( + + ); + + expect(component.isEmptyRender()).toBe(true); + }); + + it('Should not display anything if there are no suggestions', () => { + const component = shallow( + + ); + + expect(component.isEmptyRender()).toBe(true); + }); + + it('Should display given suggestions if the show prop is true', () => { + const component = shallow( + + ); + + expect(component.isEmptyRender()).toBe(false); + expect(component).toMatchSnapshot(); + }); + + it('Passing the index should control which suggestion is selected', () => { + const component = shallow( + + ); + + expect(component).toMatchSnapshot(); + }); + + it('Should call onClick with the selected suggestion when it is clicked', () => { + const mockCallback = jest.fn(); + const component = mount( + + ); + + component + .find(SuggestionComponent) + .at(1) + .simulate('click'); + expect(mockCallback).toHaveBeenCalledTimes(1); + expect(mockCallback).toHaveBeenCalledWith(mockSuggestions[1]); + }); + + it('Should call onMouseEnter with the index of the suggestion that was entered', () => { + const mockCallback = jest.fn(); + const component = mount( + + ); + + component + .find(SuggestionComponent) + .at(1) + .simulate('mouseenter'); + expect(mockCallback).toHaveBeenCalledTimes(1); + expect(mockCallback).toHaveBeenCalledWith(1); + }); +}); diff --git a/src/ui/public/query_bar/components/typeahead/suggestions_component.tsx b/src/ui/public/query_bar/components/typeahead/suggestions_component.tsx new file mode 100644 index 0000000000000..c4fb9a8de283c --- /dev/null +++ b/src/ui/public/query_bar/components/typeahead/suggestions_component.tsx @@ -0,0 +1,118 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { isEmpty } from 'lodash'; +import React, { Component } from 'react'; +import { AutocompleteSuggestion } from 'ui/autocomplete_providers'; +import { SuggestionComponent } from './suggestion_component'; + +interface Props { + index: number | null; + onClick: (suggestion: AutocompleteSuggestion) => void; + onMouseEnter: (index: number) => void; + show: boolean; + suggestions: AutocompleteSuggestion[]; + loadMore: () => void; +} + +export class SuggestionsComponent extends Component { + private childNodes: HTMLDivElement[] = []; + private parentNode: HTMLDivElement | null = null; + + public render() { + if (!this.props.show || isEmpty(this.props.suggestions)) { + return null; + } + + const suggestions = this.props.suggestions.map((suggestion, index) => { + return ( + (this.childNodes[index] = node)} + selected={index === this.props.index} + suggestion={suggestion} + onClick={this.props.onClick} + onMouseEnter={() => this.props.onMouseEnter(index)} + ariaId={'suggestion-' + index} + key={`${suggestion.type} - ${suggestion.text}`} + /> + ); + }); + + return ( +
+
+
+
(this.parentNode = node)} + onScroll={this.handleScroll} + > + {suggestions} +
+
+
+
+ ); + } + + public componentDidUpdate(prevProps: Props) { + if (prevProps.index !== this.props.index) { + this.scrollIntoView(); + } + } + + private scrollIntoView = () => { + if (this.props.index === null) { + return; + } + const parent = this.parentNode; + const child = this.childNodes[this.props.index]; + + if (this.props.index == null || !parent || !child) { + return; + } + + const scrollTop = Math.max( + Math.min(parent.scrollTop, child.offsetTop), + child.offsetTop + child.offsetHeight - parent.offsetHeight + ); + + parent.scrollTop = scrollTop; + }; + + private handleScroll = () => { + if (!this.props.loadMore || !this.parentNode) { + return; + } + + const position = this.parentNode.scrollTop + this.parentNode.offsetHeight; + const height = this.parentNode.scrollHeight; + const remaining = height - position; + const margin = 50; + + if (!height || !position) { + return; + } + if (remaining <= margin) { + this.props.loadMore(); + } + }; +} diff --git a/src/ui/public/query_bar/directive/__tests__/query_bar.js b/src/ui/public/query_bar/directive/__tests__/query_bar.js deleted file mode 100644 index 66f2b0c0207a0..0000000000000 --- a/src/ui/public/query_bar/directive/__tests__/query_bar.js +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import angular from 'angular'; -import sinon from 'sinon'; -import expect from 'expect.js'; -import ngMock from 'ng_mock'; -import { expectDeepEqual } from '../../../../../test_utils/expect_deep_equal.js'; - -let $parentScope; -let $elem; - -const markup = ``; -const cleanup = []; - -function init(query, name) { - ngMock.module('kibana'); - - ngMock.inject(function ($injector, $controller, $rootScope, $compile) { - $parentScope = $rootScope; - - $parentScope.submitHandler = sinon.stub(); - $parentScope.name = name; - $parentScope.query = query; - $elem = angular.element(markup); - angular.element('body').append($elem); - cleanup.push(() => $elem.remove()); - - $compile($elem)($parentScope); - $elem.scope().$digest(); - }); -} - - -describe('queryBar directive', function () { - afterEach(() => { - cleanup.forEach(fn => fn()); - cleanup.length = 0; - }); - - describe('query string input', function () { - - it('should reflect the query passed into the directive', function () { - init({ query: 'foo', language: 'lucene' }, 'discover'); - const queryInput = $elem.find('.kuiLocalSearchInput'); - expect(queryInput.val()).to.be('foo'); - }); - - it('changes to the input text should not modify the parent scope\'s query', function () { - init({ query: 'foo', language: 'lucene' }, 'discover'); - const queryInput = $elem.find('.kuiLocalSearchInput'); - queryInput.val('bar').trigger('input'); - - expect($elem.isolateScope().queryBar.localQuery.query).to.be('bar'); - expect($parentScope.query.query).to.be('foo'); - }); - - it('should not call onSubmit until the form is submitted', function () { - init({ query: 'foo', language: 'lucene' }, 'discover'); - const queryInput = $elem.find('.kuiLocalSearchInput'); - queryInput.val('bar').trigger('input'); - expect($parentScope.submitHandler.notCalled).to.be(true); - - const submitButton = $elem.find('.kuiLocalSearchButton'); - submitButton.click(); - expect($parentScope.submitHandler.called).to.be(true); - }); - - it('should call onSubmit with the current input text when the form is submitted', function () { - init({ query: 'foo', language: 'lucene' }, 'discover'); - const queryInput = $elem.find('.kuiLocalSearchInput'); - queryInput.val('bar').trigger('input'); - const submitButton = $elem.find('.kuiLocalSearchButton'); - submitButton.click(); - expectDeepEqual($parentScope.submitHandler.getCall(0).args[0], { query: 'bar', language: 'lucene' }); - }); - - }); - - describe('typeahead key', function () { - - it('should use a unique typeahead key for each appName/language combo', function () { - init({ query: 'foo', language: 'lucene' }, 'discover'); - expect($elem.isolateScope().queryBar.persistedLog.name).to.be('typeahead:discover-lucene'); - - $parentScope.query = { query: 'foo', language: 'kuery' }; - $parentScope.$digest(); - expect($elem.isolateScope().queryBar.persistedLog.name).to.be('typeahead:discover-kuery'); - }); - - }); - - -}); diff --git a/src/ui/public/query_bar/directive/index.js b/src/ui/public/query_bar/directive/index.js new file mode 100644 index 0000000000000..ed00cfd272a35 --- /dev/null +++ b/src/ui/public/query_bar/directive/index.js @@ -0,0 +1,37 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + + +import 'ngreact'; +import { uiModules } from '../../modules'; +import { QueryBar } from '../components'; + +const app = uiModules.get('app/kibana', ['react']); + +app.directive('queryBar', (reactDirective, localStorage) => { + return reactDirective( + QueryBar, + undefined, + {}, + { + store: localStorage, + } + ); +}); diff --git a/src/ui/public/query_bar/directive/query_bar.html b/src/ui/public/query_bar/directive/query_bar.html deleted file mode 100644 index e8205825ff53a..0000000000000 --- a/src/ui/public/query_bar/directive/query_bar.html +++ /dev/null @@ -1,83 +0,0 @@ -
- - - -
diff --git a/src/ui/public/query_bar/directive/query_bar.js b/src/ui/public/query_bar/directive/query_bar.js deleted file mode 100644 index 7179c1294afe6..0000000000000 --- a/src/ui/public/query_bar/directive/query_bar.js +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { compact } from 'lodash'; -import { uiModules } from '../../modules'; -import { callAfterBindingsWorkaround } from '../../compat'; -import template from './query_bar.html'; -import suggestionTemplate from './suggestion.html'; -import { getAutocompleteProvider } from '../../autocomplete_providers'; -import './suggestion.less'; -import '../../directives/match_pairs'; -import './query_popover'; -import { getFromLegacyIndexPattern } from '../../index_patterns/static_utils'; - -const module = uiModules.get('kibana'); - -module.directive('queryBar', function () { - - return { - restrict: 'E', - template: template, - scope: { - query: '=', - appName: '=?', - onSubmit: '&', - disableAutoFocus: '=', - indexPatterns: '=' - }, - controllerAs: 'queryBar', - bindToController: true, - - controller: callAfterBindingsWorkaround(function ($scope, $element, $http, $timeout, config, PersistedLog, indexPatterns, debounce) { - this.appName = this.appName || 'global'; - this.focusedTypeaheadItemID = ''; - - this.getIndexPatterns = () => { - if (compact(this.indexPatterns).length) return Promise.resolve(this.indexPatterns); - return Promise.all([indexPatterns.getDefault()]); - }; - - this.submit = () => { - if (this.localQuery.query) { - this.persistedLog.add(this.localQuery.query); - } - this.onSubmit({ $query: this.localQuery }); - this.suggestions = []; - }; - - this.selectLanguage = (language) => { - this.localQuery.language = language; - this.localQuery.query = ''; - this.submit(); - }; - - this.suggestionTemplate = suggestionTemplate; - - this.handleKeyDown = (event) => { - if (['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) { - this.updateSuggestions(); - } - }; - - this.updateSuggestions = debounce(async () => { - const suggestions = await this.getSuggestions(); - if (!this._isScopeDestroyed) { - $scope.$apply(() => this.suggestions = suggestions); - } - }, 100); - - this.getSuggestions = async () => { - const { localQuery: { query, language } } = this; - const recentSearchSuggestions = this.getRecentSearchSuggestions(query); - - const autocompleteProvider = getAutocompleteProvider(language); - if (!autocompleteProvider) return recentSearchSuggestions; - - const legacyIndexPatterns = await this.getIndexPatterns(); - const indexPatterns = getFromLegacyIndexPattern(legacyIndexPatterns); - const getAutocompleteSuggestions = autocompleteProvider({ config, indexPatterns }); - - const { selectionStart, selectionEnd } = $element.find('input')[0]; - const suggestions = await getAutocompleteSuggestions({ query, selectionStart, selectionEnd }); - return [...suggestions, ...recentSearchSuggestions]; - }; - - // TODO: Figure out a better way to set selection - this.onSuggestionSelect = ({ type, text, start, end }) => { - const { query } = this.localQuery; - const inputEl = $element.find('input')[0]; - const { selectionStart, selectionEnd } = inputEl; - const value = query.substr(0, selectionStart) + query.substr(selectionEnd); - - this.localQuery.query = inputEl.value = value.substr(0, start) + text + value.substr(end); - inputEl.setSelectionRange(start + text.length, start + text.length); - - if (type === 'recentSearch') { - this.submit(); - } else { - this.updateSuggestions(); - } - }; - - this.getRecentSearchSuggestions = (query) => { - if (!this.persistedLog) return []; - const recentSearches = this.persistedLog.get(); - const matchingRecentSearches = recentSearches.filter(search => search.includes(query)); - return matchingRecentSearches.map(recentSearch => { - const text = recentSearch; - const start = 0; - const end = query.length; - return { type: 'recentSearch', text, start, end }; - }); - }; - - $scope.$watch('queryBar.localQuery.language', (language) => { - if (!language) return; - this.persistedLog = new PersistedLog(`typeahead:${this.appName}-${language}`, { - maxLength: config.get('history:limit'), - filterDuplicates: true - }); - this.updateSuggestions(); - }); - - $scope.$watch('queryBar.query', (newQuery) => { - this.localQuery = { - ...newQuery - }; - }, true); - - $scope.$watch('queryBar.indexPatterns', () => { - this.updateSuggestions(); - }); - - $scope.$on('$destroy', () => { - this.updateSuggestions.cancel(); - this._isScopeDestroyed = true; - }); - }) - }; -}); diff --git a/src/ui/public/query_bar/directive/query_popover.js b/src/ui/public/query_bar/directive/query_popover.js deleted file mode 100644 index 14be6f41b3c16..0000000000000 --- a/src/ui/public/query_bar/directive/query_popover.js +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; -import ReactDOM from 'react-dom'; -import { uiModules } from '../../modules'; -import { documentationLinks } from '../../documentation_links/documentation_links'; -import { kfetch } from 'ui/kfetch'; -import { - EuiPopover, - EuiButtonEmpty, - EuiForm, - EuiFormRow, - EuiSwitch, - EuiLink, - EuiText, - EuiSpacer, - EuiHorizontalRule, - EuiPopoverTitle, -} from '@elastic/eui'; - -const luceneQuerySyntaxDocs = documentationLinks.query.luceneQuerySyntax; -const kueryQuerySyntaxDocs = documentationLinks.query.kueryQuerySyntax; - -const module = uiModules.get('app/kibana', ['react']); -module.directive('queryPopover', function (localStorage) { - - return { - restrict: 'E', - scope: { - language: '<', - onSelectLanguage: '&', - }, - link: function ($scope, $element) { - $scope.isPopoverOpen = false; - - function togglePopover() { - $scope.$evalAsync(() => { - $scope.isPopoverOpen = !$scope.isPopoverOpen; - }); - } - - function closePopover() { - $scope.$evalAsync(() => { - $scope.isPopoverOpen = false; - }); - } - - function onSwitchChange() { - const newLanguage = $scope.language === 'lucene' ? 'kuery' : 'lucene'; - - // Send telemetry info every time the user opts in or out of kuery - // As a result it is important this function only ever gets called in the - // UI component's change handler. - kfetch({ - pathname: '/api/kibana/kql_opt_in_telemetry', - method: 'POST', - body: JSON.stringify({ opt_in: newLanguage === 'kuery' }), - }); - - $scope.$evalAsync(() => { - localStorage.set('kibana.userQueryLanguage', newLanguage); - $scope.onSelectLanguage({ $language: newLanguage }); - }); - } - - function render() { - const button = ( - - Options - - ); - - const popover = ( - - Syntax options -
- -

- Our experimental autocomplete and simple syntax features can help you create your queries. Just start - typing and you’ll see matches related to your data. - - See docs {( - - here - - )}. -

-
- - - - - - - - - - - - -

- Not ready yet? Find our lucene docs {( - - here - - )}. -

-
-
-
- ); - - ReactDOM.render(popover, $element[0]); - } - - $scope.$watch('isPopoverOpen', render); - $scope.$watch('language', render); - } - }; - -}); - - diff --git a/src/ui/public/query_bar/directive/suggestion.html b/src/ui/public/query_bar/directive/suggestion.html deleted file mode 100644 index a68ea51767b88..0000000000000 --- a/src/ui/public/query_bar/directive/suggestion.html +++ /dev/null @@ -1,23 +0,0 @@ -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
{{item.text}}
-
-
diff --git a/src/ui/public/query_bar/directive/suggestion.less b/src/ui/public/query_bar/directive/suggestion.less deleted file mode 100644 index 6af1af218b358..0000000000000 --- a/src/ui/public/query_bar/directive/suggestion.less +++ /dev/null @@ -1,155 +0,0 @@ -@import (reference) "~ui/styles/variables"; - -.suggestionItem { - display: flex; - align-items: stretch; - flex-grow: 1; - align-items: center; - font-size: 13px; - white-space: nowrap; -} - -.suggestionItem__text, .suggestionItem__type, .suggestionItem__description { - flex-grow: 1; - flex-basis: 0%; - display: flex; - flex-direction: column; -} - -.suggestionItem__type { - flex-grow: 0; - flex-basis: auto; - width: 32px; - height: 32px; - text-align: center; - overflow: hidden; - padding: 4px; -} - -&.suggestionItem--field { - .suggestionItem__type { - background-color: tint(@globalColorOrange, 90%); - color: @globalColorOrange; - } -} - -&.suggestionItem--value { - .suggestionItem__type { - background-color: tint(@globalColorTeal, 90%); - color: @globalColorTeal; - } - - .suggestionItem__text { - width: auto; - } -} - -&.suggestionItem--operator { - .suggestionItem__type { - background-color: tint(@globalColorBlue, 90%); - color: @globalColorBlue; - } -} - -&.suggestionItem--conjunction { - .suggestionItem__type { - background-color: tint(@globalColorPurple, 90%); - color: @globalColorPurple; - } -} - -&.suggestionItem--recentSearch { - .suggestionItem__type { - background-color: @globalColorLightGray; - color: @globalColorMediumGray; - } - - .suggestionItem__text { - width: auto; - } -} - -.suggestionItem__text { - flex-grow: 0; /* 2 */ - flex-basis: auto; /* 2 */ - font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; - margin-right: 32px; - width: 250px; - overflow: hidden; - text-overflow: ellipsis; - padding: 4px 8px; - color: #111; -} - -.suggestionItem__description { - color: @globalColorDarkGray; - overflow: hidden; - text-overflow: ellipsis; -} - -.suggestionItem__callout { - font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; - background: @globalColorLightestGray; - color: #000; - padding: 0 4px; - display: inline-block; -} - -.suggestionTypeahead { - .typeahead { - .typeahead-items { - max-height: 60vh; - overflow-y: auto; - - .typeahead-item { - padding: 0; - border-bottom: none; - line-height: normal; - - &:hover { - cursor: pointer; - } - - &.active { - background-color: @globalColorLightestGray; - - .suggestionItem__callout { - background: #fff; - } - - .suggestionItem__text { - color: #000; - } - - .suggestionItem__type { - color: #000; - } - - .suggestionItem--field { - .suggestionItem__type { - background-color: tint(@globalColorOrange, 80%); - } - } - - .suggestionItem--value { - .suggestionItem__type { - background-color: tint(@globalColorTeal, 80%); - } - } - - .suggestionItem--operator { - .suggestionItem__type { - background-color: tint(@globalColorBlue, 80%); - } - } - - .suggestionItem--conjunction { - .suggestionItem__type { - background-color: tint(@globalColorPurple, 80%); - } - } - } - } - } - } -} diff --git a/src/ui/public/parse_query/index.js b/src/ui/public/query_bar/index.ts similarity index 95% rename from src/ui/public/parse_query/index.js rename to src/ui/public/query_bar/index.ts index 8e4bc6d0ad3db..6b41af67783b4 100644 --- a/src/ui/public/parse_query/index.js +++ b/src/ui/public/query_bar/index.ts @@ -17,4 +17,4 @@ * under the License. */ -import './parse_query'; +export { QueryBar } from './components'; diff --git a/src/ui/public/directives/match_pairs.js b/src/ui/public/query_bar/lib/match_pairs.ts similarity index 50% rename from src/ui/public/directives/match_pairs.js rename to src/ui/public/query_bar/lib/match_pairs.ts index 181dab3c0f518..d5cfb4f99c9d5 100644 --- a/src/ui/public/directives/match_pairs.js +++ b/src/ui/public/query_bar/lib/match_pairs.ts @@ -17,11 +17,8 @@ * under the License. */ -import { uiModules } from '../modules'; -const module = uiModules.get('kibana'); - /** - * This directively automatically handles matching pairs. + * This helper automatically handles matching pairs. * Specifically, it does the following: * * 1. If the key is a closer, and the character in front of the cursor is the @@ -37,69 +34,108 @@ const pairs = ['()', '[]', '{}', `''`, '""']; const openers = pairs.map(pair => pair[0]); const closers = pairs.map(pair => pair[1]); -module.directive('matchPairs', () => ({ - restrict: 'A', - require: 'ngModel', - link: function (scope, elem, attrs, ngModel) { - elem.on('keydown', (e) => { - const { target, key, metaKey } = e; - const { value, selectionStart, selectionEnd } = target; - - if (shouldMoveCursorForward(key, value, selectionStart, selectionEnd)) { - e.preventDefault(); - target.setSelectionRange(selectionStart + 1, selectionEnd + 1); - } else if (shouldInsertMatchingCloser(key, value, selectionStart, selectionEnd)) { - e.preventDefault(); - const newValue = value.substr(0, selectionStart) + key + - value.substring(selectionStart, selectionEnd) + closers[openers.indexOf(key)] + - value.substr(selectionEnd); - target.value = newValue; - target.setSelectionRange(selectionStart + 1, selectionEnd + 1); - ngModel.$setViewValue(newValue); - ngModel.$render(); - } else if (shouldRemovePair(key, metaKey, value, selectionStart, selectionEnd)) { - e.preventDefault(); - const newValue = value.substr(0, selectionEnd - 1) + value.substr(selectionEnd + 1); - target.value = newValue; - target.setSelectionRange(selectionStart - 1, selectionEnd - 1); - ngModel.$setViewValue(newValue); - ngModel.$render(); - } - }); +interface MatchPairsOptions { + value: string; + selectionStart: number; + selectionEnd: number; + key: string; + metaKey: boolean; + updateQuery: (query: string, selectionStart: number, selectionEnd: number) => void; + preventDefault: () => void; +} + +export function matchPairs({ + value, + selectionStart, + selectionEnd, + key, + metaKey, + updateQuery, + preventDefault, +}: MatchPairsOptions) { + if (shouldMoveCursorForward(key, value, selectionStart, selectionEnd)) { + preventDefault(); + updateQuery(value, selectionStart + 1, selectionEnd + 1); + } else if (shouldInsertMatchingCloser(key, value, selectionStart, selectionEnd)) { + preventDefault(); + const newValue = + value.substr(0, selectionStart) + + key + + value.substring(selectionStart, selectionEnd) + + closers[openers.indexOf(key)] + + value.substr(selectionEnd); + updateQuery(newValue, selectionStart + 1, selectionEnd + 1); + } else if (shouldRemovePair(key, metaKey, value, selectionStart, selectionEnd)) { + preventDefault(); + const newValue = value.substr(0, selectionEnd - 1) + value.substr(selectionEnd + 1); + updateQuery(newValue, selectionStart - 1, selectionEnd - 1); } -})); +} -function shouldMoveCursorForward(key, value, selectionStart, selectionEnd) { - if (!closers.includes(key)) return false; +function shouldMoveCursorForward( + key: string, + value: string, + selectionStart: number, + selectionEnd: number +) { + if (!closers.includes(key)) { + return false; + } // Never move selection forward for multi-character selections - if (selectionStart !== selectionEnd) return false; + if (selectionStart !== selectionEnd) { + return false; + } // Move selection forward if the key is the same as the closer in front of the selection return value.charAt(selectionEnd) === key; } -function shouldInsertMatchingCloser(key, value, selectionStart, selectionEnd) { - if (!openers.includes(key)) return false; +function shouldInsertMatchingCloser( + key: string, + value: string, + selectionStart: number, + selectionEnd: number +) { + if (!openers.includes(key)) { + return false; + } // Always insert for multi-character selections - if (selectionStart !== selectionEnd) return true; + if (selectionStart !== selectionEnd) { + return true; + } const precedingCharacter = value.charAt(selectionStart - 1); const followingCharacter = value.charAt(selectionStart + 1); // Don't insert if the preceding character is a backslash - if (precedingCharacter === '\\') return false; + if (precedingCharacter === '\\') { + return false; + } // Don't insert if it's a quote and the either of the preceding/following characters is alphanumeric - return !(['"', `'`].includes(key) && (isAlphanumeric(precedingCharacter) || isAlphanumeric(followingCharacter))); + return !( + ['"', `'`].includes(key) && + (isAlphanumeric(precedingCharacter) || isAlphanumeric(followingCharacter)) + ); } -function shouldRemovePair(key, metaKey, value, selectionStart, selectionEnd) { - if (key !== 'Backspace' || metaKey) return false; +function shouldRemovePair( + key: string, + metaKey: boolean, + value: string, + selectionStart: number, + selectionEnd: number +) { + if (key !== 'Backspace' || metaKey) { + return false; + } // Never remove for multi-character selections - if (selectionStart !== selectionEnd) return false; + if (selectionStart !== selectionEnd) { + return false; + } // Remove if the preceding/following characters are a pair return pairs.includes(value.substr(selectionEnd - 1, 2)); diff --git a/src/ui/public/typeahead/typeahead_item.js b/src/ui/public/storage/directive.js similarity index 71% rename from src/ui/public/typeahead/typeahead_item.js rename to src/ui/public/storage/directive.js index c613aa3b9bd38..a5bb2ee3b6b0b 100644 --- a/src/ui/public/typeahead/typeahead_item.js +++ b/src/ui/public/storage/directive.js @@ -17,19 +17,16 @@ * under the License. */ + import { uiModules } from '../modules'; -const typeahead = uiModules.get('kibana/typeahead'); +import { Storage } from './storage'; -typeahead.directive('kbnTypeaheadItem', function ($compile) { - return { - restrict: 'E', - scope: { - item: '=', - template: '=' - }, - link: (scope, element) => { - element.html(scope.template || '{{item}}'); - $compile(element.contents())(scope); - } +const createService = function (type) { + return function ($window) { + return new Storage($window[type]); }; -}); +}; + +uiModules.get('kibana/storage') + .service('localStorage', createService('localStorage')) + .service('sessionStorage', createService('sessionStorage')); diff --git a/src/ui/public/storage/index.js b/src/ui/public/storage/index.ts similarity index 97% rename from src/ui/public/storage/index.js rename to src/ui/public/storage/index.ts index d2a214ea3d30a..17bbb61b2b8d5 100644 --- a/src/ui/public/storage/index.js +++ b/src/ui/public/storage/index.ts @@ -17,4 +17,6 @@ * under the License. */ +import './directive'; + export { Storage } from './storage'; diff --git a/src/ui/public/storage/storage.js b/src/ui/public/storage/storage.ts similarity index 50% rename from src/ui/public/storage/storage.js rename to src/ui/public/storage/storage.ts index aea032be4fd6b..703886c1e034c 100644 --- a/src/ui/public/storage/storage.js +++ b/src/ui/public/storage/storage.ts @@ -17,44 +17,50 @@ * under the License. */ -import { uiModules } from '../modules'; import angular from 'angular'; -export function Storage(store) { - const self = this; - self.store = store; +// This is really silly, but I wasn't prepared to rename the kibana Storage class everywhere it is used +// and this is the only way I could figure out how to use the type definition for a built in object +// in a file that creates a type with the same name as that built in object. +import { WebStorage } from './web_storage'; + +export class Storage { + public store: WebStorage; + + constructor(store: WebStorage) { + this.store = store; + } + + public get = (key: string) => { + if (!this.store) { + return null; + } + + const storageItem = this.store.getItem(key); + if (storageItem === null) { + return null; + } - self.get = function (key) { try { - return JSON.parse(self.store.getItem(key)); - } catch (e) { + return JSON.parse(storageItem); + } catch (error) { return null; } }; - self.set = function (key, value) { + public set = (key: string, value: any) => { try { - return self.store.setItem(key, angular.toJson(value)); + return this.store.setItem(key, angular.toJson(value)); } catch (e) { return false; } }; - self.remove = function (key) { - return self.store.removeItem(key); + public remove = (key: string) => { + return this.store.removeItem(key); }; - self.clear = function () { - return self.store.clear(); + public clear = () => { + return this.store.clear(); }; } - -const createService = function (type) { - return function ($window) { - return new Storage($window[type]); - }; -}; - -uiModules.get('kibana/storage') - .service('localStorage', createService('localStorage')) - .service('sessionStorage', createService('sessionStorage')); diff --git a/src/ui/public/typeahead/index.js b/src/ui/public/storage/web_storage.ts similarity index 95% rename from src/ui/public/typeahead/index.js rename to src/ui/public/storage/web_storage.ts index 2237c60b66ef1..d5f775431143d 100644 --- a/src/ui/public/typeahead/index.js +++ b/src/ui/public/storage/web_storage.ts @@ -17,4 +17,4 @@ * under the License. */ -import './typeahead'; +export type WebStorage = Storage; diff --git a/src/ui/public/typeahead/__tests__/typeahead.js b/src/ui/public/typeahead/__tests__/typeahead.js deleted file mode 100644 index 3b9e49aa077e7..0000000000000 --- a/src/ui/public/typeahead/__tests__/typeahead.js +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from 'expect.js'; -import sinon from 'sinon'; -import ngMock from 'ng_mock'; -import '../typeahead'; -import { comboBoxKeyCodes } from '@elastic/eui'; -const { UP, DOWN, ENTER, TAB, ESCAPE } = comboBoxKeyCodes; - -describe('Typeahead directive', function () { - let $compile; - let scope; - let element; - - beforeEach(ngMock.module('kibana')); - - beforeEach(ngMock.inject(function (_$compile_, _$rootScope_) { - $compile = _$compile_; - scope = _$rootScope_.$new(); - const html = ` - - - - `; - element = $compile(html)(scope); - scope.items = ['foo', 'bar', 'baz']; - scope.onSelect = sinon.spy(); - scope.$digest(); - })); - - describe('before focus', function () { - it('should be hidden', function () { - scope.$digest(); - expect(element.find('.typeahead-popover').hasClass('ng-hide')).to.be(true); - }); - }); - - describe('after focus', function () { - beforeEach(function () { - element.find('input').triggerHandler('focus'); - scope.$digest(); - }); - - it('should still be hidden', function () { - expect(element.find('.typeahead-popover').hasClass('ng-hide')).to.be(true); - }); - - it('should show when a key is pressed unless there are no items', function () { - element.find('.typeahead').triggerHandler({ - type: 'keypress', - keyCode: 'A'.charCodeAt(0) - }); - - scope.$digest(); - - expect(element.find('.typeahead-popover').hasClass('ng-hide')).to.be(false); - - scope.items = []; - scope.$digest(); - - expect(element.find('.typeahead-popover').hasClass('ng-hide')).to.be(true); - }); - - it('should hide when escape is pressed', function () { - element.find('.typeahead').triggerHandler({ - type: 'keydown', - keyCode: ESCAPE - }); - - scope.$digest(); - - expect(element.find('.typeahead-popover').hasClass('ng-hide')).to.be(true); - }); - - it('should select the next option on arrow down', function () { - let expectedActiveIndex = -1; - for (let i = 0; i < scope.items.length + 1; i++) { - expectedActiveIndex++; - if (expectedActiveIndex > scope.items.length - 1) expectedActiveIndex = 0; - - element.find('.typeahead').triggerHandler({ - type: 'keydown', - keyCode: DOWN - }); - - scope.$digest(); - - expect(element.find('.typeahead-item.active').length).to.be(1); - expect(element.find('.typeahead-item').eq(expectedActiveIndex).hasClass('active')).to.be(true); - } - }); - - it('should select the previous option on arrow up', function () { - let expectedActiveIndex = scope.items.length; - for (let i = 0; i < scope.items.length + 1; i++) { - expectedActiveIndex--; - if (expectedActiveIndex < 0) expectedActiveIndex = scope.items.length - 1; - - element.find('.typeahead').triggerHandler({ - type: 'keydown', - keyCode: UP - }); - - scope.$digest(); - - expect(element.find('.typeahead-item.active').length).to.be(1); - expect(element.find('.typeahead-item').eq(expectedActiveIndex).hasClass('active')).to.be(true); - } - }); - - it('should fire the onSelect handler with the selected item on enter', function () { - const typeaheadEl = element.find('.typeahead'); - - typeaheadEl.triggerHandler({ - type: 'keydown', - keyCode: DOWN - }); - - typeaheadEl.triggerHandler({ - type: 'keydown', - keyCode: ENTER - }); - - scope.$digest(); - - sinon.assert.calledOnce(scope.onSelect); - sinon.assert.calledWith(scope.onSelect, scope.items[0]); - }); - - it('should fire the onSelect handler with the selected item on tab', function () { - const typeaheadEl = element.find('.typeahead'); - - typeaheadEl.triggerHandler({ - type: 'keydown', - keyCode: DOWN - }); - - typeaheadEl.triggerHandler({ - type: 'keydown', - keyCode: TAB - }); - - scope.$digest(); - - sinon.assert.calledOnce(scope.onSelect); - sinon.assert.calledWith(scope.onSelect, scope.items[0]); - }); - - it('should select the option on hover', function () { - const hoverIndex = 0; - element.find('.typeahead-item').eq(hoverIndex).triggerHandler('mouseenter'); - - scope.$digest(); - - expect(element.find('.typeahead-item.active').length).to.be(1); - expect(element.find('.typeahead-item').eq(hoverIndex).hasClass('active')).to.be(true); - }); - - it('should fire the onSelect handler with the selected item on click', function () { - const clickIndex = 1; - const clickEl = element.find('.typeahead-item').eq(clickIndex); - clickEl.triggerHandler('mouseenter'); - clickEl.triggerHandler('click'); - - scope.$digest(); - - sinon.assert.calledOnce(scope.onSelect); - sinon.assert.calledWith(scope.onSelect, scope.items[clickIndex]); - }); - - it('should update the list when the items change', function () { - scope.items = ['qux']; - scope.$digest(); - expect(expect(element.find('.typeahead-item').length).to.be(scope.items.length)); - }); - - it('should default to showing the item itself in the list', function () { - scope.items.forEach((item, i) => { - expect(element.find('kbn-typeahead-item').eq(i).html()).to.be(item); - }); - }); - - it('should use a custom template if specified to show the item in the list', function () { - scope.items = [{ - label: 'foo', - value: 1 - }]; - scope.itemTemplate = '
{{item.label}}
'; - scope.$digest(); - expect(element.find('.label').html()).to.be(scope.items[0].label); - }); - }); -}); diff --git a/src/ui/public/typeahead/typeahead.html b/src/ui/public/typeahead/typeahead.html deleted file mode 100644 index 39b1fa2b802a5..0000000000000 --- a/src/ui/public/typeahead/typeahead.html +++ /dev/null @@ -1,40 +0,0 @@ -
- -
-
-
- - -
-
-
-
diff --git a/src/ui/public/typeahead/typeahead.js b/src/ui/public/typeahead/typeahead.js deleted file mode 100644 index e2f173fee35ff..0000000000000 --- a/src/ui/public/typeahead/typeahead.js +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import template from './typeahead.html'; -import { uiModules } from '../modules'; -import { comboBoxKeyCodes } from '@elastic/eui'; -import '../directives/scroll_bottom'; -import './typeahead.less'; -import './typeahead_input'; -import './typeahead_item'; - -const { UP, DOWN, ENTER, TAB, ESCAPE } = comboBoxKeyCodes; -const typeahead = uiModules.get('kibana/typeahead'); - -typeahead.directive('kbnTypeahead', function () { - return { - template, - transclude: true, - restrict: 'E', - scope: { - items: '=', - itemTemplate: '=', - onSelect: '&', - onFocusChange: '&' - }, - bindToController: true, - controllerAs: 'typeahead', - controller: function ($scope, $element) { - this.isHidden = true; - this.selectedIndex = null; - this.elementID = $element.attr('id'); - - this.submit = () => { - const item = this.items[this.selectedIndex]; - this.onSelect({ item }); - this.selectedIndex = null; - }; - - this.selectPrevious = () => { - if (this.selectedIndex !== null && this.selectedIndex > 0) { - this.selectedIndex--; - } else { - this.selectedIndex = this.items.length - 1; - } - this.scrollSelectedIntoView(); - }; - - this.selectNext = () => { - if (this.selectedIndex !== null && this.selectedIndex < this.items.length - 1) { - this.selectedIndex++; - } else { - this.selectedIndex = 0; - } - this.scrollSelectedIntoView(); - }; - - this.scrollSelectedIntoView = () => { - const parent = $element.find('.typeahead-items')[0]; - const child = $element.find('.typeahead-item').eq(this.selectedIndex)[0]; - parent.scrollTop = Math.min(parent.scrollTop, child.offsetTop); - parent.scrollTop = Math.max(parent.scrollTop, child.offsetTop + child.offsetHeight - parent.offsetHeight); - }; - - this.isVisible = () => { - // Blur fires before click. If we only checked isFocused, then click events would never fire. - const isFocusedOrMousedOver = this.isFocused || this.isMousedOver; - return !this.isHidden && this.items && this.items.length > 0 && isFocusedOrMousedOver; - }; - - this.resetLimit = () => { - this.limit = 50; - }; - - this.increaseLimit = () => { - this.limit += 50; - }; - - this.onKeyDown = (event) => { - const { keyCode } = event; - - if (keyCode === ESCAPE) this.isHidden = true; - - if ([TAB, ENTER].includes(keyCode) && !this.hidden && this.selectedIndex !== null) { - event.preventDefault(); - this.submit(); - } else if (keyCode === UP && this.items.length > 0) { - event.preventDefault(); - this.isHidden = false; - this.selectPrevious(); - } else if (keyCode === DOWN && this.items.length > 0) { - event.preventDefault(); - this.isHidden = false; - this.selectNext(); - } else { - this.selectedIndex = null; - } - }; - - this.onKeyPress = () => { - this.isHidden = false; - }; - - this.onItemClick = () => { - this.submit(); - $scope.$broadcast('focus'); - $scope.$evalAsync(() => this.isHidden = false); - }; - - this.onFocus = () => { - this.isFocused = true; - this.isHidden = true; - this.resetLimit(); - }; - - this.onBlur = () => { - this.isFocused = false; - }; - - this.onMouseEnter = () => { - this.isMousedOver = true; - }; - - this.onMouseLeave = () => { - this.isMousedOver = false; - }; - - $scope.$watch('typeahead.selectedIndex', (newIndex) => { - this.onFocusChange({ $focusedItemID: newIndex !== null ? `${this.elementID}-typeahead-item-${newIndex}` : '' }); - }); - } - }; -}); diff --git a/src/ui/public/typeahead/typeahead.less b/src/ui/public/typeahead/typeahead.less deleted file mode 100644 index 94bd5ca32b15e..0000000000000 --- a/src/ui/public/typeahead/typeahead.less +++ /dev/null @@ -1,55 +0,0 @@ -@import (reference) "~ui/styles/variables"; -@import (reference) "~ui/styles/mixins"; - -.typeahead { - position: relative; - - .typeahead-popover { - border: 1px solid; - border-color: @typeahead-item-border; - color: @typeahead-item-color; - background-color: @typeahead-item-bg; - position: absolute; - top: 32px; - z-index: @zindex-typeahead; - box-shadow: 0px 4px 8px rgba(0,0,0,.1); - width: 100%; - border-radius: 4px; - - .typeahead-items { - max-height: 500px; - overflow-y: auto; - } - - .typeahead-item { - height: 32px; - line-height: 32px; - white-space: nowrap; - font-size: 12px; - vertical-align: middle; - } - - .typeahead-item:last-child { - border-bottom: 0px; - border-radius: 0 0 4px 4px; - } - - .typeahead-item:first-child { - border-bottom: 0px; - border-radius: 4px 4px 0 0; - } - - .typeahead-item.active { - background-color: @globalColorLightestGray; - } - } -} - -.inline-form .typeahead.visible .input-group { - > :first-child { - .border-bottom-radius(0); - } - > :last-child { - .border-bottom-radius(0); - } -} diff --git a/src/ui/public/typeahead/typeahead_input.js b/src/ui/public/typeahead/typeahead_input.js deleted file mode 100644 index b273426af2c42..0000000000000 --- a/src/ui/public/typeahead/typeahead_input.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { uiModules } from '../modules'; -const typeahead = uiModules.get('kibana/typeahead'); - -typeahead.directive('kbnTypeaheadInput', function () { - return { - restrict: 'A', - require: '^kbnTypeahead', - link: function ($scope, $el, $attr, typeahead) { - // disable browser autocomplete - $el.attr('autocomplete', 'off'); - - $el.on('focus', () => { - // For some reason if we don't have the $evalAsync in here, then blur events happen outside the angular lifecycle - $scope.$evalAsync(() => typeahead.onFocus()); - }); - - $el.on('blur', () => { - $scope.$evalAsync(() => typeahead.onBlur()); - }); - - $scope.$on('focus', () => { - $el.focus(); - }); - - $scope.$on('$destroy', () => { - $el.off(); - }); - } - }; -}); diff --git a/src/ui/public/vis/response_handlers/legacy.js b/src/ui/public/vis/response_handlers/legacy.js index 7f5c130dc254a..e9f06aceaa4b4 100644 --- a/src/ui/public/vis/response_handlers/legacy.js +++ b/src/ui/public/vis/response_handlers/legacy.js @@ -43,7 +43,7 @@ const LegacyResponseHandlerProvider = function () { const splitMap = {}; let splitIndex = 0; - table.rows.forEach(row => { + table.rows.forEach((row, rowIndex) => { const splitValue = row[splitColumn.id]; const splitColumnIndex = table.columns.findIndex(column => column === splitColumn); @@ -74,6 +74,11 @@ const LegacyResponseHandlerProvider = function () { const newRow = _.map(converted.tables[tableIndex].tables[0].columns, column => { const value = row[column.id]; const aggConfigResult = new AggConfigResult(column.aggConfig, previousSplitAgg, value, value); + aggConfigResult.rawData = { + table: table, + columnIndex: table.columns.findIndex(c => c.id === column.id), + rowIndex: rowIndex, + }; if (column.aggConfig.type.type === 'buckets') { previousSplitAgg = aggConfigResult; } @@ -86,11 +91,16 @@ const LegacyResponseHandlerProvider = function () { converted.tables.push({ columns: table.columns.map(column => ({ title: column.name, ...column })), - rows: table.rows.map(row => { + rows: table.rows.map((row, rowIndex) => { let previousSplitAgg; - return table.columns.map(column => { + return table.columns.map((column, columnIndex) => { const value = row[column.id]; const aggConfigResult = new AggConfigResult(column.aggConfig, previousSplitAgg, value, value); + aggConfigResult.rawData = { + table: table, + column: columnIndex, + row: rowIndex, + }; if (column.aggConfig.type.type === 'buckets') { previousSplitAgg = aggConfigResult; } diff --git a/src/ui/public/vis/vis.js b/src/ui/public/vis/vis.js index 85d59bf4ccd57..2c8b11d99ef97 100644 --- a/src/ui/public/vis/vis.js +++ b/src/ui/public/vis/vis.js @@ -34,7 +34,7 @@ import { AggConfigs } from './agg_configs'; import { PersistedState } from '../persisted_state'; import { onBrushEvent } from '../utils/brush_event'; import { FilterBarQueryFilterProvider } from '../filter_bar/query_filter'; -import { FilterBarClickHandlerProvider } from '../filter_bar/filter_bar_click_handler'; +import { FilterBarPushFiltersProvider } from '../filter_bar/push_filters'; import { updateVisualizationConfig } from './vis_update'; import { SearchSourceProvider } from '../courier/search_source'; import { SavedObjectsClientProvider } from '../saved_objects'; @@ -54,7 +54,7 @@ const getTerms = (table, columnIndex, rowIndex) => { return row[column.id] === table.rows[rowIndex][column.id] || i >= columnIndex; }); }); - const terms = rows.map(row => row[columnIndex]); + const terms = rows.map(row => row[table.columns[columnIndex].id]); return [...new Set(terms.filter(term => { const notOther = term !== '__other__'; @@ -66,9 +66,9 @@ const getTerms = (table, columnIndex, rowIndex) => { export function VisProvider(Private, indexPatterns, getAppState) { const visTypes = Private(VisTypesRegistryProvider); const queryFilter = Private(FilterBarQueryFilterProvider); - const filterBarClickHandler = Private(FilterBarClickHandlerProvider); const SearchSource = Private(SearchSourceProvider); const savedObjectsClient = Private(SavedObjectsClientProvider); + const filterBarPushFilters = Private(FilterBarPushFiltersProvider); class Vis extends EventEmitter { constructor(indexPattern, visState) { @@ -99,14 +99,22 @@ export function VisProvider(Private, indexPatterns, getAppState) { // the filter method will be removed in the near feature // you should rather use addFilter method below filter: (event) => { + let data = event.datum.aggConfigResult; + const filters = []; + while (data.$parent) { + const { key, rawData } = data.$parent; + const { table, column, row } = rawData; + filters.push(this.API.events.createFilter(table, column, row, key)); + data = data.$parent; + } const appState = getAppState(); - filterBarClickHandler(appState)(event); + filterBarPushFilters(appState)(_.flatten(filters)); }, - addFilter: (data, columnIndex, rowIndex, cellValue) => { + createFilter: (data, columnIndex, rowIndex, cellValue) => { const { aggConfig, id: columnId } = data.columns[columnIndex]; let filter = []; const value = rowIndex > -1 ? data.rows[rowIndex][columnId] : cellValue; - if (!value) { + if (value === null || value === undefined) { return; } if (aggConfig.type.name === 'terms' && aggConfig.params.otherBucket) { @@ -115,6 +123,10 @@ export function VisProvider(Private, indexPatterns, getAppState) { } else { filter = aggConfig.createFilter(value); } + return filter; + }, + addFilter: (data, columnIndex, rowIndex, cellValue) => { + const filter = this.API.events.createFilter(data, columnIndex, rowIndex, cellValue); queryFilter.addFilters(filter); }, brush: (event) => { onBrushEvent(event, getAppState()); diff --git a/test/functional/apps/dashboard/_embeddable_rendering.js b/test/functional/apps/dashboard/_embeddable_rendering.js index 1a0f47ed28e17..07ceeed9544a1 100644 --- a/test/functional/apps/dashboard/_embeddable_rendering.js +++ b/test/functional/apps/dashboard/_embeddable_rendering.js @@ -80,7 +80,7 @@ export default function ({ getService, getPageObjects }) { await dashboardExpect.vegaTextsDoNotExist(['5,000']); }; - describe('dashboard embeddable rendering', function describeIndexTests() { + describe.skip('dashboard embeddable rendering', function describeIndexTests() { before(async () => { await PageObjects.dashboard.clickNewDashboard(); diff --git a/test/functional/apps/discover/_field_data.js b/test/functional/apps/discover/_field_data.js index cdc51d86d7b5e..578f578c73d28 100644 --- a/test/functional/apps/discover/_field_data.js +++ b/test/functional/apps/discover/_field_data.js @@ -23,6 +23,7 @@ export default function ({ getService, getPageObjects }) { const retry = getService('retry'); const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); + const queryBar = getService('queryBar'); const PageObjects = getPageObjects(['common', 'header', 'discover', 'visualize']); describe('discover tab', function describeIndexTests() { @@ -45,7 +46,8 @@ export default function ({ getService, getPageObjects }) { describe('field data', function () { it('search php should show the correct hit count', async function () { const expectedHitCount = '445'; - await PageObjects.discover.query('php'); + await queryBar.setQuery('php'); + await queryBar.submitQuery(); await retry.try(async function tryingForTime() { const hitCount = await PageObjects.discover.getHitCount(); @@ -63,7 +65,8 @@ export default function ({ getService, getPageObjects }) { it('search type:apache should show the correct hit count', async function () { const expectedHitCount = '11,156'; - await PageObjects.discover.query('type:apache'); + await queryBar.setQuery('type:apache'); + await queryBar.submitQuery(); await retry.try(async function tryingForTime() { const hitCount = await PageObjects.discover.getHitCount(); expect(hitCount).to.be(expectedHitCount); @@ -164,8 +167,9 @@ export default function ({ getService, getPageObjects }) { }); it('a bad syntax query should show an error message', async function () { - const expectedError = 'Discover: Failed to parse query [xxx(yyy]'; - await PageObjects.discover.query('xxx(yyy'); + const expectedError = 'Discover: Failed to parse query [xxx(yyy))]'; + await queryBar.setQuery('xxx(yyy))'); + await queryBar.submitQuery(); const toastMessage = await PageObjects.header.getToastMessage(); expect(toastMessage).to.contain(expectedError); await PageObjects.header.clickToastOK(); diff --git a/test/functional/apps/discover/_large_string.js b/test/functional/apps/discover/_large_string.js index d55846a9cd62a..9feed7c9202e9 100644 --- a/test/functional/apps/discover/_large_string.js +++ b/test/functional/apps/discover/_large_string.js @@ -23,6 +23,7 @@ export default function ({ getService, getPageObjects }) { const esArchiver = getService('esArchiver'); const log = getService('log'); const retry = getService('retry'); + const queryBar = getService('queryBar'); const PageObjects = getPageObjects([ 'common', 'home', @@ -62,7 +63,8 @@ export default function ({ getService, getPageObjects }) { describe('test large data', function () { it('search Newsletter should show the correct hit count', async function () { const expectedHitCount = '1'; - await PageObjects.discover.query('Newsletter'); + await queryBar.setQuery('Newsletter'); + await queryBar.submitQuery(); await retry.try(async function tryingForTime() { const hitCount = await PageObjects.discover.getHitCount(); expect(hitCount).to.be(expectedHitCount); diff --git a/test/functional/apps/visualize/_pie_chart.js b/test/functional/apps/visualize/_pie_chart.js index a91ee5e5ee440..e79dc9e8c690d 100644 --- a/test/functional/apps/visualize/_pie_chart.js +++ b/test/functional/apps/visualize/_pie_chart.js @@ -21,6 +21,7 @@ import expect from 'expect.js'; export default function ({ getService, getPageObjects }) { const log = getService('log'); + const filterBar = getService('filterBar'); const PageObjects = getPageObjects(['common', 'visualize', 'header', 'settings']); const fromTime = '2015-09-19 06:31:44.000'; const toTime = '2015-09-23 18:31:44.000'; @@ -89,29 +90,64 @@ export default function ({ getService, getPageObjects }) { expect(data).to.eql(expectedTableData); }); - it('should show other and missing bucket', async function () { - const expectedTableData = [ 'win 8', 'win xp', 'win 7', 'ios', 'Missing', 'Other' ]; + describe('other bucket', () => { + it('should show other and missing bucket', async function () { + const expectedTableData = [ 'win 8', 'win xp', 'win 7', 'ios', 'Missing', 'Other' ]; + + await PageObjects.visualize.navigateToNewVisualization(); + log.debug('clickPieChart'); + await PageObjects.visualize.clickPieChart(); + await PageObjects.visualize.clickNewSearch(); + log.debug(`Set absolute time range from "${fromTime}" to "${toTime}"`); + await PageObjects.header.setAbsoluteRange(fromTime, toTime); + log.debug('select bucket Split Slices'); + await PageObjects.visualize.clickBucket('Split Slices'); + log.debug('Click aggregation Terms'); + await PageObjects.visualize.selectAggregation('Terms'); + log.debug('Click field machine.os.raw'); + await PageObjects.visualize.selectField('machine.os.raw'); + await PageObjects.visualize.toggleOtherBucket(); + await PageObjects.visualize.toggleMissingBucket(); + log.debug('clickGo'); + await PageObjects.visualize.clickGo(); + await PageObjects.common.sleep(1003); + const pieData = await PageObjects.visualize.getPieChartLabels(); + log.debug(`pieData.length = ${pieData.length}`); + expect(pieData).to.eql(expectedTableData); + }); - await PageObjects.visualize.navigateToNewVisualization(); - log.debug('clickPieChart'); - await PageObjects.visualize.clickPieChart(); - await PageObjects.visualize.clickNewSearch(); - log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"'); - await PageObjects.header.setAbsoluteRange(fromTime, toTime); - log.debug('select bucket Split Slices'); - await PageObjects.visualize.clickBucket('Split Slices'); - log.debug('Click aggregation Histogram'); - await PageObjects.visualize.selectAggregation('Terms'); - log.debug('Click field memory'); - await PageObjects.visualize.selectField('machine.os.raw'); - await PageObjects.visualize.toggleOtherBucket(); - await PageObjects.visualize.toggleMissingBucket(); - log.debug('clickGo'); - await PageObjects.visualize.clickGo(); - await PageObjects.common.sleep(1003); - const pieData = await PageObjects.visualize.getPieChartLabels(); - log.debug('pieData.length = ' + pieData.length); - expect(pieData).to.eql(expectedTableData); + it('should apply correct filter on other bucket', async () => { + const expectedTableData = [ 'Missing', 'osx' ]; + + await PageObjects.visualize.filterPieSlice('Other'); + await PageObjects.header.waitUntilLoadingHasFinished(); + const pieData = await PageObjects.visualize.getPieChartLabels(); + log.debug(`pieData.length = ${pieData.length}`); + expect(pieData).to.eql(expectedTableData); + await filterBar.removeFilter('machine.os.raw'); + }); + + it('should show two levels of other buckets', async () => { + const expectedTableData = [ 'win 8', 'CN', 'IN', 'US', 'ID', 'BR', 'Other', 'win xp', + 'CN', 'IN', 'US', 'ID', 'BR', 'Other', 'win 7', 'CN', 'IN', 'US', 'ID', 'BR', 'Other', + 'ios', 'IN', 'CN', 'US', 'ID', 'BR', 'Other', 'Missing', 'CN', 'IN', 'US', 'BR', 'PK', + 'Other', 'Other', 'IN', 'CN', 'US', 'ID', 'BR', 'Other' ]; + + await PageObjects.visualize.toggleOpenEditor(2, 'false'); + await PageObjects.visualize.clickAddBucket(); + await PageObjects.visualize.clickBucket('Split Slices'); + await PageObjects.visualize.selectAggregation('Terms'); + log.debug('Click field geo.src'); + await PageObjects.visualize.selectField('geo.src'); + await PageObjects.visualize.toggleOtherBucket(); + await PageObjects.visualize.toggleMissingBucket(); + log.debug('clickGo'); + await PageObjects.visualize.clickGo(); + await PageObjects.header.waitUntilLoadingHasFinished(); + const pieData = await PageObjects.visualize.getPieChartLabels(); + log.debug(`pieData.length = ${pieData.length}`); + expect(pieData).to.eql(expectedTableData); + }); }); describe('disabled aggs', () => { diff --git a/test/functional/page_objects/visualize_page.js b/test/functional/page_objects/visualize_page.js index 5526bb89d06c0..be5c930bb3e19 100644 --- a/test/functional/page_objects/visualize_page.js +++ b/test/functional/page_objects/visualize_page.js @@ -586,11 +586,11 @@ export function VisualizePageProvider({ getService, getPageObjects }) { } async toggleOtherBucket() { - return await find.clickByCssSelector('input[name="showOther"]'); + return await find.clickByCssSelector('vis-editor-agg-params:not(.ng-hide) input[name="showOther"]'); } async toggleMissingBucket() { - return await find.clickByCssSelector('input[name="showMissing"]'); + return await find.clickByCssSelector('vis-editor-agg-params:not(.ng-hide) input[name="showMissing"]'); } async isApplyEnabled() { @@ -1114,6 +1114,13 @@ export function VisualizePageProvider({ getService, getPageObjects }) { return await bucketType.click(); } + async filterPieSlice(name) { + const slice = await this.getPieSlice(name); + // Since slice is an SVG element we can't simply use .click() for it + await remote.moveMouseTo(slice); + await remote.clickMouseButton(); + } + async getPieSlice(name) { return await testSubjects.find(`pieSlice-${name.split(' ').join('-')}`); } diff --git a/test/functional/services/query_bar.js b/test/functional/services/query_bar.js index 0056821b81c76..218486ce75a0c 100644 --- a/test/functional/services/query_bar.js +++ b/test/functional/services/query_bar.js @@ -21,7 +21,7 @@ export function QueryBarProvider({ getService, getPageObjects }) { const testSubjects = getService('testSubjects'); const retry = getService('retry'); const log = getService('log'); - const PageObjects = getPageObjects(['header']); + const PageObjects = getPageObjects(['header', 'common']); class QueryBar { @@ -44,7 +44,8 @@ export function QueryBarProvider({ getService, getPageObjects }) { async submitQuery() { log.debug('QueryBar.submitQuery'); - await testSubjects.click('querySubmitButton'); + await testSubjects.click('queryInput'); + await PageObjects.common.pressEnterKey(); await PageObjects.header.waitUntilLoadingHasFinished(); } diff --git a/x-pack/.gitignore b/x-pack/.gitignore index eb1aec466bbfa..ba0f0190105a5 100644 --- a/x-pack/.gitignore +++ b/x-pack/.gitignore @@ -9,4 +9,4 @@ /.aws-config.json /.env /.kibana-plugin-helpers.dev.* -!/plugins/infra/**/target +!/plugins/ingest/**/target diff --git a/x-pack/index.js b/x-pack/index.js index be1ee31f7c2b2..d5aee912d4c77 100644 --- a/x-pack/index.js +++ b/x-pack/index.js @@ -26,7 +26,7 @@ import { spaces } from './plugins/spaces'; import { notifications } from './plugins/notifications'; import { kueryAutocomplete } from './plugins/kuery_autocomplete'; import { canvas } from './plugins/canvas'; -import { infra } from './plugins/infra'; +import { ingest } from './plugins/ingest'; module.exports = function (kibana) { return [ @@ -52,6 +52,6 @@ module.exports = function (kibana) { consoleExtensions(kibana), notifications(kibana), kueryAutocomplete(kibana), - infra(kibana), + ingest(kibana), ]; }; diff --git a/x-pack/plugins/canvas/public/components/app/index.js b/x-pack/plugins/canvas/public/components/app/index.js index 6c401b61aa0eb..2c4d1f6e9f808 100644 --- a/x-pack/plugins/canvas/public/components/app/index.js +++ b/x-pack/plugins/canvas/public/components/app/index.js @@ -8,7 +8,7 @@ import { connect } from 'react-redux'; import { compose, withProps } from 'recompose'; import { createSocket } from '../../socket'; import { initialize as initializeInterpreter } from '../../lib/interpreter'; -import { getAppReady } from '../../state/selectors/app'; +import { getAppReady, getBasePath } from '../../state/selectors/app'; import { appReady, appError } from '../../state/actions/app'; import { trackRouteChange } from './track_route_change'; import { App as Component } from './app'; @@ -19,13 +19,15 @@ const mapStateToProps = state => { return { appState: typeof appState === 'object' ? appState : { ready: appState }, + basePath: getBasePath(state), }; }; const mapDispatchToProps = dispatch => ({ - setAppReady: async () => { + // TODO: the correct socket path should come from upstream, using the constant here is not ideal + setAppReady: basePath => async () => { // initialize the socket and interpreter - createSocket(); + createSocket(basePath); await initializeInterpreter(); // set app state to ready @@ -34,10 +36,20 @@ const mapDispatchToProps = dispatch => ({ setAppError: payload => dispatch(appError(payload)), }); +const mergeProps = (stateProps, dispatchProps, ownProps) => { + return { + ...ownProps, + ...stateProps, + ...dispatchProps, + setAppReady: dispatchProps.setAppReady(stateProps.basePath), + }; +}; + export const App = compose( connect( mapStateToProps, - mapDispatchToProps + mapDispatchToProps, + mergeProps ), withProps(() => ({ onRouteChange: trackRouteChange, diff --git a/x-pack/plugins/canvas/public/socket.js b/x-pack/plugins/canvas/public/socket.js index 8e93bdf175ecb..a96320c8e0f7e 100644 --- a/x-pack/plugins/canvas/public/socket.js +++ b/x-pack/plugins/canvas/public/socket.js @@ -4,15 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import chrome from 'ui/chrome'; import io from 'socket.io-client'; import { functionsRegistry } from '../common/lib/functions_registry'; import { loadBrowserPlugins } from './lib/load_browser_plugins'; let socket; -export function createSocket() { - const basePath = chrome.getBasePath(); +export function createSocket(basePath) { socket = io(undefined, { path: `${basePath}/socket.io` }); socket.on('getFunctionList', () => { diff --git a/x-pack/plugins/infra/public/pages/link_to/redirect_to_container_detail.tsx b/x-pack/plugins/infra/public/pages/link_to/redirect_to_container_detail.tsx deleted file mode 100644 index f6d6b7d8dab16..0000000000000 --- a/x-pack/plugins/infra/public/pages/link_to/redirect_to_container_detail.tsx +++ /dev/null @@ -1,15 +0,0 @@ -/* - * 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 React from 'react'; -import { Redirect, RouteComponentProps } from 'react-router-dom'; - -export const RedirectToContainerDetail = ({ match }: RouteComponentProps<{ name: string }>) => ( - -); - -export const getContainerDetailUrl = ({ name }: { name: string }) => - `#/link-to/container-detail/${name}`; diff --git a/x-pack/plugins/infra/public/pages/link_to/redirect_to_host_detail.tsx b/x-pack/plugins/infra/public/pages/link_to/redirect_to_host_detail.tsx deleted file mode 100644 index dcce4e3cb5e64..0000000000000 --- a/x-pack/plugins/infra/public/pages/link_to/redirect_to_host_detail.tsx +++ /dev/null @@ -1,14 +0,0 @@ -/* - * 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 React from 'react'; -import { Redirect, RouteComponentProps } from 'react-router-dom'; - -export const RedirectToHostDetail = ({ match }: RouteComponentProps<{ name: string }>) => ( - -); - -export const getHostDetailUrl = ({ name }: { name: string }) => `#/link-to/host-detail/${name}`; diff --git a/x-pack/plugins/infra/public/pages/link_to/redirect_to_pod_detail.tsx b/x-pack/plugins/infra/public/pages/link_to/redirect_to_pod_detail.tsx deleted file mode 100644 index 0de7b7ca0f579..0000000000000 --- a/x-pack/plugins/infra/public/pages/link_to/redirect_to_pod_detail.tsx +++ /dev/null @@ -1,14 +0,0 @@ -/* - * 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 React from 'react'; -import { Redirect, RouteComponentProps } from 'react-router-dom'; - -export const RedirectToPodDetail = ({ match }: RouteComponentProps<{ name: string }>) => ( - -); - -export const getPodDetailUrl = ({ name }: { name: string }) => `#/link-to/pod-detail/${name}`; diff --git a/x-pack/plugins/infra/common/graphql/introspection.json b/x-pack/plugins/ingest/common/graphql/introspection.json similarity index 100% rename from x-pack/plugins/infra/common/graphql/introspection.json rename to x-pack/plugins/ingest/common/graphql/introspection.json diff --git a/x-pack/plugins/infra/common/graphql/root/index.ts b/x-pack/plugins/ingest/common/graphql/root/index.ts similarity index 100% rename from x-pack/plugins/infra/common/graphql/root/index.ts rename to x-pack/plugins/ingest/common/graphql/root/index.ts diff --git a/x-pack/plugins/infra/common/graphql/root/schema.gql.ts b/x-pack/plugins/ingest/common/graphql/root/schema.gql.ts similarity index 100% rename from x-pack/plugins/infra/common/graphql/root/schema.gql.ts rename to x-pack/plugins/ingest/common/graphql/root/schema.gql.ts diff --git a/x-pack/plugins/infra/common/graphql/shared/fragments.gql_query.ts b/x-pack/plugins/ingest/common/graphql/shared/fragments.gql_query.ts similarity index 100% rename from x-pack/plugins/infra/common/graphql/shared/fragments.gql_query.ts rename to x-pack/plugins/ingest/common/graphql/shared/fragments.gql_query.ts diff --git a/x-pack/plugins/infra/common/graphql/shared/index.ts b/x-pack/plugins/ingest/common/graphql/shared/index.ts similarity index 100% rename from x-pack/plugins/infra/common/graphql/shared/index.ts rename to x-pack/plugins/ingest/common/graphql/shared/index.ts diff --git a/x-pack/plugins/infra/common/graphql/shared/schema.gql.ts b/x-pack/plugins/ingest/common/graphql/shared/schema.gql.ts similarity index 100% rename from x-pack/plugins/infra/common/graphql/shared/schema.gql.ts rename to x-pack/plugins/ingest/common/graphql/shared/schema.gql.ts diff --git a/x-pack/plugins/infra/common/graphql/typed_resolvers.ts b/x-pack/plugins/ingest/common/graphql/typed_resolvers.ts similarity index 100% rename from x-pack/plugins/infra/common/graphql/typed_resolvers.ts rename to x-pack/plugins/ingest/common/graphql/typed_resolvers.ts diff --git a/x-pack/plugins/infra/common/graphql/types.ts b/x-pack/plugins/ingest/common/graphql/types.ts similarity index 100% rename from x-pack/plugins/infra/common/graphql/types.ts rename to x-pack/plugins/ingest/common/graphql/types.ts diff --git a/x-pack/plugins/infra/common/http_api/index.ts b/x-pack/plugins/ingest/common/http_api/index.ts similarity index 100% rename from x-pack/plugins/infra/common/http_api/index.ts rename to x-pack/plugins/ingest/common/http_api/index.ts diff --git a/x-pack/plugins/infra/common/http_api/search_results_api.ts b/x-pack/plugins/ingest/common/http_api/search_results_api.ts similarity index 100% rename from x-pack/plugins/infra/common/http_api/search_results_api.ts rename to x-pack/plugins/ingest/common/http_api/search_results_api.ts diff --git a/x-pack/plugins/infra/common/http_api/search_summary_api.ts b/x-pack/plugins/ingest/common/http_api/search_summary_api.ts similarity index 100% rename from x-pack/plugins/infra/common/http_api/search_summary_api.ts rename to x-pack/plugins/ingest/common/http_api/search_summary_api.ts diff --git a/x-pack/plugins/infra/common/http_api/timed_api.ts b/x-pack/plugins/ingest/common/http_api/timed_api.ts similarity index 100% rename from x-pack/plugins/infra/common/http_api/timed_api.ts rename to x-pack/plugins/ingest/common/http_api/timed_api.ts diff --git a/x-pack/plugins/infra/common/log_entry/index.ts b/x-pack/plugins/ingest/common/log_entry/index.ts similarity index 100% rename from x-pack/plugins/infra/common/log_entry/index.ts rename to x-pack/plugins/ingest/common/log_entry/index.ts diff --git a/x-pack/plugins/infra/common/log_entry/log_entry.ts b/x-pack/plugins/ingest/common/log_entry/log_entry.ts similarity index 100% rename from x-pack/plugins/infra/common/log_entry/log_entry.ts rename to x-pack/plugins/ingest/common/log_entry/log_entry.ts diff --git a/x-pack/plugins/infra/common/log_entry/log_entry_list.ts b/x-pack/plugins/ingest/common/log_entry/log_entry_list.ts similarity index 100% rename from x-pack/plugins/infra/common/log_entry/log_entry_list.ts rename to x-pack/plugins/ingest/common/log_entry/log_entry_list.ts diff --git a/x-pack/plugins/infra/common/log_search_result/index.ts b/x-pack/plugins/ingest/common/log_search_result/index.ts similarity index 100% rename from x-pack/plugins/infra/common/log_search_result/index.ts rename to x-pack/plugins/ingest/common/log_search_result/index.ts diff --git a/x-pack/plugins/infra/common/log_search_result/log_search_result.ts b/x-pack/plugins/ingest/common/log_search_result/log_search_result.ts similarity index 100% rename from x-pack/plugins/infra/common/log_search_result/log_search_result.ts rename to x-pack/plugins/ingest/common/log_search_result/log_search_result.ts diff --git a/x-pack/plugins/infra/common/log_search_summary/index.ts b/x-pack/plugins/ingest/common/log_search_summary/index.ts similarity index 100% rename from x-pack/plugins/infra/common/log_search_summary/index.ts rename to x-pack/plugins/ingest/common/log_search_summary/index.ts diff --git a/x-pack/plugins/infra/common/log_search_summary/log_search_summary.ts b/x-pack/plugins/ingest/common/log_search_summary/log_search_summary.ts similarity index 100% rename from x-pack/plugins/infra/common/log_search_summary/log_search_summary.ts rename to x-pack/plugins/ingest/common/log_search_summary/log_search_summary.ts diff --git a/x-pack/plugins/infra/common/log_summary/index.ts b/x-pack/plugins/ingest/common/log_summary/index.ts similarity index 100% rename from x-pack/plugins/infra/common/log_summary/index.ts rename to x-pack/plugins/ingest/common/log_summary/index.ts diff --git a/x-pack/plugins/infra/common/log_summary/log_summary.ts b/x-pack/plugins/ingest/common/log_summary/log_summary.ts similarity index 100% rename from x-pack/plugins/infra/common/log_summary/log_summary.ts rename to x-pack/plugins/ingest/common/log_summary/log_summary.ts diff --git a/x-pack/plugins/infra/common/log_text_scale/index.ts b/x-pack/plugins/ingest/common/log_text_scale/index.ts similarity index 100% rename from x-pack/plugins/infra/common/log_text_scale/index.ts rename to x-pack/plugins/ingest/common/log_text_scale/index.ts diff --git a/x-pack/plugins/infra/common/log_text_scale/log_text_scale.ts b/x-pack/plugins/ingest/common/log_text_scale/log_text_scale.ts similarity index 100% rename from x-pack/plugins/infra/common/log_text_scale/log_text_scale.ts rename to x-pack/plugins/ingest/common/log_text_scale/log_text_scale.ts diff --git a/x-pack/plugins/infra/common/time/index.ts b/x-pack/plugins/ingest/common/time/index.ts similarity index 100% rename from x-pack/plugins/infra/common/time/index.ts rename to x-pack/plugins/ingest/common/time/index.ts diff --git a/x-pack/plugins/infra/common/time/time.ts b/x-pack/plugins/ingest/common/time/time.ts similarity index 100% rename from x-pack/plugins/infra/common/time/time.ts rename to x-pack/plugins/ingest/common/time/time.ts diff --git a/x-pack/plugins/infra/common/time/time_key.ts b/x-pack/plugins/ingest/common/time/time_key.ts similarity index 100% rename from x-pack/plugins/infra/common/time/time_key.ts rename to x-pack/plugins/ingest/common/time/time_key.ts diff --git a/x-pack/plugins/infra/common/time/time_scale.ts b/x-pack/plugins/ingest/common/time/time_scale.ts similarity index 100% rename from x-pack/plugins/infra/common/time/time_scale.ts rename to x-pack/plugins/ingest/common/time/time_scale.ts diff --git a/x-pack/plugins/infra/common/time/time_unit.ts b/x-pack/plugins/ingest/common/time/time_unit.ts similarity index 100% rename from x-pack/plugins/infra/common/time/time_unit.ts rename to x-pack/plugins/ingest/common/time/time_unit.ts diff --git a/x-pack/plugins/infra/common/typed_json.ts b/x-pack/plugins/ingest/common/typed_json.ts similarity index 100% rename from x-pack/plugins/infra/common/typed_json.ts rename to x-pack/plugins/ingest/common/typed_json.ts diff --git a/x-pack/plugins/infra/docs/arch.md b/x-pack/plugins/ingest/docs/arch.md similarity index 100% rename from x-pack/plugins/infra/docs/arch.md rename to x-pack/plugins/ingest/docs/arch.md diff --git a/x-pack/plugins/infra/docs/arch_client.md b/x-pack/plugins/ingest/docs/arch_client.md similarity index 100% rename from x-pack/plugins/infra/docs/arch_client.md rename to x-pack/plugins/ingest/docs/arch_client.md diff --git a/x-pack/plugins/infra/docs/assets/arch.png b/x-pack/plugins/ingest/docs/assets/arch.png similarity index 100% rename from x-pack/plugins/infra/docs/assets/arch.png rename to x-pack/plugins/ingest/docs/assets/arch.png diff --git a/x-pack/plugins/infra/docs/graphql.md b/x-pack/plugins/ingest/docs/graphql.md similarity index 100% rename from x-pack/plugins/infra/docs/graphql.md rename to x-pack/plugins/ingest/docs/graphql.md diff --git a/x-pack/plugins/infra/index.ts b/x-pack/plugins/ingest/index.ts similarity index 67% rename from x-pack/plugins/infra/index.ts rename to x-pack/plugins/ingest/index.ts index 19fe46ee976d8..fefd3731843aa 100644 --- a/x-pack/plugins/infra/index.ts +++ b/x-pack/plugins/ingest/index.ts @@ -9,39 +9,40 @@ import { resolve } from 'path'; import { getConfigSchema, initServerWithKibana, KbnServer } from './server/kibana.index'; -const APP_ID = 'infra'; +const APP_ID = 'ingest'; -export function infra(kibana: any) { +export function ingest(kibana: any) { return new kibana.Plugin({ id: APP_ID, - configPrefix: 'xpack.infra', + configPrefix: 'xpack.ingest', publicDir: resolve(__dirname, 'public'), require: ['kibana', 'elasticsearch'], uiExports: { app: { description: 'Explore your infrastructure', - icon: 'plugins/infra/images/infra_mono_white.svg', - main: 'plugins/infra/app', + icon: 'plugins/ingest/images/infra_mono_white.svg', + euiIconType: 'infraApp', + main: 'plugins/ingest/app', title: 'InfraOps', listed: false, - url: `/app/${APP_ID}#/home`, + url: `/app/${APP_ID}#/infraops`, }, - home: ['plugins/infra/register_feature'], + home: ['plugins/ingest/register_feature'], links: [ { description: 'Explore your infrastructure', - icon: 'plugins/infra/images/infra_mono_white.svg', + icon: 'plugins/ingest/images/infra_mono_white.svg', euiIconType: 'infraApp', - id: 'infra:home', + id: 'infraops:home', order: 8000, - title: 'Infra Ops', - url: `/app/${APP_ID}#/home`, + title: 'InfraOps', + url: `/app/${APP_ID}#/infraops`, }, { description: 'Explore your logs', - icon: 'plugins/infra/images/logging_mono_white.svg', + icon: 'plugins/ingest/images/logging_mono_white.svg', euiIconType: 'loggingApp', - id: 'infra:logs', + id: 'infraops:logs', order: 8001, title: 'Logs', url: `/app/${APP_ID}#/logs`, diff --git a/x-pack/plugins/infra/package.json b/x-pack/plugins/ingest/package.json similarity index 94% rename from x-pack/plugins/infra/package.json rename to x-pack/plugins/ingest/package.json index ce926e897b681..a06a427e28958 100644 --- a/x-pack/plugins/infra/package.json +++ b/x-pack/plugins/ingest/package.json @@ -1,6 +1,6 @@ { "author": "Elastic", - "name": "infra", + "name": "ingest", "version": "7.0.0-alpha1", "scripts": { "build-graphql-types": "node scripts/generate_types_from_graphql.js" diff --git a/x-pack/plugins/infra/public/app.ts b/x-pack/plugins/ingest/public/app.ts similarity index 100% rename from x-pack/plugins/infra/public/app.ts rename to x-pack/plugins/ingest/public/app.ts diff --git a/x-pack/plugins/infra/public/apps/kibana_app.ts b/x-pack/plugins/ingest/public/apps/kibana_app.ts similarity index 100% rename from x-pack/plugins/infra/public/apps/kibana_app.ts rename to x-pack/plugins/ingest/public/apps/kibana_app.ts diff --git a/x-pack/plugins/infra/public/apps/start_app.tsx b/x-pack/plugins/ingest/public/apps/start_app.tsx similarity index 99% rename from x-pack/plugins/infra/public/apps/start_app.tsx rename to x-pack/plugins/ingest/public/apps/start_app.tsx index da32e65e8ffb0..b78b41e3bbb39 100644 --- a/x-pack/plugins/infra/public/apps/start_app.tsx +++ b/x-pack/plugins/ingest/public/apps/start_app.tsx @@ -21,7 +21,6 @@ import { createStore } from '../store'; export async function startApp(libs: InfraFrontendLibs) { const history = createHashHistory(); - const libs$ = new BehaviorSubject(libs); const store = createStore({ apolloClient: libs$.pipe(pluck('apolloClient')), diff --git a/x-pack/plugins/infra/public/apps/testing_app.ts b/x-pack/plugins/ingest/public/apps/testing_app.ts similarity index 100% rename from x-pack/plugins/infra/public/apps/testing_app.ts rename to x-pack/plugins/ingest/public/apps/testing_app.ts diff --git a/x-pack/plugins/infra/public/pages/404.tsx b/x-pack/plugins/ingest/public/components/404/index.tsx similarity index 100% rename from x-pack/plugins/infra/public/pages/404.tsx rename to x-pack/plugins/ingest/public/components/404/index.tsx diff --git a/x-pack/plugins/infra/public/components/auto_sizer.tsx b/x-pack/plugins/ingest/public/components/auto_sizer.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/auto_sizer.tsx rename to x-pack/plugins/ingest/public/components/auto_sizer.tsx diff --git a/x-pack/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx b/x-pack/plugins/ingest/public/components/autocomplete_field/autocomplete_field.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx rename to x-pack/plugins/ingest/public/components/autocomplete_field/autocomplete_field.tsx diff --git a/x-pack/plugins/infra/public/components/autocomplete_field/index.ts b/x-pack/plugins/ingest/public/components/autocomplete_field/index.ts similarity index 100% rename from x-pack/plugins/infra/public/components/autocomplete_field/index.ts rename to x-pack/plugins/ingest/public/components/autocomplete_field/index.ts diff --git a/x-pack/plugins/infra/public/components/autocomplete_field/suggestion_item.tsx b/x-pack/plugins/ingest/public/components/autocomplete_field/suggestion_item.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/autocomplete_field/suggestion_item.tsx rename to x-pack/plugins/ingest/public/components/autocomplete_field/suggestion_item.tsx diff --git a/x-pack/plugins/infra/public/components/empty_page.tsx b/x-pack/plugins/ingest/public/components/empty_page.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/empty_page.tsx rename to x-pack/plugins/ingest/public/components/empty_page.tsx diff --git a/x-pack/plugins/infra/public/pages/error.tsx b/x-pack/plugins/ingest/public/components/error/index.tsx similarity index 92% rename from x-pack/plugins/infra/public/pages/error.tsx rename to x-pack/plugins/ingest/public/components/error/index.tsx index 75b158c42c5a1..f04952b9f6434 100644 --- a/x-pack/plugins/infra/public/pages/error.tsx +++ b/x-pack/plugins/ingest/public/components/error/index.tsx @@ -14,8 +14,8 @@ import { } from '@elastic/eui'; import React from 'react'; import styled from 'styled-components'; -import { Header } from '../components/header'; -import { ColumnarPage, PageContent } from '../components/page'; +import { Header } from '../header'; +import { ColumnarPage, PageContent } from '../page'; const DetailPageContent = styled(PageContent)` overflow: auto; diff --git a/x-pack/plugins/infra/public/components/eui/index.ts b/x-pack/plugins/ingest/public/components/eui/index.ts similarity index 100% rename from x-pack/plugins/infra/public/components/eui/index.ts rename to x-pack/plugins/ingest/public/components/eui/index.ts diff --git a/x-pack/plugins/infra/public/components/eui/toolbar/index.ts b/x-pack/plugins/ingest/public/components/eui/toolbar/index.ts similarity index 100% rename from x-pack/plugins/infra/public/components/eui/toolbar/index.ts rename to x-pack/plugins/ingest/public/components/eui/toolbar/index.ts diff --git a/x-pack/plugins/infra/public/components/eui/toolbar/toolbar.tsx b/x-pack/plugins/ingest/public/components/eui/toolbar/toolbar.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/eui/toolbar/toolbar.tsx rename to x-pack/plugins/ingest/public/components/eui/toolbar/toolbar.tsx diff --git a/x-pack/plugins/infra/public/components/header.tsx b/x-pack/plugins/ingest/public/components/header.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/header.tsx rename to x-pack/plugins/ingest/public/components/header.tsx diff --git a/x-pack/plugins/infra/public/components/loading/index.tsx b/x-pack/plugins/ingest/public/components/loading/index.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/loading/index.tsx rename to x-pack/plugins/ingest/public/components/loading/index.tsx diff --git a/x-pack/plugins/infra/public/components/loading_page.tsx b/x-pack/plugins/ingest/public/components/loading_page.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/loading_page.tsx rename to x-pack/plugins/ingest/public/components/loading_page.tsx diff --git a/x-pack/plugins/infra/public/components/page.tsx b/x-pack/plugins/ingest/public/components/page.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/page.tsx rename to x-pack/plugins/ingest/public/components/page.tsx diff --git a/x-pack/plugins/infra/public/components/range_date_picker/index.tsx b/x-pack/plugins/ingest/public/components/range_date_picker/index.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/range_date_picker/index.tsx rename to x-pack/plugins/ingest/public/components/range_date_picker/index.tsx diff --git a/x-pack/plugins/infra/public/images/docker.svg b/x-pack/plugins/ingest/public/images/docker.svg similarity index 100% rename from x-pack/plugins/infra/public/images/docker.svg rename to x-pack/plugins/ingest/public/images/docker.svg diff --git a/x-pack/plugins/infra/public/images/hosts.svg b/x-pack/plugins/ingest/public/images/hosts.svg similarity index 100% rename from x-pack/plugins/infra/public/images/hosts.svg rename to x-pack/plugins/ingest/public/images/hosts.svg diff --git a/x-pack/plugins/infra/public/images/infra_mono_white.svg b/x-pack/plugins/ingest/public/images/infra_mono_white.svg similarity index 100% rename from x-pack/plugins/infra/public/images/infra_mono_white.svg rename to x-pack/plugins/ingest/public/images/infra_mono_white.svg diff --git a/x-pack/plugins/infra/public/images/k8.svg b/x-pack/plugins/ingest/public/images/k8.svg similarity index 100% rename from x-pack/plugins/infra/public/images/k8.svg rename to x-pack/plugins/ingest/public/images/k8.svg diff --git a/x-pack/plugins/infra/public/images/logging_mono_white.svg b/x-pack/plugins/ingest/public/images/logging_mono_white.svg similarity index 100% rename from x-pack/plugins/infra/public/images/logging_mono_white.svg rename to x-pack/plugins/ingest/public/images/logging_mono_white.svg diff --git a/x-pack/plugins/infra/public/images/services.svg b/x-pack/plugins/ingest/public/images/services.svg similarity index 100% rename from x-pack/plugins/infra/public/images/services.svg rename to x-pack/plugins/ingest/public/images/services.svg diff --git a/x-pack/plugins/ingest/public/infraops/app.tsx b/x-pack/plugins/ingest/public/infraops/app.tsx new file mode 100644 index 0000000000000..3485c998c2fc1 --- /dev/null +++ b/x-pack/plugins/ingest/public/infraops/app.tsx @@ -0,0 +1,11 @@ +/* + * 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 React from 'react'; + +import { InfraOpsRoutes } from './routes'; + +export const InfraOpsApp: React.SFC = () => ; diff --git a/x-pack/plugins/infra/public/components/metrics/index.tsx b/x-pack/plugins/ingest/public/infraops/components/metrics/index.tsx similarity index 92% rename from x-pack/plugins/infra/public/components/metrics/index.tsx rename to x-pack/plugins/ingest/public/infraops/components/metrics/index.tsx index c9475ef4a48f0..8f6255cd195e0 100644 --- a/x-pack/plugins/infra/public/components/metrics/index.tsx +++ b/x-pack/plugins/ingest/public/infraops/components/metrics/index.tsx @@ -7,10 +7,10 @@ import { EuiPageContentBody, EuiTitle } from '@elastic/eui'; import React from 'react'; -import { InfraMetricData } from '../../../common/graphql/types'; +import { InfraMetricData } from '../../../../common/graphql/types'; +import { InfraLoadingPanel } from '../../../components/loading'; +import { metricTimeActions } from '../../../store'; import { InfraMetricLayout, InfraMetricLayoutSection } from '../../pages/metrics/layouts/types'; -import { metricTimeActions } from '../../store'; -import { InfraLoadingPanel } from '../loading'; import { Section } from './section'; interface Props { diff --git a/x-pack/plugins/infra/public/components/metrics/section.tsx b/x-pack/plugins/ingest/public/infraops/components/metrics/section.tsx similarity index 91% rename from x-pack/plugins/infra/public/components/metrics/section.tsx rename to x-pack/plugins/ingest/public/infraops/components/metrics/section.tsx index 89170d053b3a9..7baa2f95251cb 100644 --- a/x-pack/plugins/infra/public/components/metrics/section.tsx +++ b/x-pack/plugins/ingest/public/infraops/components/metrics/section.tsx @@ -5,9 +5,9 @@ */ import React from 'react'; -import { InfraMetricData } from '../../../common/graphql/types'; +import { InfraMetricData } from '../../../../common/graphql/types'; +import { metricTimeActions } from '../../../store'; import { InfraMetricLayoutSection } from '../../pages/metrics/layouts/types'; -import { metricTimeActions } from '../../store'; import { sections } from './sections'; interface Props { diff --git a/x-pack/plugins/infra/public/components/metrics/sections/chart_section.tsx b/x-pack/plugins/ingest/public/infraops/components/metrics/sections/chart_section.tsx similarity index 96% rename from x-pack/plugins/infra/public/components/metrics/sections/chart_section.tsx rename to x-pack/plugins/ingest/public/infraops/components/metrics/sections/chart_section.tsx index 290656b707d78..74374af0357f4 100644 --- a/x-pack/plugins/infra/public/components/metrics/sections/chart_section.tsx +++ b/x-pack/plugins/ingest/public/infraops/components/metrics/sections/chart_section.tsx @@ -20,14 +20,14 @@ import Color from 'color'; import { get } from 'lodash'; import moment from 'moment'; import React, { ReactText } from 'react'; -import { InfraDataSeries, InfraMetricData } from '../../../../common/graphql/types'; -import { InfraFormatter, InfraFormatterType } from '../../../lib/lib'; +import { InfraDataSeries, InfraMetricData } from '../../../../../common/graphql/types'; +import { InfraFormatter, InfraFormatterType } from '../../../../lib/lib'; +import { metricTimeActions } from '../../../../store'; +import { createFormatter } from '../../../../utils/formatters'; import { InfraMetricLayoutSection, InfraMetricLayoutVisualizationType, } from '../../../pages/metrics/layouts/types'; -import { metricTimeActions } from '../../../store'; -import { createFormatter } from '../../../utils/formatters'; const MARGIN_LEFT = 60; const chartComponentsByType = { diff --git a/x-pack/plugins/infra/public/components/metrics/sections/gauges_section.tsx b/x-pack/plugins/ingest/public/infraops/components/metrics/sections/gauges_section.tsx similarity index 94% rename from x-pack/plugins/infra/public/components/metrics/sections/gauges_section.tsx rename to x-pack/plugins/ingest/public/infraops/components/metrics/sections/gauges_section.tsx index af58fe80230d4..37b71d172e2cb 100644 --- a/x-pack/plugins/infra/public/components/metrics/sections/gauges_section.tsx +++ b/x-pack/plugins/ingest/public/infraops/components/metrics/sections/gauges_section.tsx @@ -16,10 +16,10 @@ import { import { get, last, max } from 'lodash'; import React, { ReactText } from 'react'; import styled from 'styled-components'; -import { InfraMetricData } from '../../../../common/graphql/types'; -import { InfraFormatterType } from '../../../lib/lib'; +import { InfraMetricData } from '../../../../../common/graphql/types'; +import { InfraFormatterType } from '../../../../lib/lib'; +import { createFormatter } from '../../../../utils/formatters'; import { InfraMetricLayoutSection } from '../../../pages/metrics/layouts/types'; -import { createFormatter } from '../../../utils/formatters'; interface Props { section: InfraMetricLayoutSection; diff --git a/x-pack/plugins/infra/public/components/metrics/sections/index.ts b/x-pack/plugins/ingest/public/infraops/components/metrics/sections/index.ts similarity index 100% rename from x-pack/plugins/infra/public/components/metrics/sections/index.ts rename to x-pack/plugins/ingest/public/infraops/components/metrics/sections/index.ts diff --git a/x-pack/plugins/infra/public/components/metrics/time_controls.tsx b/x-pack/plugins/ingest/public/infraops/components/metrics/time_controls.tsx similarity index 97% rename from x-pack/plugins/infra/public/components/metrics/time_controls.tsx rename to x-pack/plugins/ingest/public/infraops/components/metrics/time_controls.tsx index f9209fbb16ccd..4654ef289b730 100644 --- a/x-pack/plugins/infra/public/components/metrics/time_controls.tsx +++ b/x-pack/plugins/ingest/public/infraops/components/metrics/time_controls.tsx @@ -9,9 +9,9 @@ import moment, { Moment } from 'moment'; import React from 'react'; import styled from 'styled-components'; -import { RangeDatePicker, RecentlyUsed } from '../range_date_picker'; +import { RangeDatePicker, RecentlyUsed } from '../../../components/range_date_picker'; -import { metricTimeActions } from '../../store'; +import { metricTimeActions } from '../../../store'; interface MetricsTimeControlsProps { currentTimeRange: metricTimeActions.MetricRangeTimeState; diff --git a/x-pack/plugins/infra/public/components/waffle/gradient_legend.tsx b/x-pack/plugins/ingest/public/infraops/components/waffle/gradient_legend.tsx similarity index 98% rename from x-pack/plugins/infra/public/components/waffle/gradient_legend.tsx rename to x-pack/plugins/ingest/public/infraops/components/waffle/gradient_legend.tsx index 24ec7bafd391f..68072c33fae83 100644 --- a/x-pack/plugins/infra/public/components/waffle/gradient_legend.tsx +++ b/x-pack/plugins/ingest/public/infraops/components/waffle/gradient_legend.tsx @@ -11,7 +11,7 @@ import { InfraWaffleMapBounds, InfraWaffleMapGradientLegend, InfraWaffleMapGradientRule, -} from '../../lib/lib'; +} from '../../../lib/lib'; interface Props { legend: InfraWaffleMapGradientLegend; diff --git a/x-pack/plugins/infra/public/components/waffle/group_name.tsx b/x-pack/plugins/ingest/public/infraops/components/waffle/group_name.tsx similarity index 69% rename from x-pack/plugins/infra/public/components/waffle/group_name.tsx rename to x-pack/plugins/ingest/public/infraops/components/waffle/group_name.tsx index 0d4b91c494f3a..0aa9e94637be6 100644 --- a/x-pack/plugins/infra/public/components/waffle/group_name.tsx +++ b/x-pack/plugins/ingest/public/infraops/components/waffle/group_name.tsx @@ -6,12 +6,14 @@ import { EuiLink, EuiToolTip } from '@elastic/eui'; import React from 'react'; import styled from 'styled-components'; -import { InfraWaffleMapGroup } from '../../lib/lib'; +import { InfraPathType } from '../../../../common/graphql/types'; +import { InfraWaffleMapGroup, InfraWaffleMapOptions } from '../../../lib/lib'; interface Props { - onDrilldown: () => void; + onDrilldown: (filter: string) => void; group: InfraWaffleMapGroup; isChild?: boolean; + options: InfraWaffleMapOptions; } export class GroupName extends React.PureComponent { @@ -37,9 +39,22 @@ export class GroupName extends React.PureComponent { } private handleClick = (event: React.MouseEvent) => { - // TODO: fill this in with group click handler event.preventDefault(); - this.props.onDrilldown(); + const { groupBy } = this.props.options; + // When groupBy is empty that means there is nothing todo so let's just do nothing. + if (groupBy.length === 0) { + return; + } + const currentPath = this.props.isChild && groupBy.length > 1 ? groupBy[1] : groupBy[0]; + if (currentPath.type === InfraPathType.terms && currentPath.field) { + this.props.onDrilldown(`${currentPath.field}: "${this.props.group.name}"`); + } + if (currentPath.type === InfraPathType.filters && currentPath.filters) { + const currentFilter = currentPath.filters.find(f => f.label === this.props.group.name); + if (currentFilter) { + this.props.onDrilldown(currentFilter.query); + } + } }; } @@ -47,7 +62,7 @@ const GroupNameContainer = styled.div` position: relative; text-align: center font-size: 16px; - margin-bottom: 5px; + margin-bottom: 5px; top: 20px; display: flex; justify-content: center; diff --git a/x-pack/plugins/infra/public/components/waffle/group_of_groups.tsx b/x-pack/plugins/ingest/public/infraops/components/waffle/group_of_groups.tsx similarity index 90% rename from x-pack/plugins/infra/public/components/waffle/group_of_groups.tsx rename to x-pack/plugins/ingest/public/infraops/components/waffle/group_of_groups.tsx index 5445d18132156..594df4ddc540f 100644 --- a/x-pack/plugins/infra/public/components/waffle/group_of_groups.tsx +++ b/x-pack/plugins/ingest/public/infraops/components/waffle/group_of_groups.tsx @@ -6,17 +6,17 @@ import React from 'react'; import styled from 'styled-components'; -import { InfraNodeType } from '../../../common/graphql/types'; +import { InfraNodeType } from '../../../../common/graphql/types'; import { InfraWaffleMapBounds, InfraWaffleMapGroupOfGroups, InfraWaffleMapOptions, -} from '../../lib/lib'; +} from '../../../lib/lib'; import { GroupName } from './group_name'; import { GroupOfNodes } from './group_of_nodes'; interface Props { - onDrilldown: () => void; + onDrilldown: (filter: string) => void; options: InfraWaffleMapOptions; group: InfraWaffleMapGroupOfGroups; formatter: (val: number) => string; @@ -27,7 +27,7 @@ interface Props { export const GroupOfGroups: React.SFC = props => { return ( - + {props.group.groups.map(group => ( void; + onDrilldown: (filter: string) => void; options: InfraWaffleMapOptions; group: InfraWaffleMapGroupOfNodes; formatter: (val: number) => string; @@ -37,7 +37,7 @@ export const GroupOfNodes: React.SFC = ({ const width = group.width > 200 ? group.width : 200; return ( - + {group.nodes.map(node => ( = ({ options={options} squareSize={group.squareSize} node={node} - onDrilldown={onDrilldown} formatter={formatter} bounds={bounds} nodeType={nodeType} diff --git a/x-pack/plugins/infra/public/components/waffle/index.tsx b/x-pack/plugins/ingest/public/infraops/components/waffle/index.tsx similarity index 91% rename from x-pack/plugins/infra/public/components/waffle/index.tsx rename to x-pack/plugins/ingest/public/infraops/components/waffle/index.tsx index f379540419c8a..bb12df311e0e8 100644 --- a/x-pack/plugins/infra/public/components/waffle/index.tsx +++ b/x-pack/plugins/ingest/public/infraops/components/waffle/index.tsx @@ -7,21 +7,22 @@ import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; import { get, max, min } from 'lodash'; import React from 'react'; import styled from 'styled-components'; -import { InfraMetricType, InfraNodeType } from '../../../common/graphql/types'; -import { - isWaffleMapGroupWithGroups, - isWaffleMapGroupWithNodes, -} from '../../containers/waffle/type_guards'; +import { InfraMetricType, InfraNodeType } from '../../../../common/graphql/types'; +import { AutoSizer } from '../../../components/auto_sizer'; +import { InfraLoadingPanel } from '../../../components/loading'; import { InfraFormatterType, InfraWaffleData, InfraWaffleMapBounds, InfraWaffleMapGroup, InfraWaffleMapOptions, -} from '../../lib/lib'; -import { createFormatter } from '../../utils/formatters'; -import { AutoSizer } from '../auto_sizer'; -import { InfraLoadingPanel } from '../loading'; +} from '../../../lib/lib'; +import { KueryFilterQuery } from '../../../store/local/waffle_filter'; +import { createFormatter } from '../../../utils/formatters'; +import { + isWaffleMapGroupWithGroups, + isWaffleMapGroupWithNodes, +} from '../../containers/waffle/type_guards'; import { GroupOfGroups } from './group_of_groups'; import { GroupOfNodes } from './group_of_nodes'; import { Legend } from './legend'; @@ -33,6 +34,7 @@ interface Props { map: InfraWaffleData; loading: boolean; reload: () => void; + onDrilldown: (filter: KueryFilterQuery) => void; } interface MetricFormatter { @@ -159,9 +161,13 @@ export class Waffle extends React.Component { return formatter(val); }; - private handleDrilldown() { + private handleDrilldown = (filter: string) => { + this.props.onDrilldown({ + kind: 'kuery', + expression: filter, + }); return; - } + }; private renderGroup = (bounds: InfraWaffleMapBounds) => (group: InfraWaffleMapGroup) => { if (isWaffleMapGroupWithGroups(group)) { diff --git a/x-pack/plugins/infra/public/components/waffle/legend.tsx b/x-pack/plugins/ingest/public/infraops/components/waffle/legend.tsx similarity index 97% rename from x-pack/plugins/infra/public/components/waffle/legend.tsx rename to x-pack/plugins/ingest/public/infraops/components/waffle/legend.tsx index 2ce97372a9726..d7865bbee1077 100644 --- a/x-pack/plugins/infra/public/components/waffle/legend.tsx +++ b/x-pack/plugins/ingest/public/infraops/components/waffle/legend.tsx @@ -5,7 +5,7 @@ */ import React from 'react'; import styled from 'styled-components'; -import { InfraFormatter, InfraWaffleMapBounds, InfraWaffleMapLegend } from '../../lib/lib'; +import { InfraFormatter, InfraWaffleMapBounds, InfraWaffleMapLegend } from '../../../lib/lib'; import { GradientLegend } from './gradient_legend'; import { isInfraWaffleMapGradientLegend, isInfraWaffleMapStepLegend } from './lib/type_guards'; import { StepLegend } from './steps_legend'; diff --git a/x-pack/plugins/infra/public/components/waffle/lib/apply_wafflemap_layout.ts b/x-pack/plugins/ingest/public/infraops/components/waffle/lib/apply_wafflemap_layout.ts similarity index 98% rename from x-pack/plugins/infra/public/components/waffle/lib/apply_wafflemap_layout.ts rename to x-pack/plugins/ingest/public/infraops/components/waffle/lib/apply_wafflemap_layout.ts index 5f3c06fcfbba7..87fd17cef288e 100644 --- a/x-pack/plugins/infra/public/components/waffle/lib/apply_wafflemap_layout.ts +++ b/x-pack/plugins/ingest/public/infraops/components/waffle/lib/apply_wafflemap_layout.ts @@ -4,11 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ import { first, sortBy } from 'lodash'; +import { InfraWaffleMapGroup } from '../../../../lib/lib'; import { isWaffleMapGroupWithGroups, isWaffleMapGroupWithNodes, } from '../../../containers/waffle/type_guards'; -import { InfraWaffleMapGroup } from '../../../lib/lib'; import { sizeOfSquares } from './size_of_squares'; export function getColumns(n: number, w = 1, h = 1) { diff --git a/x-pack/plugins/infra/public/components/waffle/lib/color_from_value.ts b/x-pack/plugins/ingest/public/infraops/components/waffle/lib/color_from_value.ts similarity index 98% rename from x-pack/plugins/infra/public/components/waffle/lib/color_from_value.ts rename to x-pack/plugins/ingest/public/infraops/components/waffle/lib/color_from_value.ts index c6bfd45502f3d..b91066b3307ec 100644 --- a/x-pack/plugins/infra/public/components/waffle/lib/color_from_value.ts +++ b/x-pack/plugins/ingest/public/infraops/components/waffle/lib/color_from_value.ts @@ -12,7 +12,7 @@ import { InfraWaffleMapLegend, InfraWaffleMapRuleOperator, InfraWaffleMapStepLegend, -} from '../../../lib/lib'; +} from '../../../../lib/lib'; import { isInfraWaffleMapGradientLegend, isInfraWaffleMapStepLegend } from './type_guards'; const OPERATOR_TO_FN = { diff --git a/x-pack/plugins/infra/public/components/waffle/lib/size_of_squares.ts b/x-pack/plugins/ingest/public/infraops/components/waffle/lib/size_of_squares.ts similarity index 100% rename from x-pack/plugins/infra/public/components/waffle/lib/size_of_squares.ts rename to x-pack/plugins/ingest/public/infraops/components/waffle/lib/size_of_squares.ts diff --git a/x-pack/plugins/infra/public/components/waffle/lib/type_guards.ts b/x-pack/plugins/ingest/public/infraops/components/waffle/lib/type_guards.ts similarity index 95% rename from x-pack/plugins/infra/public/components/waffle/lib/type_guards.ts rename to x-pack/plugins/ingest/public/infraops/components/waffle/lib/type_guards.ts index aff16374ae262..8dbcab1029906 100644 --- a/x-pack/plugins/infra/public/components/waffle/lib/type_guards.ts +++ b/x-pack/plugins/ingest/public/infraops/components/waffle/lib/type_guards.ts @@ -8,7 +8,7 @@ import { InfraWaffleMapGradientLegend, InfraWaffleMapLegendMode, InfraWaffleMapStepLegend, -} from '../../../lib/lib'; +} from '../../../../lib/lib'; export function isInfraWaffleMapStepLegend(subject: any): subject is InfraWaffleMapStepLegend { return subject.type && subject.type === InfraWaffleMapLegendMode.step; } diff --git a/x-pack/plugins/infra/public/components/waffle/node.tsx b/x-pack/plugins/ingest/public/infraops/components/waffle/node.tsx similarity index 96% rename from x-pack/plugins/infra/public/components/waffle/node.tsx rename to x-pack/plugins/ingest/public/infraops/components/waffle/node.tsx index 08792a3f36209..8fc5cbbe718ab 100644 --- a/x-pack/plugins/infra/public/components/waffle/node.tsx +++ b/x-pack/plugins/ingest/public/infraops/components/waffle/node.tsx @@ -8,8 +8,8 @@ import { EuiToolTip } from '@elastic/eui'; import { darken, readableColor } from 'polished'; import React from 'react'; import styled from 'styled-components'; -import { InfraNodeType } from '../../../server/lib/adapters/nodes'; -import { InfraWaffleMapBounds, InfraWaffleMapNode, InfraWaffleMapOptions } from '../../lib/lib'; +import { InfraNodeType } from '../../../../server/lib/adapters/nodes'; +import { InfraWaffleMapBounds, InfraWaffleMapNode, InfraWaffleMapOptions } from '../../../lib/lib'; import { colorFromValue } from './lib/color_from_value'; import { NodeContextMenu } from './node_context_menu'; @@ -20,7 +20,6 @@ const initialState = { type State = Readonly; interface Props { - onDrilldown: () => void; squareSize: number; options: InfraWaffleMapOptions; node: InfraWaffleMapNode; diff --git a/x-pack/plugins/infra/public/components/waffle/node_context_menu.tsx b/x-pack/plugins/ingest/public/infraops/components/waffle/node_context_menu.tsx similarity index 96% rename from x-pack/plugins/infra/public/components/waffle/node_context_menu.tsx rename to x-pack/plugins/ingest/public/infraops/components/waffle/node_context_menu.tsx index 73e774047cea4..2ccb2f2e7a3af 100644 --- a/x-pack/plugins/infra/public/components/waffle/node_context_menu.tsx +++ b/x-pack/plugins/ingest/public/infraops/components/waffle/node_context_menu.tsx @@ -6,8 +6,8 @@ import { EuiContextMenu, EuiContextMenuPanelDescriptor, EuiPopover } from '@elastic/eui'; import React from 'react'; -import { InfraNodeType } from '../../../common/graphql/types'; -import { InfraWaffleMapNode, InfraWaffleMapOptions } from '../../lib/lib'; +import { InfraNodeType } from '../../../../common/graphql/types'; +import { InfraWaffleMapNode, InfraWaffleMapOptions } from '../../../lib/lib'; import { getContainerDetailUrl, getContainerLogsUrl, @@ -15,7 +15,7 @@ import { getHostLogsUrl, getPodDetailUrl, getPodLogsUrl, -} from '../../pages/link_to'; +} from '../../../link_to'; interface Props { options: InfraWaffleMapOptions; diff --git a/x-pack/plugins/infra/public/components/waffle/steps_legend.tsx b/x-pack/plugins/ingest/public/infraops/components/waffle/steps_legend.tsx similarity index 98% rename from x-pack/plugins/infra/public/components/waffle/steps_legend.tsx rename to x-pack/plugins/ingest/public/infraops/components/waffle/steps_legend.tsx index 12964989e1b18..38ad1614a91af 100644 --- a/x-pack/plugins/infra/public/components/waffle/steps_legend.tsx +++ b/x-pack/plugins/ingest/public/infraops/components/waffle/steps_legend.tsx @@ -12,7 +12,7 @@ import { InfraWaffleMapRuleOperator, InfraWaffleMapStepLegend, InfraWaffleMapStepRule, -} from '../../lib/lib'; +} from '../../../lib/lib'; const OPERATORS = { [InfraWaffleMapRuleOperator.gte]: '>=', diff --git a/x-pack/plugins/infra/public/components/waffle/waffle_group_by_controls.tsx b/x-pack/plugins/ingest/public/infraops/components/waffle/waffle_group_by_controls.tsx similarity index 99% rename from x-pack/plugins/infra/public/components/waffle/waffle_group_by_controls.tsx rename to x-pack/plugins/ingest/public/infraops/components/waffle/waffle_group_by_controls.tsx index d07ec7bedc2a1..5290216d45cdc 100644 --- a/x-pack/plugins/infra/public/components/waffle/waffle_group_by_controls.tsx +++ b/x-pack/plugins/ingest/public/infraops/components/waffle/waffle_group_by_controls.tsx @@ -13,7 +13,7 @@ import { EuiPopover, } from '@elastic/eui'; import React from 'react'; -import { InfraNodeType, InfraPathInput, InfraPathType } from '../../../common/graphql/types'; +import { InfraNodeType, InfraPathInput, InfraPathType } from '../../../../common/graphql/types'; interface Props { nodeType: InfraNodeType; diff --git a/x-pack/plugins/infra/public/components/waffle/waffle_metric_controls.tsx b/x-pack/plugins/ingest/public/infraops/components/waffle/waffle_metric_controls.tsx similarity index 98% rename from x-pack/plugins/infra/public/components/waffle/waffle_metric_controls.tsx rename to x-pack/plugins/ingest/public/infraops/components/waffle/waffle_metric_controls.tsx index fe9b015e62457..81b32e250cc95 100644 --- a/x-pack/plugins/infra/public/components/waffle/waffle_metric_controls.tsx +++ b/x-pack/plugins/ingest/public/infraops/components/waffle/waffle_metric_controls.tsx @@ -12,7 +12,7 @@ import { EuiPopover, } from '@elastic/eui'; import React from 'react'; -import { InfraMetricInput, InfraMetricType, InfraNodeType } from '../../../common/graphql/types'; +import { InfraMetricInput, InfraMetricType, InfraNodeType } from '../../../../common/graphql/types'; interface Props { nodeType: InfraNodeType; metric: InfraMetricInput; diff --git a/x-pack/plugins/infra/public/components/waffle/waffle_node_type_switcher.tsx b/x-pack/plugins/ingest/public/infraops/components/waffle/waffle_node_type_switcher.tsx similarity index 82% rename from x-pack/plugins/infra/public/components/waffle/waffle_node_type_switcher.tsx rename to x-pack/plugins/ingest/public/infraops/components/waffle/waffle_node_type_switcher.tsx index e1071261a8de6..eb380901257d1 100644 --- a/x-pack/plugins/infra/public/components/waffle/waffle_node_type_switcher.tsx +++ b/x-pack/plugins/ingest/public/infraops/components/waffle/waffle_node_type_switcher.tsx @@ -11,7 +11,7 @@ import { InfraMetricType, InfraNodeType, InfraPathInput, -} from '../../../common/graphql/types'; +} from '../../../../common/graphql/types'; interface Props { nodeType: InfraNodeType; @@ -25,13 +25,13 @@ export class WaffleNodeTypeSwitcher extends React.PureComponent { return ( - + - + - + ); diff --git a/x-pack/plugins/infra/public/components/waffle/waffle_time_controls.tsx b/x-pack/plugins/ingest/public/infraops/components/waffle/waffle_time_controls.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/waffle/waffle_time_controls.tsx rename to x-pack/plugins/ingest/public/infraops/components/waffle/waffle_time_controls.tsx diff --git a/x-pack/plugins/infra/public/containers/capabilities/capabilities.gql_query.ts b/x-pack/plugins/ingest/public/infraops/containers/capabilities/capabilities.gql_query.ts similarity index 100% rename from x-pack/plugins/infra/public/containers/capabilities/capabilities.gql_query.ts rename to x-pack/plugins/ingest/public/infraops/containers/capabilities/capabilities.gql_query.ts diff --git a/x-pack/plugins/infra/public/containers/capabilities/with_capabilites.tsx b/x-pack/plugins/ingest/public/infraops/containers/capabilities/with_capabilites.tsx similarity index 96% rename from x-pack/plugins/infra/public/containers/capabilities/with_capabilites.tsx rename to x-pack/plugins/ingest/public/infraops/containers/capabilities/with_capabilites.tsx index efdcb0e70e1d8..33b6c772f9837 100644 --- a/x-pack/plugins/infra/public/containers/capabilities/with_capabilites.tsx +++ b/x-pack/plugins/ingest/public/infraops/containers/capabilities/with_capabilites.tsx @@ -8,7 +8,7 @@ import _ from 'lodash'; import React from 'react'; import { Query } from 'react-apollo'; -import { CapabilitiesQuery, InfraNodeType } from '../../../common/graphql/types'; +import { CapabilitiesQuery, InfraNodeType } from '../../../../common/graphql/types'; import { InfraMetricLayout } from '../../pages/metrics/layouts/types'; import { capabilitiesQuery } from './capabilities.gql_query'; diff --git a/x-pack/plugins/infra/public/containers/host/index.ts b/x-pack/plugins/ingest/public/infraops/containers/host/index.ts similarity index 100% rename from x-pack/plugins/infra/public/containers/host/index.ts rename to x-pack/plugins/ingest/public/infraops/containers/host/index.ts diff --git a/x-pack/plugins/infra/public/containers/host/with_all_hosts.ts b/x-pack/plugins/ingest/public/infraops/containers/host/with_all_hosts.ts similarity index 100% rename from x-pack/plugins/infra/public/containers/host/with_all_hosts.ts rename to x-pack/plugins/ingest/public/infraops/containers/host/with_all_hosts.ts diff --git a/x-pack/plugins/infra/public/containers/metrics/metrics.gql_query.ts b/x-pack/plugins/ingest/public/infraops/containers/metrics/metrics.gql_query.ts similarity index 100% rename from x-pack/plugins/infra/public/containers/metrics/metrics.gql_query.ts rename to x-pack/plugins/ingest/public/infraops/containers/metrics/metrics.gql_query.ts diff --git a/x-pack/plugins/infra/public/containers/metrics/with_metrics.tsx b/x-pack/plugins/ingest/public/infraops/containers/metrics/with_metrics.tsx similarity index 97% rename from x-pack/plugins/infra/public/containers/metrics/with_metrics.tsx rename to x-pack/plugins/ingest/public/infraops/containers/metrics/with_metrics.tsx index 9f44a24f4893c..b927bd82b94cf 100644 --- a/x-pack/plugins/infra/public/containers/metrics/with_metrics.tsx +++ b/x-pack/plugins/ingest/public/infraops/containers/metrics/with_metrics.tsx @@ -12,7 +12,7 @@ import { InfraNodeType, InfraTimerangeInput, MetricsQuery, -} from '../../../common/graphql/types'; +} from '../../../../common/graphql/types'; import { InfraMetricLayout } from '../../pages/metrics/layouts/types'; import { metricsQuery } from './metrics.gql_query'; diff --git a/x-pack/plugins/infra/public/containers/metrics/with_metrics_time.tsx b/x-pack/plugins/ingest/public/infraops/containers/metrics/with_metrics_time.tsx similarity index 82% rename from x-pack/plugins/infra/public/containers/metrics/with_metrics_time.tsx rename to x-pack/plugins/ingest/public/infraops/containers/metrics/with_metrics_time.tsx index c2d4fdcc62322..74d38dc5603eb 100644 --- a/x-pack/plugins/infra/public/containers/metrics/with_metrics_time.tsx +++ b/x-pack/plugins/ingest/public/infraops/containers/metrics/with_metrics_time.tsx @@ -8,10 +8,10 @@ import React from 'react'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; -import { metricTimeActions, metricTimeSelectors, State } from '../../store'; -import { asChildFunctionRenderer } from '../../utils/typed_react'; -import { bindPlainActionCreators } from '../../utils/typed_redux'; -import { UrlStateContainer } from '../../utils/url_state'; +import { metricTimeActions, metricTimeSelectors, State } from '../../../store'; +import { asChildFunctionRenderer } from '../../../utils/typed_react'; +import { bindPlainActionCreators } from '../../../utils/typed_redux'; +import { UrlStateContainer } from '../../../utils/url_state'; export const withMetricsTime = connect( (state: State) => ({ @@ -35,7 +35,7 @@ export const WithMetricsTime = asChildFunctionRenderer(withMetricsTime, { */ interface MetricTimeUrlState { - timeRange?: ReturnType; + time?: ReturnType; autoReload?: ReturnType; } @@ -47,8 +47,8 @@ export const WithMetricsTimeUrlState = () => ( urlStateKey="metricTime" mapToUrlState={mapToUrlState} onChange={newUrlState => { - if (newUrlState && newUrlState.timeRange) { - setRangeTime(newUrlState.timeRange); + if (newUrlState && newUrlState.time) { + setRangeTime(newUrlState.time); } if (newUrlState && newUrlState.autoReload) { startMetricsAutoReload(); @@ -61,8 +61,8 @@ export const WithMetricsTimeUrlState = () => ( } }} onInitialize={initialUrlState => { - if (initialUrlState && initialUrlState.timeRange) { - setRangeTime(initialUrlState.timeRange); + if (initialUrlState && initialUrlState.time) { + setRangeTime(initialUrlState.time); } if (initialUrlState && initialUrlState.autoReload) { startMetricsAutoReload(); @@ -85,7 +85,7 @@ const selectTimeUrlState = createSelector( const mapToUrlState = (value: any): MetricTimeUrlState | undefined => value ? { - timeRange: mapToTimeUrlState(value.timeRange), + time: mapToTimeUrlState(value.time), autoReload: mapToAutoReloadUrlState(value.autoReload), } : undefined; diff --git a/x-pack/plugins/infra/public/containers/waffle/index.ts b/x-pack/plugins/ingest/public/infraops/containers/waffle/index.ts similarity index 100% rename from x-pack/plugins/infra/public/containers/waffle/index.ts rename to x-pack/plugins/ingest/public/infraops/containers/waffle/index.ts diff --git a/x-pack/plugins/infra/public/containers/waffle/nodes_to_wafflemap.ts b/x-pack/plugins/ingest/public/infraops/containers/waffle/nodes_to_wafflemap.ts similarity index 97% rename from x-pack/plugins/infra/public/containers/waffle/nodes_to_wafflemap.ts rename to x-pack/plugins/ingest/public/infraops/containers/waffle/nodes_to_wafflemap.ts index 6dad5d0b9405b..a60fc315da52a 100644 --- a/x-pack/plugins/infra/public/containers/waffle/nodes_to_wafflemap.ts +++ b/x-pack/plugins/ingest/public/infraops/containers/waffle/nodes_to_wafflemap.ts @@ -5,13 +5,13 @@ */ import { first, last } from 'lodash'; -import { InfraNode, InfraNodePath } from '../../../common/graphql/types'; +import { InfraNode, InfraNodePath } from '../../../../common/graphql/types'; import { InfraWaffleMapGroup, InfraWaffleMapGroupOfGroups, InfraWaffleMapGroupOfNodes, InfraWaffleMapNode, -} from '../../lib/lib'; +} from '../../../lib/lib'; import { isWaffleMapGroupWithGroups, isWaffleMapGroupWithNodes } from './type_guards'; function createId(path: InfraNodePath[]) { diff --git a/x-pack/plugins/infra/public/containers/waffle/type_guards.ts b/x-pack/plugins/ingest/public/infraops/containers/waffle/type_guards.ts similarity index 95% rename from x-pack/plugins/infra/public/containers/waffle/type_guards.ts rename to x-pack/plugins/ingest/public/infraops/containers/waffle/type_guards.ts index 3e21e3a56a6c6..6e5a349b3c1cd 100644 --- a/x-pack/plugins/infra/public/containers/waffle/type_guards.ts +++ b/x-pack/plugins/ingest/public/infraops/containers/waffle/type_guards.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { InfraWaffleMapGroupOfGroups, InfraWaffleMapGroupOfNodes } from '../../lib/lib'; +import { InfraWaffleMapGroupOfGroups, InfraWaffleMapGroupOfNodes } from '../../../lib/lib'; export function isWaffleMapGroupWithNodes(subject: any): subject is InfraWaffleMapGroupOfNodes { return subject && subject.nodes != null && Array.isArray(subject.nodes); diff --git a/x-pack/plugins/infra/public/containers/waffle/waffle_nodes.gql_query.ts b/x-pack/plugins/ingest/public/infraops/containers/waffle/waffle_nodes.gql_query.ts similarity index 100% rename from x-pack/plugins/infra/public/containers/waffle/waffle_nodes.gql_query.ts rename to x-pack/plugins/ingest/public/infraops/containers/waffle/waffle_nodes.gql_query.ts diff --git a/x-pack/plugins/infra/public/containers/waffle/with_waffle_filters.tsx b/x-pack/plugins/ingest/public/infraops/containers/waffle/with_waffle_filters.tsx similarity index 90% rename from x-pack/plugins/infra/public/containers/waffle/with_waffle_filters.tsx rename to x-pack/plugins/ingest/public/infraops/containers/waffle/with_waffle_filters.tsx index 80f912574c72b..289c16814b0fb 100644 --- a/x-pack/plugins/infra/public/containers/waffle/with_waffle_filters.tsx +++ b/x-pack/plugins/ingest/public/infraops/containers/waffle/with_waffle_filters.tsx @@ -7,10 +7,10 @@ import React from 'react'; import { connect } from 'react-redux'; -import { sharedSelectors, State, waffleFilterActions, waffleFilterSelectors } from '../../store'; -import { asChildFunctionRenderer } from '../../utils/typed_react'; -import { bindPlainActionCreators } from '../../utils/typed_redux'; -import { UrlStateContainer } from '../../utils/url_state'; +import { sharedSelectors, State, waffleFilterActions, waffleFilterSelectors } from '../../../store'; +import { asChildFunctionRenderer } from '../../../utils/typed_react'; +import { bindPlainActionCreators } from '../../../utils/typed_redux'; +import { UrlStateContainer } from '../../../utils/url_state'; export const withWaffleFilter = connect( (state: State) => ({ diff --git a/x-pack/plugins/infra/public/containers/waffle/with_waffle_nodes.tsx b/x-pack/plugins/ingest/public/infraops/containers/waffle/with_waffle_nodes.tsx similarity index 91% rename from x-pack/plugins/infra/public/containers/waffle/with_waffle_nodes.tsx rename to x-pack/plugins/ingest/public/infraops/containers/waffle/with_waffle_nodes.tsx index f8a5a7a607917..7598cab6c4f15 100644 --- a/x-pack/plugins/infra/public/containers/waffle/with_waffle_nodes.tsx +++ b/x-pack/plugins/ingest/public/infraops/containers/waffle/with_waffle_nodes.tsx @@ -13,9 +13,9 @@ import { InfraPathType, InfraTimerangeInput, WaffleNodesQuery, -} from '../../../common/graphql/types'; -import { InfraNodeType } from '../../../server/lib/adapters/nodes'; -import { InfraWaffleMapGroup } from '../../lib/lib'; +} from '../../../../common/graphql/types'; +import { InfraNodeType } from '../../../../server/lib/adapters/nodes'; +import { InfraWaffleMapGroup } from '../../../lib/lib'; import { nodesToWaffleMap } from './nodes_to_wafflemap'; import { waffleNodesQuery } from './waffle_nodes.gql_query'; diff --git a/x-pack/plugins/infra/public/containers/waffle/with_waffle_options.tsx b/x-pack/plugins/ingest/public/infraops/containers/waffle/with_waffle_options.tsx similarity index 81% rename from x-pack/plugins/infra/public/containers/waffle/with_waffle_options.tsx rename to x-pack/plugins/ingest/public/infraops/containers/waffle/with_waffle_options.tsx index 3992d78f71cd0..50234ded1f6da 100644 --- a/x-pack/plugins/infra/public/containers/waffle/with_waffle_options.tsx +++ b/x-pack/plugins/ingest/public/infraops/containers/waffle/with_waffle_options.tsx @@ -7,20 +7,19 @@ import React from 'react'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; -import { InfraMetricInput, InfraMetricType, InfraPathType } from '../../../common/graphql/types'; -import { InfraNodeType } from '../../../server/lib/adapters/nodes'; -import { State, waffleOptionsActions, waffleOptionsSelectors } from '../../store'; -import { initialWaffleOptionsState } from '../../store/local/waffle_options/reducer'; -import { asChildFunctionRenderer } from '../../utils/typed_react'; -import { bindPlainActionCreators } from '../../utils/typed_redux'; -import { UrlStateContainer } from '../../utils/url_state'; +import { InfraMetricInput, InfraMetricType, InfraPathType } from '../../../../common/graphql/types'; +import { InfraNodeType } from '../../../../server/lib/adapters/nodes'; +import { State, waffleOptionsActions, waffleOptionsSelectors } from '../../../store'; +import { asChildFunctionRenderer } from '../../../utils/typed_react'; +import { bindPlainActionCreators } from '../../../utils/typed_redux'; +import { UrlStateContainer } from '../../../utils/url_state'; const selectOptionsUrlState = createSelector( waffleOptionsSelectors.selectMetric, waffleOptionsSelectors.selectGroupBy, waffleOptionsSelectors.selectNodeType, - (metrics, groupBy, nodeType) => ({ - metrics, + (metric, groupBy, nodeType) => ({ + metric, groupBy, nodeType, }) @@ -71,10 +70,14 @@ export const WithWaffleOptionsUrlState = () => ( } }} onInitialize={initialUrlState => { - if (initialUrlState) { - changeMetric(initialUrlState.metric || initialWaffleOptionsState.metric); - changeGroupBy(initialUrlState.groupBy || initialWaffleOptionsState.groupBy); - changeNodeType(initialUrlState.nodeType || initialWaffleOptionsState.nodeType); + if (initialUrlState && initialUrlState.metric) { + changeMetric(initialUrlState.metric); + } + if (initialUrlState && initialUrlState.groupBy) { + changeGroupBy(initialUrlState.groupBy); + } + if (initialUrlState && initialUrlState.nodeType) { + changeNodeType(initialUrlState.nodeType); } }} /> diff --git a/x-pack/plugins/infra/public/containers/waffle/with_waffle_time.tsx b/x-pack/plugins/ingest/public/infraops/containers/waffle/with_waffle_time.tsx similarity index 92% rename from x-pack/plugins/infra/public/containers/waffle/with_waffle_time.tsx rename to x-pack/plugins/ingest/public/infraops/containers/waffle/with_waffle_time.tsx index 293f6184af21b..3dfe4b4856a25 100644 --- a/x-pack/plugins/infra/public/containers/waffle/with_waffle_time.tsx +++ b/x-pack/plugins/ingest/public/infraops/containers/waffle/with_waffle_time.tsx @@ -8,10 +8,10 @@ import React from 'react'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; -import { State, waffleTimeActions, waffleTimeSelectors } from '../../store'; -import { asChildFunctionRenderer } from '../../utils/typed_react'; -import { bindPlainActionCreators } from '../../utils/typed_redux'; -import { UrlStateContainer } from '../../utils/url_state'; +import { State, waffleTimeActions, waffleTimeSelectors } from '../../../store'; +import { asChildFunctionRenderer } from '../../../utils/typed_react'; +import { bindPlainActionCreators } from '../../../utils/typed_redux'; +import { UrlStateContainer } from '../../../utils/url_state'; export const withWaffleTime = connect( (state: State) => ({ diff --git a/x-pack/plugins/infra/public/containers/with_kibana_chrome.tsx b/x-pack/plugins/ingest/public/infraops/containers/with_kibana_chrome.tsx similarity index 92% rename from x-pack/plugins/infra/public/containers/with_kibana_chrome.tsx rename to x-pack/plugins/ingest/public/infraops/containers/with_kibana_chrome.tsx index a298f3f1c4d7d..c767a57b60923 100644 --- a/x-pack/plugins/infra/public/containers/with_kibana_chrome.tsx +++ b/x-pack/plugins/ingest/public/infraops/containers/with_kibana_chrome.tsx @@ -14,7 +14,7 @@ import React from 'react'; import chrome from 'ui/chrome'; -import { RendererFunction } from '../utils/typed_react'; +import { RendererFunction } from '../../utils/typed_react'; interface WithKibanaChromeProps { children: RendererFunction<{ diff --git a/x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx b/x-pack/plugins/ingest/public/infraops/containers/with_kuery_autocompletion.tsx similarity index 96% rename from x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx rename to x-pack/plugins/ingest/public/infraops/containers/with_kuery_autocompletion.tsx index b3d062aeed080..4a6779fc83ef5 100644 --- a/x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx +++ b/x-pack/plugins/ingest/public/infraops/containers/with_kuery_autocompletion.tsx @@ -10,8 +10,8 @@ import { connect } from 'react-redux'; import { AutocompleteSuggestion, getAutocompleteProvider } from 'ui/autocomplete_providers'; import { StaticIndexPattern } from 'ui/index_patterns'; -import { sourceSelectors, State } from '../store'; -import { RendererFunction } from '../utils/typed_react'; +import { sourceSelectors, State } from '../../store'; +import { RendererFunction } from '../../utils/typed_react'; const withIndexPattern = connect((state: State) => ({ indexPattern: sourceSelectors.selectDerivedIndexPattern(state), diff --git a/x-pack/plugins/infra/public/containers/with_options.tsx b/x-pack/plugins/ingest/public/infraops/containers/with_options.tsx similarity index 93% rename from x-pack/plugins/infra/public/containers/with_options.tsx rename to x-pack/plugins/ingest/public/infraops/containers/with_options.tsx index 0e92a6ef43edb..e57ed3cc86c44 100644 --- a/x-pack/plugins/infra/public/containers/with_options.tsx +++ b/x-pack/plugins/ingest/public/infraops/containers/with_options.tsx @@ -7,14 +7,14 @@ import moment from 'moment'; import React from 'react'; -import { InfraMetricType, InfraPathType } from '../../common/graphql/types'; +import { InfraMetricType, InfraPathType } from '../../../common/graphql/types'; import { InfraFormatterType, InfraOptions, InfraWaffleMapLegendMode, // InfraWaffleMapRuleOperator, -} from '../lib/lib'; -import { RendererFunction } from '../utils/typed_react'; +} from '../../lib/lib'; +import { RendererFunction } from '../../utils/typed_react'; const initialState = { options: { diff --git a/x-pack/plugins/infra/public/containers/with_source.ts b/x-pack/plugins/ingest/public/infraops/containers/with_source.ts similarity index 83% rename from x-pack/plugins/infra/public/containers/with_source.ts rename to x-pack/plugins/ingest/public/infraops/containers/with_source.ts index 9674cda59575c..4ca9397972ba4 100644 --- a/x-pack/plugins/infra/public/containers/with_source.ts +++ b/x-pack/plugins/ingest/public/infraops/containers/with_source.ts @@ -6,8 +6,8 @@ import { connect } from 'react-redux'; -import { sourceSelectors, State } from '../store'; -import { asChildFunctionRenderer } from '../utils/typed_react'; +import { sourceSelectors, State } from '../../store'; +import { asChildFunctionRenderer } from '../../utils/typed_react'; export const withSource = connect((state: State) => ({ configuredFields: sourceSelectors.selectSourceFields(state), diff --git a/x-pack/plugins/infra/public/containers/with_state_from_location.tsx b/x-pack/plugins/ingest/public/infraops/containers/with_state_from_location.tsx similarity index 99% rename from x-pack/plugins/infra/public/containers/with_state_from_location.tsx rename to x-pack/plugins/ingest/public/infraops/containers/with_state_from_location.tsx index b8c8c85d96631..17df3f5c27454 100644 --- a/x-pack/plugins/infra/public/containers/with_state_from_location.tsx +++ b/x-pack/plugins/ingest/public/infraops/containers/with_state_from_location.tsx @@ -10,7 +10,7 @@ import { parse as parseQueryString, stringify as stringifyQueryString } from 'qu import React from 'react'; import { RouteComponentProps, withRouter } from 'react-router'; import { decode_object, encode_object } from 'rison-node'; -import { Omit } from '../lib/lib'; +import { Omit } from '../../lib/lib'; interface AnyObject { [key: string]: any; diff --git a/x-pack/plugins/infra/public/pages/home/index.tsx b/x-pack/plugins/ingest/public/infraops/pages/home/index.tsx similarity index 91% rename from x-pack/plugins/infra/public/pages/home/index.tsx rename to x-pack/plugins/ingest/public/infraops/pages/home/index.tsx index 14c57040b738a..7528f0684cc3a 100644 --- a/x-pack/plugins/infra/public/pages/home/index.tsx +++ b/x-pack/plugins/ingest/public/infraops/pages/home/index.tsx @@ -9,9 +9,9 @@ import React from 'react'; import { HomePageContent } from './page_content'; import { HomeToolbar } from './toolbar'; -import { EmptyPage } from '../../components/empty_page'; -import { Header } from '../../components/header'; -import { ColumnarPage } from '../../components/page'; +import { EmptyPage } from '../../../components/empty_page'; +import { Header } from '../../../components/header'; +import { ColumnarPage } from '../../../components/page'; import { WithWaffleFilterUrlState } from '../../containers/waffle/with_waffle_filters'; import { WithWaffleOptionsUrlState } from '../../containers/waffle/with_waffle_options'; diff --git a/x-pack/plugins/infra/public/pages/home/page_content.tsx b/x-pack/plugins/ingest/public/infraops/pages/home/page_content.tsx similarity index 91% rename from x-pack/plugins/infra/public/pages/home/page_content.tsx rename to x-pack/plugins/ingest/public/infraops/pages/home/page_content.tsx index 37a6854c0198a..706909018df85 100644 --- a/x-pack/plugins/infra/public/pages/home/page_content.tsx +++ b/x-pack/plugins/ingest/public/infraops/pages/home/page_content.tsx @@ -6,7 +6,7 @@ import React from 'react'; -import { PageContent } from '../../components/page'; +import { PageContent } from '../../../components/page'; import { Waffle } from '../../components/waffle'; import { WithWaffleFilter } from '../../containers/waffle/with_waffle_filters'; @@ -23,7 +23,7 @@ export const HomePageContent: React.SFC = () => ( {({ wafflemap, sourceId }) => ( - {({ filterQueryAsJson }) => ( + {({ filterQueryAsJson, applyFilterQuery }) => ( {({ currentTimeRange, isAutoReloading }) => ( @@ -41,8 +41,9 @@ export const HomePageContent: React.SFC = () => ( map={nodes} loading={nodes.length > 0 && isAutoReloading ? false : loading} nodeType={nodeType} - options={{ ...wafflemap, metric, fields: configuredFields }} + options={{ ...wafflemap, metric, fields: configuredFields, groupBy }} reload={refetch} + onDrilldown={applyFilterQuery} /> )} diff --git a/x-pack/plugins/infra/public/pages/home/toolbar.tsx b/x-pack/plugins/ingest/public/infraops/pages/home/toolbar.tsx similarity index 95% rename from x-pack/plugins/infra/public/pages/home/toolbar.tsx rename to x-pack/plugins/ingest/public/infraops/pages/home/toolbar.tsx index 5abccd9f9763d..f61d8a8d6dba1 100644 --- a/x-pack/plugins/infra/public/pages/home/toolbar.tsx +++ b/x-pack/plugins/ingest/public/infraops/pages/home/toolbar.tsx @@ -7,11 +7,11 @@ import { EuiFlexGroup, EuiFlexItem, EuiText, EuiTitle } from '@elastic/eui'; import React from 'react'; -import { AutocompleteField } from '../../components/autocomplete_field'; -import { Toolbar } from '../../components/eui/toolbar'; +import { AutocompleteField } from '../../../components/autocomplete_field'; +import { Toolbar } from '../../../components/eui/toolbar'; import { WaffleTimeControls } from '../../components/waffle/waffle_time_controls'; -import { InfraNodeType } from '../../../common/graphql/types'; +import { InfraNodeType } from '../../../../common/graphql/types'; import { WaffleGroupByControls } from '../../components/waffle/waffle_group_by_controls'; import { WaffleMetricControls } from '../../components/waffle/waffle_metric_controls'; import { WaffleNodeTypeSwitcher } from '../../components/waffle/waffle_node_type_switcher'; diff --git a/x-pack/plugins/infra/public/pages/metrics/index.tsx b/x-pack/plugins/ingest/public/infraops/pages/metrics/index.tsx similarity index 96% rename from x-pack/plugins/infra/public/pages/metrics/index.tsx rename to x-pack/plugins/ingest/public/infraops/pages/metrics/index.tsx index d6fef00e11c46..df59764031058 100644 --- a/x-pack/plugins/infra/public/pages/metrics/index.tsx +++ b/x-pack/plugins/ingest/public/infraops/pages/metrics/index.tsx @@ -18,12 +18,13 @@ import { EuiTitle, } from '@elastic/eui'; import styled, { withTheme } from 'styled-components'; -import { InfraNodeType, InfraTimerangeInput } from '../../../common/graphql/types'; -import { AutoSizer } from '../../components/auto_sizer'; -import { Header } from '../../components/header'; +import { InfraNodeType, InfraTimerangeInput } from '../../../../common/graphql/types'; +import { AutoSizer } from '../../../components/auto_sizer'; +import { Error, ErrorPageBody } from '../../../components/error'; +import { Header } from '../../../components/header'; +import { ColumnarPage, PageContent } from '../../../components/page'; import { Metrics } from '../../components/metrics'; import { MetricsTimeControls } from '../../components/metrics/time_controls'; -import { ColumnarPage, PageContent } from '../../components/page'; import { WithCapabilities } from '../../containers/capabilities/with_capabilites'; import { WithMetrics } from '../../containers/metrics/with_metrics'; import { @@ -31,7 +32,6 @@ import { WithMetricsTimeUrlState, } from '../../containers/metrics/with_metrics_time'; import { WithOptions } from '../../containers/with_options'; -import { Error, ErrorPageBody } from '../error'; import { layoutCreators } from './layouts'; import { InfraMetricLayoutSection } from './layouts/types'; diff --git a/x-pack/plugins/infra/public/pages/metrics/layouts/container.ts b/x-pack/plugins/ingest/public/infraops/pages/metrics/layouts/container.ts similarity index 97% rename from x-pack/plugins/infra/public/pages/metrics/layouts/container.ts rename to x-pack/plugins/ingest/public/infraops/pages/metrics/layouts/container.ts index d7f6cee2400fa..b06e5900fce1f 100644 --- a/x-pack/plugins/infra/public/pages/metrics/layouts/container.ts +++ b/x-pack/plugins/ingest/public/infraops/pages/metrics/layouts/container.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { InfraMetric } from '../../../../common/graphql/types'; -import { InfraFormatterType } from '../../../lib/lib'; +import { InfraMetric } from '../../../../../common/graphql/types'; +import { InfraFormatterType } from '../../../../lib/lib'; import { nginxLayoutCreator } from './nginx'; import { InfraMetricLayoutCreator, diff --git a/x-pack/plugins/infra/public/pages/metrics/layouts/host.ts b/x-pack/plugins/ingest/public/infraops/pages/metrics/layouts/host.ts similarity index 98% rename from x-pack/plugins/infra/public/pages/metrics/layouts/host.ts rename to x-pack/plugins/ingest/public/infraops/pages/metrics/layouts/host.ts index ce9a5a01247ce..4b51c85448d9d 100644 --- a/x-pack/plugins/infra/public/pages/metrics/layouts/host.ts +++ b/x-pack/plugins/ingest/public/infraops/pages/metrics/layouts/host.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { InfraMetric } from '../../../../common/graphql/types'; -import { InfraFormatterType } from '../../../lib/lib'; +import { InfraMetric } from '../../../../../common/graphql/types'; +import { InfraFormatterType } from '../../../../lib/lib'; import { nginxLayoutCreator } from './nginx'; import { InfraMetricLayoutCreator, diff --git a/x-pack/plugins/infra/public/pages/metrics/layouts/index.ts b/x-pack/plugins/ingest/public/infraops/pages/metrics/layouts/index.ts similarity index 100% rename from x-pack/plugins/infra/public/pages/metrics/layouts/index.ts rename to x-pack/plugins/ingest/public/infraops/pages/metrics/layouts/index.ts diff --git a/x-pack/plugins/infra/public/pages/metrics/layouts/nginx.ts b/x-pack/plugins/ingest/public/infraops/pages/metrics/layouts/nginx.ts similarity index 95% rename from x-pack/plugins/infra/public/pages/metrics/layouts/nginx.ts rename to x-pack/plugins/ingest/public/infraops/pages/metrics/layouts/nginx.ts index f03580feb72c0..3e73a974e00fe 100644 --- a/x-pack/plugins/infra/public/pages/metrics/layouts/nginx.ts +++ b/x-pack/plugins/ingest/public/infraops/pages/metrics/layouts/nginx.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { InfraMetric } from '../../../../common/graphql/types'; -import { InfraFormatterType } from '../../../lib/lib'; +import { InfraMetric } from '../../../../../common/graphql/types'; +import { InfraFormatterType } from '../../../../lib/lib'; import { InfraMetricLayoutCreator, InfraMetricLayoutSectionType, diff --git a/x-pack/plugins/infra/public/pages/metrics/layouts/pod.ts b/x-pack/plugins/ingest/public/infraops/pages/metrics/layouts/pod.ts similarity index 96% rename from x-pack/plugins/infra/public/pages/metrics/layouts/pod.ts rename to x-pack/plugins/ingest/public/infraops/pages/metrics/layouts/pod.ts index bc58608737115..b64b32920aab8 100644 --- a/x-pack/plugins/infra/public/pages/metrics/layouts/pod.ts +++ b/x-pack/plugins/ingest/public/infraops/pages/metrics/layouts/pod.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { InfraMetric } from '../../../../common/graphql/types'; -import { InfraFormatterType } from '../../../lib/lib'; +import { InfraMetric } from '../../../../../common/graphql/types'; +import { InfraFormatterType } from '../../../../lib/lib'; import { nginxLayoutCreator } from './nginx'; import { InfraMetricLayoutCreator, diff --git a/x-pack/plugins/infra/public/pages/metrics/layouts/types.ts b/x-pack/plugins/ingest/public/infraops/pages/metrics/layouts/types.ts similarity index 91% rename from x-pack/plugins/infra/public/pages/metrics/layouts/types.ts rename to x-pack/plugins/ingest/public/infraops/pages/metrics/layouts/types.ts index d45e505a7d788..023b4e412b3fe 100644 --- a/x-pack/plugins/infra/public/pages/metrics/layouts/types.ts +++ b/x-pack/plugins/ingest/public/infraops/pages/metrics/layouts/types.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { InfraMetric } from '../../../../common/graphql/types'; -import { InfraFormatterType } from '../../../lib/lib'; +import { InfraMetric } from '../../../../../common/graphql/types'; +import { InfraFormatterType } from '../../../../lib/lib'; export enum InfraMetricLayoutVisualizationType { line = 'line', diff --git a/x-pack/plugins/ingest/public/infraops/routes.tsx b/x-pack/plugins/ingest/public/infraops/routes.tsx new file mode 100644 index 0000000000000..906f914f4c891 --- /dev/null +++ b/x-pack/plugins/ingest/public/infraops/routes.tsx @@ -0,0 +1,22 @@ +/* + * 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 React from 'react'; +import { Route, RouteComponentProps, Switch, withRouter } from 'react-router-dom'; + +import { HomePage } from './pages/home'; +import { MetricDetail } from './pages/metrics'; + +const routes: React.SFC> = ({ match }) => { + return ( + + + + + ); +}; + +export const InfraOpsRoutes = withRouter(routes); diff --git a/x-pack/plugins/infra/public/lib/adapters/framework/kibana_framework_adapter.ts b/x-pack/plugins/ingest/public/lib/adapters/framework/kibana_framework_adapter.ts similarity index 100% rename from x-pack/plugins/infra/public/lib/adapters/framework/kibana_framework_adapter.ts rename to x-pack/plugins/ingest/public/lib/adapters/framework/kibana_framework_adapter.ts diff --git a/x-pack/plugins/infra/public/lib/adapters/framework/testing_framework_adapter.ts b/x-pack/plugins/ingest/public/lib/adapters/framework/testing_framework_adapter.ts similarity index 100% rename from x-pack/plugins/infra/public/lib/adapters/framework/testing_framework_adapter.ts rename to x-pack/plugins/ingest/public/lib/adapters/framework/testing_framework_adapter.ts diff --git a/x-pack/plugins/infra/public/lib/adapters/observable_api/kibana_observable_api.ts b/x-pack/plugins/ingest/public/lib/adapters/observable_api/kibana_observable_api.ts similarity index 100% rename from x-pack/plugins/infra/public/lib/adapters/observable_api/kibana_observable_api.ts rename to x-pack/plugins/ingest/public/lib/adapters/observable_api/kibana_observable_api.ts diff --git a/x-pack/plugins/infra/public/lib/compose/kibana_compose.ts b/x-pack/plugins/ingest/public/lib/compose/kibana_compose.ts similarity index 97% rename from x-pack/plugins/infra/public/lib/compose/kibana_compose.ts rename to x-pack/plugins/ingest/public/lib/compose/kibana_compose.ts index 3ce48d9a31b96..96c58177fe9d4 100644 --- a/x-pack/plugins/infra/public/lib/compose/kibana_compose.ts +++ b/x-pack/plugins/ingest/public/lib/compose/kibana_compose.ts @@ -49,7 +49,7 @@ export function compose(): InfraFrontendLibs { headers: { 'kbn-xsrf': chrome.getXsrfToken(), }, - uri: `${chrome.getBasePath()}/api/infra/graphql`, + uri: `${chrome.getBasePath()}/api/ingest/graphql`, }), ]), }; diff --git a/x-pack/plugins/infra/public/lib/compose/testing_compose.ts b/x-pack/plugins/ingest/public/lib/compose/testing_compose.ts similarity index 100% rename from x-pack/plugins/infra/public/lib/compose/testing_compose.ts rename to x-pack/plugins/ingest/public/lib/compose/testing_compose.ts diff --git a/x-pack/plugins/infra/public/lib/lib.ts b/x-pack/plugins/ingest/public/lib/lib.ts similarity index 99% rename from x-pack/plugins/infra/public/lib/lib.ts rename to x-pack/plugins/ingest/public/lib/lib.ts index a4fb71131b292..0df859fa81446 100644 --- a/x-pack/plugins/infra/public/lib/lib.ts +++ b/x-pack/plugins/ingest/public/lib/lib.ts @@ -167,6 +167,7 @@ export interface InfraWaffleMapOptions { formatTemplate: string; metric: InfraMetricInput; path: InfraPathInput[]; + groupBy: InfraPathInput[]; legend: InfraWaffleMapLegend; } diff --git a/x-pack/plugins/ingest/public/link_to/create_query_string_for_detail_time.ts b/x-pack/plugins/ingest/public/link_to/create_query_string_for_detail_time.ts new file mode 100644 index 0000000000000..20a4b0a9fca25 --- /dev/null +++ b/x-pack/plugins/ingest/public/link_to/create_query_string_for_detail_time.ts @@ -0,0 +1,16 @@ +/* + * 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 { Location } from 'history'; +import { replaceStateKeyInQueryString } from '../utils/url_state'; +import { getFromFromLocation, getToFromLocation } from './query_params'; + +export const createQueryStringForDetailTime = (location: Location) => { + const to = getToFromLocation(location); + const from = getFromFromLocation(location); + return to && from + ? '?' + replaceStateKeyInQueryString('metricTime', { to, from, interval: '>=1m' })('') + : ''; +}; diff --git a/x-pack/plugins/infra/public/pages/link_to/index.ts b/x-pack/plugins/ingest/public/link_to/index.ts similarity index 100% rename from x-pack/plugins/infra/public/pages/link_to/index.ts rename to x-pack/plugins/ingest/public/link_to/index.ts diff --git a/x-pack/plugins/infra/public/pages/link_to/link_to.tsx b/x-pack/plugins/ingest/public/link_to/link_to.tsx similarity index 100% rename from x-pack/plugins/infra/public/pages/link_to/link_to.tsx rename to x-pack/plugins/ingest/public/link_to/link_to.tsx diff --git a/x-pack/plugins/infra/public/pages/link_to/query_params.ts b/x-pack/plugins/ingest/public/link_to/query_params.ts similarity index 55% rename from x-pack/plugins/infra/public/pages/link_to/query_params.ts rename to x-pack/plugins/ingest/public/link_to/query_params.ts index 8ee492ebc010d..ebc31264bc02e 100644 --- a/x-pack/plugins/infra/public/pages/link_to/query_params.ts +++ b/x-pack/plugins/ingest/public/link_to/query_params.ts @@ -6,9 +6,19 @@ import { Location } from 'history'; -import { getParamFromQueryString, getQueryStringFromLocation } from '../../utils/url_state'; +import { getParamFromQueryString, getQueryStringFromLocation } from '../utils/url_state'; export const getTimeFromLocation = (location: Location) => { const timeParam = getParamFromQueryString(getQueryStringFromLocation(location), 'time'); return timeParam ? parseFloat(timeParam) : NaN; }; + +export const getToFromLocation = (location: Location) => { + const timeParam = getParamFromQueryString(getQueryStringFromLocation(location), 'to'); + return timeParam ? parseFloat(timeParam) : NaN; +}; + +export const getFromFromLocation = (location: Location) => { + const timeParam = getParamFromQueryString(getQueryStringFromLocation(location), 'from'); + return timeParam ? parseFloat(timeParam) : NaN; +}; diff --git a/x-pack/plugins/ingest/public/link_to/redirect_to_container_detail.tsx b/x-pack/plugins/ingest/public/link_to/redirect_to_container_detail.tsx new file mode 100644 index 0000000000000..e922704b96a7a --- /dev/null +++ b/x-pack/plugins/ingest/public/link_to/redirect_to_container_detail.tsx @@ -0,0 +1,30 @@ +/* + * 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 React from 'react'; +import { Redirect, RouteComponentProps } from 'react-router-dom'; +import { createQueryStringForDetailTime } from './create_query_string_for_detail_time'; + +export const RedirectToContainerDetail = ({ + match, + location, +}: RouteComponentProps<{ name: string }>) => { + const args = createQueryStringForDetailTime(location); + return ; +}; + +export const getContainerDetailUrl = ({ + name, + to, + from, +}: { + name: string; + to?: number; + from?: number; +}) => { + const args = to && from ? `?to=${to}&from=${from}` : ''; + return `#/link-to/container-detail/${name}${args}`; +}; diff --git a/x-pack/plugins/infra/public/pages/link_to/redirect_to_container_logs.tsx b/x-pack/plugins/ingest/public/link_to/redirect_to_container_logs.tsx similarity index 80% rename from x-pack/plugins/infra/public/pages/link_to/redirect_to_container_logs.tsx rename to x-pack/plugins/ingest/public/link_to/redirect_to_container_logs.tsx index d6d4d89eb168e..b77370083d236 100644 --- a/x-pack/plugins/infra/public/pages/link_to/redirect_to_container_logs.tsx +++ b/x-pack/plugins/ingest/public/link_to/redirect_to_container_logs.tsx @@ -8,10 +8,10 @@ import compose from 'lodash/fp/compose'; import React from 'react'; import { Redirect, RouteComponentProps } from 'react-router-dom'; -import { LoadingPage } from '../../components/loading_page'; -import { replaceLogFilterInQueryString } from '../../containers/logs/with_log_filter'; -import { replaceLogPositionInQueryString } from '../../containers/logs/with_log_position'; -import { WithSource } from '../../containers/with_source'; +import { LoadingPage } from '../components/loading_page'; +import { replaceLogFilterInQueryString } from '../logs/containers/logs/with_log_filter'; +import { replaceLogPositionInQueryString } from '../logs/containers/logs/with_log_position'; +import { WithSource } from '../logs/containers/with_source'; import { getTimeFromLocation } from './query_params'; export const RedirectToContainerLogs = ({ diff --git a/x-pack/plugins/ingest/public/link_to/redirect_to_host_detail.tsx b/x-pack/plugins/ingest/public/link_to/redirect_to_host_detail.tsx new file mode 100644 index 0000000000000..b339f8f714a6a --- /dev/null +++ b/x-pack/plugins/ingest/public/link_to/redirect_to_host_detail.tsx @@ -0,0 +1,29 @@ +/* + * 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 React from 'react'; +import { Redirect, RouteComponentProps } from 'react-router-dom'; +import { createQueryStringForDetailTime } from './create_query_string_for_detail_time'; +export const RedirectToHostDetail = ({ + match, + location, +}: RouteComponentProps<{ name: string }>) => { + const args = createQueryStringForDetailTime(location); + return ; +}; + +export const getHostDetailUrl = ({ + name, + to, + from, +}: { + name: string; + to?: number; + from?: number; +}) => { + const args = to && from ? `?to=${to}&from=${from}` : ''; + return `#/link-to/host-detail/${name}${args}`; +}; diff --git a/x-pack/plugins/infra/public/pages/link_to/redirect_to_host_logs.tsx b/x-pack/plugins/ingest/public/link_to/redirect_to_host_logs.tsx similarity index 73% rename from x-pack/plugins/infra/public/pages/link_to/redirect_to_host_logs.tsx rename to x-pack/plugins/ingest/public/link_to/redirect_to_host_logs.tsx index 290fdb56033e2..fffa61693ca0a 100644 --- a/x-pack/plugins/infra/public/pages/link_to/redirect_to_host_logs.tsx +++ b/x-pack/plugins/ingest/public/link_to/redirect_to_host_logs.tsx @@ -8,10 +8,10 @@ import compose from 'lodash/fp/compose'; import React from 'react'; import { Redirect, RouteComponentProps } from 'react-router-dom'; -import { LoadingPage } from '../../components/loading_page'; -import { replaceLogFilterInQueryString } from '../../containers/logs/with_log_filter'; -import { replaceLogPositionInQueryString } from '../../containers/logs/with_log_position'; -import { WithSource } from '../../containers/with_source'; +import { LoadingPage } from '../components/loading_page'; +import { replaceLogFilterInQueryString } from '../logs/containers/logs/with_log_filter'; +import { replaceLogPositionInQueryString } from '../logs/containers/logs/with_log_position'; +import { WithSource } from '../logs/containers/with_source'; import { getTimeFromLocation } from './query_params'; export const RedirectToHostLogs = ({ @@ -35,4 +35,4 @@ export const RedirectToHostLogs = ({ ); export const getHostLogsUrl = ({ hostname, time }: { hostname: string; time?: number }) => - ['#/link-to/host-logs/', hostname, ...(time ? [`?time=${time}`] : [])].join(''); + ['#/logs/link-to/host-logs/', hostname, ...(time ? [`?time=${time}`] : [])].join(''); diff --git a/x-pack/plugins/ingest/public/link_to/redirect_to_pod_detail.tsx b/x-pack/plugins/ingest/public/link_to/redirect_to_pod_detail.tsx new file mode 100644 index 0000000000000..91b1c7ea53432 --- /dev/null +++ b/x-pack/plugins/ingest/public/link_to/redirect_to_pod_detail.tsx @@ -0,0 +1,27 @@ +/* + * 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 React from 'react'; +import { Redirect, RouteComponentProps } from 'react-router-dom'; +import { createQueryStringForDetailTime } from './create_query_string_for_detail_time'; + +export const RedirectToPodDetail = ({ match, location }: RouteComponentProps<{ name: string }>) => { + const args = createQueryStringForDetailTime(location); + return ; +}; + +export const getPodDetailUrl = ({ + name, + to, + from, +}: { + name: string; + to?: number; + from?: number; +}) => { + const args = to && from ? `?to=${to}&from=${from}` : ''; + return `#/link-to/pod-detail/${name}${args}`; +}; diff --git a/x-pack/plugins/infra/public/pages/link_to/redirect_to_pod_logs.tsx b/x-pack/plugins/ingest/public/link_to/redirect_to_pod_logs.tsx similarity index 79% rename from x-pack/plugins/infra/public/pages/link_to/redirect_to_pod_logs.tsx rename to x-pack/plugins/ingest/public/link_to/redirect_to_pod_logs.tsx index 0ba15ee346f4c..887c190b565af 100644 --- a/x-pack/plugins/infra/public/pages/link_to/redirect_to_pod_logs.tsx +++ b/x-pack/plugins/ingest/public/link_to/redirect_to_pod_logs.tsx @@ -8,10 +8,10 @@ import compose from 'lodash/fp/compose'; import React from 'react'; import { Redirect, RouteComponentProps } from 'react-router-dom'; -import { LoadingPage } from '../../components/loading_page'; -import { replaceLogFilterInQueryString } from '../../containers/logs/with_log_filter'; -import { replaceLogPositionInQueryString } from '../../containers/logs/with_log_position'; -import { WithSource } from '../../containers/with_source'; +import { LoadingPage } from '../components/loading_page'; +import { replaceLogFilterInQueryString } from '../logs/containers/logs/with_log_filter'; +import { replaceLogPositionInQueryString } from '../logs/containers/logs/with_log_position'; +import { WithSource } from '../logs/containers/with_source'; import { getTimeFromLocation } from './query_params'; export const RedirectToPodLogs = ({ match, location }: RouteComponentProps<{ podId: string }>) => ( diff --git a/x-pack/plugins/ingest/public/logs/app.tsx b/x-pack/plugins/ingest/public/logs/app.tsx new file mode 100644 index 0000000000000..1d660a89d6e7e --- /dev/null +++ b/x-pack/plugins/ingest/public/logs/app.tsx @@ -0,0 +1,11 @@ +/* + * 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 React from 'react'; + +import { LogsRoutes } from './routes'; + +export const LogsApp: React.SFC = () => ; diff --git a/x-pack/plugins/infra/public/components/logging/log_customization_menu.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_customization_menu.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/logging/log_customization_menu.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_customization_menu.tsx diff --git a/x-pack/plugins/infra/public/components/logging/log_minimap/density_chart.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_minimap/density_chart.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/logging/log_minimap/density_chart.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_minimap/density_chart.tsx diff --git a/x-pack/plugins/infra/public/components/logging/log_minimap/highlighted_interval.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_minimap/highlighted_interval.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/logging/log_minimap/highlighted_interval.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_minimap/highlighted_interval.tsx diff --git a/x-pack/plugins/infra/public/components/logging/log_minimap/index.ts b/x-pack/plugins/ingest/public/logs/components/logging/log_minimap/index.ts similarity index 100% rename from x-pack/plugins/infra/public/components/logging/log_minimap/index.ts rename to x-pack/plugins/ingest/public/logs/components/logging/log_minimap/index.ts diff --git a/x-pack/plugins/infra/public/components/logging/log_minimap/log_minimap.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_minimap/log_minimap.tsx similarity index 98% rename from x-pack/plugins/infra/public/components/logging/log_minimap/log_minimap.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_minimap/log_minimap.tsx index 85f47cd4eb1e1..2bfb0f4b5341b 100644 --- a/x-pack/plugins/infra/public/components/logging/log_minimap/log_minimap.tsx +++ b/x-pack/plugins/ingest/public/logs/components/logging/log_minimap/log_minimap.tsx @@ -8,7 +8,7 @@ import { scaleLinear } from 'd3-scale'; import * as React from 'react'; import styled from 'styled-components'; -import { LogEntryTime } from '../../../../common/log_entry'; +import { LogEntryTime } from '../../../../../common/log_entry'; // import { SearchSummaryBucket } from '../../../../common/log_search_summary'; import { DensityChart } from './density_chart'; import { HighlightedInterval } from './highlighted_interval'; diff --git a/x-pack/plugins/infra/public/components/logging/log_minimap/search_marker.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_minimap/search_marker.tsx similarity index 95% rename from x-pack/plugins/infra/public/components/logging/log_minimap/search_marker.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_minimap/search_marker.tsx index 70cfc5ddac799..54ea3671c20ec 100644 --- a/x-pack/plugins/infra/public/components/logging/log_minimap/search_marker.tsx +++ b/x-pack/plugins/ingest/public/logs/components/logging/log_minimap/search_marker.tsx @@ -7,8 +7,8 @@ import * as React from 'react'; import styled, { keyframes } from 'styled-components'; -import { LogEntryTime } from '../../../../common/log_entry'; -import { SearchSummaryBucket } from '../../../../common/log_search_summary'; +import { LogEntryTime } from '../../../../../common/log_entry'; +import { SearchSummaryBucket } from '../../../../../common/log_search_summary'; import { SearchMarkerTooltip } from './search_marker_tooltip'; interface SearchMarkerProps { diff --git a/x-pack/plugins/infra/public/components/logging/log_minimap/search_marker_tooltip.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_minimap/search_marker_tooltip.tsx similarity index 96% rename from x-pack/plugins/infra/public/components/logging/log_minimap/search_marker_tooltip.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_minimap/search_marker_tooltip.tsx index 1f995947dfd4e..367fe5041f02e 100644 --- a/x-pack/plugins/infra/public/components/logging/log_minimap/search_marker_tooltip.tsx +++ b/x-pack/plugins/ingest/public/logs/components/logging/log_minimap/search_marker_tooltip.tsx @@ -7,7 +7,7 @@ import { calculatePopoverPosition, EuiPortal } from '@elastic/eui'; import * as React from 'react'; -import { AutoSizer } from '../../auto_sizer'; +import { AutoSizer } from '../../../../components/auto_sizer'; interface SearchMarkerTooltipProps { markerPosition: ClientRect; diff --git a/x-pack/plugins/infra/public/components/logging/log_minimap/search_markers.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_minimap/search_markers.tsx similarity index 91% rename from x-pack/plugins/infra/public/components/logging/log_minimap/search_markers.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_minimap/search_markers.tsx index 8ad3947cc5a23..21cc3d454c5e5 100644 --- a/x-pack/plugins/infra/public/components/logging/log_minimap/search_markers.tsx +++ b/x-pack/plugins/ingest/public/logs/components/logging/log_minimap/search_markers.tsx @@ -8,8 +8,8 @@ import classNames from 'classnames'; import { scaleTime } from 'd3-scale'; import * as React from 'react'; -import { LogEntryTime } from '../../../../common/log_entry'; -import { SearchSummaryBucket } from '../../../../common/log_search_summary'; +import { LogEntryTime } from '../../../../../common/log_entry'; +import { SearchSummaryBucket } from '../../../../../common/log_search_summary'; import { SearchMarker } from './search_marker'; interface SearchMarkersProps { diff --git a/x-pack/plugins/infra/public/components/logging/log_minimap/time_ruler.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_minimap/time_ruler.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/logging/log_minimap/time_ruler.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_minimap/time_ruler.tsx diff --git a/x-pack/plugins/infra/public/components/logging/log_minimap/types.ts b/x-pack/plugins/ingest/public/logs/components/logging/log_minimap/types.ts similarity index 100% rename from x-pack/plugins/infra/public/components/logging/log_minimap/types.ts rename to x-pack/plugins/ingest/public/logs/components/logging/log_minimap/types.ts diff --git a/x-pack/plugins/infra/public/components/logging/log_minimap_scale_controls.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_minimap_scale_controls.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/logging/log_minimap_scale_controls.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_minimap_scale_controls.tsx diff --git a/x-pack/plugins/infra/public/components/logging/log_search_controls/index.ts b/x-pack/plugins/ingest/public/logs/components/logging/log_search_controls/index.ts similarity index 100% rename from x-pack/plugins/infra/public/components/logging/log_search_controls/index.ts rename to x-pack/plugins/ingest/public/logs/components/logging/log_search_controls/index.ts diff --git a/x-pack/plugins/infra/public/components/logging/log_search_controls/log_search_buttons.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_search_controls/log_search_buttons.tsx similarity index 97% rename from x-pack/plugins/infra/public/components/logging/log_search_controls/log_search_buttons.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_search_controls/log_search_buttons.tsx index 5c24a36fac669..0655f1d891ddf 100644 --- a/x-pack/plugins/infra/public/components/logging/log_search_controls/log_search_buttons.tsx +++ b/x-pack/plugins/ingest/public/logs/components/logging/log_search_controls/log_search_buttons.tsx @@ -8,7 +8,7 @@ import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import classNames from 'classnames'; import * as React from 'react'; -import { LogEntryTime } from '../../../../common/log_entry'; +import { LogEntryTime } from '../../../../../common/log_entry'; interface LogSearchButtonsProps { className?: string; diff --git a/x-pack/plugins/infra/public/components/logging/log_search_controls/log_search_controls.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_search_controls/log_search_controls.tsx similarity index 96% rename from x-pack/plugins/infra/public/components/logging/log_search_controls/log_search_controls.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_search_controls/log_search_controls.tsx index d61fde2aaa881..2ace89aae6c37 100644 --- a/x-pack/plugins/infra/public/components/logging/log_search_controls/log_search_controls.tsx +++ b/x-pack/plugins/ingest/public/logs/components/logging/log_search_controls/log_search_controls.tsx @@ -8,7 +8,7 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import classNames from 'classnames'; import * as React from 'react'; -import { LogEntryTime } from '../../../../common/log_entry'; +import { LogEntryTime } from '../../../../../common/log_entry'; import { LogSearchButtons } from './log_search_buttons'; import { LogSearchInput } from './log_search_input'; diff --git a/x-pack/plugins/infra/public/components/logging/log_search_controls/log_search_input.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_search_controls/log_search_input.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/logging/log_search_controls/log_search_input.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_search_controls/log_search_input.tsx diff --git a/x-pack/plugins/infra/public/components/logging/log_statusbar.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_statusbar.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/logging/log_statusbar.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_statusbar.tsx diff --git a/x-pack/plugins/infra/public/components/logging/log_text_scale_controls.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_text_scale_controls.tsx similarity index 97% rename from x-pack/plugins/infra/public/components/logging/log_text_scale_controls.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_text_scale_controls.tsx index 089142891a36e..832bdf5a40c20 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_scale_controls.tsx +++ b/x-pack/plugins/ingest/public/logs/components/logging/log_text_scale_controls.tsx @@ -7,7 +7,7 @@ import { EuiFormRow, EuiRadioGroup } from '@elastic/eui'; import * as React from 'react'; -import { getLabelOfTextScale, isTextScale, TextScale } from '../../../common/log_text_scale'; +import { getLabelOfTextScale, isTextScale, TextScale } from '../../../../common/log_text_scale'; interface LogTextScaleControlsProps { availableTextScales: TextScale[]; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/empty_view.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/empty_view.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/logging/log_text_stream/empty_view.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/empty_view.tsx diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/index.ts b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/index.ts similarity index 100% rename from x-pack/plugins/infra/public/components/logging/log_text_stream/index.ts rename to x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/index.ts diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/item.ts b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/item.ts similarity index 85% rename from x-pack/plugins/infra/public/components/logging/log_text_stream/item.ts rename to x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/item.ts index 75ee65aa2c3e0..593e855be5e4b 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/item.ts +++ b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/item.ts @@ -6,9 +6,9 @@ import { bisector } from 'd3-array'; -import { getLogEntryKey, LogEntry } from '../../../../common/log_entry'; -import { SearchResult } from '../../../../common/log_search_result'; -import { compareToTimeKey, TimeKey } from '../../../../common/time'; +import { getLogEntryKey, LogEntry } from '../../../../../common/log_entry'; +import { SearchResult } from '../../../../../common/log_search_result'; +import { compareToTimeKey, TimeKey } from '../../../../../common/time'; export type StreamItem = LogEntryStreamItem; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/item_date_field.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/item_date_field.tsx similarity index 94% rename from x-pack/plugins/infra/public/components/logging/log_text_stream/item_date_field.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/item_date_field.tsx index 82f8057b08fce..64332e42d71eb 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/item_date_field.tsx +++ b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/item_date_field.tsx @@ -8,8 +8,8 @@ import { darken } from 'polished'; import * as React from 'react'; import { css } from 'styled-components'; -import { TextScale } from '../../../../common/log_text_scale'; -import { tintOrShade } from '../../../utils/styles'; +import { TextScale } from '../../../../../common/log_text_scale'; +import { tintOrShade } from '../../../../utils/styles'; import { LogTextStreamItemField } from './item_field'; interface LogTextStreamItemDateFieldProps { diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/item_field.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/item_field.tsx similarity index 93% rename from x-pack/plugins/infra/public/components/logging/log_text_stream/item_field.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/item_field.tsx index c9d360fc116a7..19343057ed5f8 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/item_field.tsx +++ b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/item_field.tsx @@ -6,7 +6,7 @@ import styled from 'styled-components'; -import { switchProp } from '../../../utils/styles'; +import { switchProp } from '../../../../utils/styles'; export const LogTextStreamItemField = styled.div.attrs<{ scale?: 'small' | 'medium' | 'large'; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/item_message_field.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/item_message_field.tsx similarity index 96% rename from x-pack/plugins/infra/public/components/logging/log_text_stream/item_message_field.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/item_message_field.tsx index 1c411adaf4e1c..4f8de9a819176 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/item_message_field.tsx +++ b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/item_message_field.tsx @@ -8,8 +8,8 @@ import { darken } from 'polished'; import * as React from 'react'; import styled, { css } from 'styled-components'; -import { TextScale } from '../../../../common/log_text_scale'; -import { tintOrShade } from '../../../utils/styles'; +import { TextScale } from '../../../../../common/log_text_scale'; +import { tintOrShade } from '../../../../utils/styles'; import { LogTextStreamItemField } from './item_field'; interface LogTextStreamItemMessageFieldProps { diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/item_view.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/item_view.tsx similarity index 93% rename from x-pack/plugins/infra/public/components/logging/log_text_stream/item_view.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/item_view.tsx index c4a75771fa5a0..8362db752b0f4 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/item_view.tsx +++ b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/item_view.tsx @@ -6,7 +6,7 @@ import * as React from 'react'; -import { TextScale } from '../../../../common/log_text_scale'; +import { TextScale } from '../../../../../common/log_text_scale'; import { StreamItem } from './item'; import { LogTextStreamLogEntryItemView } from './log_entry_item_view'; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/loading_item_view.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/loading_item_view.tsx diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/log_entry_item_view.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/log_entry_item_view.tsx similarity index 91% rename from x-pack/plugins/infra/public/components/logging/log_text_stream/log_entry_item_view.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/log_entry_item_view.tsx index 2e910cad56785..f5a8f42fb2c4a 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/log_entry_item_view.tsx +++ b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/log_entry_item_view.tsx @@ -7,10 +7,10 @@ import * as React from 'react'; import styled from 'styled-components'; -import { LogEntry } from '../../../../common/log_entry'; -import { SearchResult } from '../../../../common/log_search_result'; -import { TextScale } from '../../../../common/log_text_scale'; -import { formatTime } from '../../../../common/time'; +import { LogEntry } from '../../../../../common/log_entry'; +import { SearchResult } from '../../../../../common/log_search_result'; +import { TextScale } from '../../../../../common/log_text_scale'; +import { formatTime } from '../../../../../common/time'; import { LogTextStreamItemDateField } from './item_date_field'; import { LogTextStreamItemMessageField } from './item_message_field'; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/log_entry_stream_item_view_.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/log_entry_stream_item_view_.tsx similarity index 93% rename from x-pack/plugins/infra/public/components/logging/log_text_stream/log_entry_stream_item_view_.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/log_entry_stream_item_view_.tsx index 98bc10a6240d9..a4723f129b729 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/log_entry_stream_item_view_.tsx +++ b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/log_entry_stream_item_view_.tsx @@ -7,7 +7,7 @@ import * as React from 'react'; import styled from 'styled-components'; -import { LogEntry } from '../../../../common/log_entry'; +import { LogEntry } from '../../../../../common/log_entry'; interface LogEntryStreamItemViewProps { boundingBoxRef?: React.Ref<{}>; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/measurable_item_view.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/measurable_item_view.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/logging/log_text_stream/measurable_item_view.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/measurable_item_view.tsx diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/relative_time.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/relative_time.tsx similarity index 98% rename from x-pack/plugins/infra/public/components/logging/log_text_stream/relative_time.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/relative_time.tsx index 247b444a3b6a6..87299bdaab5b2 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/relative_time.tsx +++ b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/relative_time.tsx @@ -6,7 +6,7 @@ import * as React from 'react'; -import { decomposeIntoUnits, getLabelOfScale, TimeUnit } from '../../../../common/time'; +import { decomposeIntoUnits, getLabelOfScale, TimeUnit } from '../../../../../common/time'; interface RelativeTimeProps { time: number; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx similarity index 95% rename from x-pack/plugins/infra/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx index 8b0ededac73c3..5b28c58921407 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx +++ b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx @@ -6,10 +6,10 @@ import * as React from 'react'; -import { TextScale } from '../../../../common/log_text_scale'; -import { TimeKey } from '../../../../common/time'; -import { callWithoutRepeats } from '../../../utils/handlers'; -import { InfraLoadingPanel } from '../../loading'; +import { TextScale } from '../../../../../common/log_text_scale'; +import { TimeKey } from '../../../../../common/time'; +import { InfraLoadingPanel } from '../../../../components/loading'; +import { callWithoutRepeats } from '../../../../utils/handlers'; import { LogTextStreamEmptyView } from './empty_view'; import { getStreamItemBeforeTimeKey, getStreamItemId, parseStreamItemId, StreamItem } from './item'; import { LogTextStreamItemView } from './item_view'; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/vertical_scroll_panel.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/vertical_scroll_panel.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/logging/log_text_stream/vertical_scroll_panel.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_text_stream/vertical_scroll_panel.tsx diff --git a/x-pack/plugins/infra/public/components/logging/log_text_wrap_controls.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_text_wrap_controls.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/logging/log_text_wrap_controls.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_text_wrap_controls.tsx diff --git a/x-pack/plugins/infra/public/components/logging/log_time_controls.tsx b/x-pack/plugins/ingest/public/logs/components/logging/log_time_controls.tsx similarity index 100% rename from x-pack/plugins/infra/public/components/logging/log_time_controls.tsx rename to x-pack/plugins/ingest/public/logs/components/logging/log_time_controls.tsx diff --git a/x-pack/plugins/infra/public/containers/logs/with_log_filter.tsx b/x-pack/plugins/ingest/public/logs/containers/logs/with_log_filter.tsx similarity index 92% rename from x-pack/plugins/infra/public/containers/logs/with_log_filter.tsx rename to x-pack/plugins/ingest/public/logs/containers/logs/with_log_filter.tsx index fba0075c3c3b3..a1f9b674561ee 100644 --- a/x-pack/plugins/infra/public/containers/logs/with_log_filter.tsx +++ b/x-pack/plugins/ingest/public/logs/containers/logs/with_log_filter.tsx @@ -7,10 +7,10 @@ import React from 'react'; import { connect } from 'react-redux'; -import { logFilterActions, logFilterSelectors, State } from '../../store'; -import { asChildFunctionRenderer } from '../../utils/typed_react'; -import { bindPlainActionCreators } from '../../utils/typed_redux'; -import { replaceStateKeyInQueryString, UrlStateContainer } from '../../utils/url_state'; +import { logFilterActions, logFilterSelectors, State } from '../../../store'; +import { asChildFunctionRenderer } from '../../../utils/typed_react'; +import { bindPlainActionCreators } from '../../../utils/typed_redux'; +import { replaceStateKeyInQueryString, UrlStateContainer } from '../../../utils/url_state'; const withLogFilter = connect( (state: State) => ({ diff --git a/x-pack/plugins/infra/public/containers/logs/with_log_minimap.tsx b/x-pack/plugins/ingest/public/logs/containers/logs/with_log_minimap.tsx similarity index 91% rename from x-pack/plugins/infra/public/containers/logs/with_log_minimap.tsx rename to x-pack/plugins/ingest/public/logs/containers/logs/with_log_minimap.tsx index a5ad500eaeb45..6fede19cee2ed 100644 --- a/x-pack/plugins/infra/public/containers/logs/with_log_minimap.tsx +++ b/x-pack/plugins/ingest/public/logs/containers/logs/with_log_minimap.tsx @@ -8,10 +8,10 @@ import React from 'react'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; -import { logMinimapActions, logMinimapSelectors, State } from '../../store'; -import { asChildFunctionRenderer } from '../../utils/typed_react'; -import { bindPlainActionCreators } from '../../utils/typed_redux'; -import { UrlStateContainer } from '../../utils/url_state'; +import { logMinimapActions, logMinimapSelectors, State } from '../../../store'; +import { asChildFunctionRenderer } from '../../../utils/typed_react'; +import { bindPlainActionCreators } from '../../../utils/typed_redux'; +import { UrlStateContainer } from '../../../utils/url_state'; export const withLogMinimap = connect( (state: State) => ({ diff --git a/x-pack/plugins/infra/public/containers/logs/with_log_position.tsx b/x-pack/plugins/ingest/public/logs/containers/logs/with_log_position.tsx similarity index 94% rename from x-pack/plugins/infra/public/containers/logs/with_log_position.tsx rename to x-pack/plugins/ingest/public/logs/containers/logs/with_log_position.tsx index a548ae62facb0..18305451d4afe 100644 --- a/x-pack/plugins/infra/public/containers/logs/with_log_position.tsx +++ b/x-pack/plugins/ingest/public/logs/containers/logs/with_log_position.tsx @@ -8,11 +8,11 @@ import React from 'react'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; -import { pickTimeKey } from '../../../common/time'; -import { logPositionActions, logPositionSelectors, State } from '../../store'; -import { asChildFunctionRenderer } from '../../utils/typed_react'; -import { bindPlainActionCreators } from '../../utils/typed_redux'; -import { replaceStateKeyInQueryString, UrlStateContainer } from '../../utils/url_state'; +import { pickTimeKey } from '../../../../common/time'; +import { logPositionActions, logPositionSelectors, State } from '../../../store'; +import { asChildFunctionRenderer } from '../../../utils/typed_react'; +import { bindPlainActionCreators } from '../../../utils/typed_redux'; +import { replaceStateKeyInQueryString, UrlStateContainer } from '../../../utils/url_state'; export const withLogPosition = connect( (state: State) => ({ diff --git a/x-pack/plugins/infra/public/containers/logs/with_log_search_controls_props.ts b/x-pack/plugins/ingest/public/logs/containers/logs/with_log_search_controls_props.ts similarity index 92% rename from x-pack/plugins/infra/public/containers/logs/with_log_search_controls_props.ts rename to x-pack/plugins/ingest/public/logs/containers/logs/with_log_search_controls_props.ts index e387da9575426..9d99acb7f98d2 100644 --- a/x-pack/plugins/infra/public/containers/logs/with_log_search_controls_props.ts +++ b/x-pack/plugins/ingest/public/logs/containers/logs/with_log_search_controls_props.ts @@ -11,7 +11,7 @@ * be removed during the refactoring to graphql/apollo. */ import { connect } from 'react-redux'; -import { bindPlainActionCreators } from '../../utils/typed_redux'; +import { bindPlainActionCreators } from '../../../utils/typed_redux'; import { // searchActions, @@ -19,7 +19,7 @@ import { // sharedSelectors, logPositionActions, State, -} from '../../store'; +} from '../../../store'; export const withLogSearchControlsProps = connect( (state: State) => ({ diff --git a/x-pack/plugins/infra/public/containers/logs/with_log_textview.tsx b/x-pack/plugins/ingest/public/logs/containers/logs/with_log_textview.tsx similarity index 90% rename from x-pack/plugins/infra/public/containers/logs/with_log_textview.tsx rename to x-pack/plugins/ingest/public/logs/containers/logs/with_log_textview.tsx index 5d22bc481b783..a870183f86e90 100644 --- a/x-pack/plugins/infra/public/containers/logs/with_log_textview.tsx +++ b/x-pack/plugins/ingest/public/logs/containers/logs/with_log_textview.tsx @@ -8,11 +8,11 @@ import React from 'react'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; -import { TextScale } from '../../../common/log_text_scale'; -import { logTextviewActions, logTextviewSelectors, State } from '../../store'; -import { asChildFunctionRenderer } from '../../utils/typed_react'; -import { bindPlainActionCreators } from '../../utils/typed_redux'; -import { UrlStateContainer } from '../../utils/url_state'; +import { TextScale } from '../../../../common/log_text_scale'; +import { logTextviewActions, logTextviewSelectors, State } from '../../../store'; +import { asChildFunctionRenderer } from '../../../utils/typed_react'; +import { bindPlainActionCreators } from '../../../utils/typed_redux'; +import { UrlStateContainer } from '../../../utils/url_state'; const availableTextScales = ['large', 'medium', 'small'] as TextScale[]; diff --git a/x-pack/plugins/infra/public/containers/logs/with_stream_items.ts b/x-pack/plugins/ingest/public/logs/containers/logs/with_stream_items.ts similarity index 90% rename from x-pack/plugins/infra/public/containers/logs/with_stream_items.ts rename to x-pack/plugins/ingest/public/logs/containers/logs/with_stream_items.ts index 3421f93956bc9..b4151799b882c 100644 --- a/x-pack/plugins/infra/public/containers/logs/with_stream_items.ts +++ b/x-pack/plugins/ingest/public/logs/containers/logs/with_stream_items.ts @@ -7,10 +7,10 @@ import { connect } from 'react-redux'; import { createSelector } from 'reselect'; -import { SearchResult } from '../../../common/log_search_result'; -import { logEntriesSelectors, logPositionSelectors, State } from '../../store'; -import { LogEntry, LogEntryMessageSegment } from '../../utils/log_entry'; -import { asChildFunctionRenderer } from '../../utils/typed_react'; +import { SearchResult } from '../../../../common/log_search_result'; +import { logEntriesSelectors, logPositionSelectors, State } from '../../../store'; +import { LogEntry, LogEntryMessageSegment } from '../../../utils/log_entry'; +import { asChildFunctionRenderer } from '../../../utils/typed_react'; export const withStreamItems = connect( (state: State) => ({ diff --git a/x-pack/plugins/infra/public/containers/logs/with_summary.ts b/x-pack/plugins/ingest/public/logs/containers/logs/with_summary.ts similarity index 79% rename from x-pack/plugins/infra/public/containers/logs/with_summary.ts rename to x-pack/plugins/ingest/public/logs/containers/logs/with_summary.ts index 424da80b460df..d52b0d838478e 100644 --- a/x-pack/plugins/infra/public/containers/logs/with_summary.ts +++ b/x-pack/plugins/ingest/public/logs/containers/logs/with_summary.ts @@ -6,9 +6,9 @@ import { connect } from 'react-redux'; -import { logSummaryActions, logSummarySelectors, State } from '../../store'; -import { asChildFunctionRenderer } from '../../utils/typed_react'; -import { bindPlainActionCreators } from '../../utils/typed_redux'; +import { logSummaryActions, logSummarySelectors, State } from '../../../store'; +import { asChildFunctionRenderer } from '../../../utils/typed_react'; +import { bindPlainActionCreators } from '../../../utils/typed_redux'; export const withSummary = connect( (state: State) => ({ diff --git a/x-pack/plugins/ingest/public/logs/containers/with_kibana_chrome.tsx b/x-pack/plugins/ingest/public/logs/containers/with_kibana_chrome.tsx new file mode 100644 index 0000000000000..c767a57b60923 --- /dev/null +++ b/x-pack/plugins/ingest/public/logs/containers/with_kibana_chrome.tsx @@ -0,0 +1,28 @@ +/* + * 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. + */ + +/* + * + * 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 React from 'react'; +import chrome from 'ui/chrome'; + +import { RendererFunction } from '../../utils/typed_react'; + +interface WithKibanaChromeProps { + children: RendererFunction<{ + basePath: string; + }>; +} + +export const WithKibanaChrome: React.SFC = ({ children }) => + children({ + basePath: chrome.getBasePath(), + }); diff --git a/x-pack/plugins/ingest/public/logs/containers/with_kuery_autocompletion.tsx b/x-pack/plugins/ingest/public/logs/containers/with_kuery_autocompletion.tsx new file mode 100644 index 0000000000000..4a6779fc83ef5 --- /dev/null +++ b/x-pack/plugins/ingest/public/logs/containers/with_kuery_autocompletion.tsx @@ -0,0 +1,108 @@ +/* + * 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 React from 'react'; +import { connect } from 'react-redux'; + +import { AutocompleteSuggestion, getAutocompleteProvider } from 'ui/autocomplete_providers'; +import { StaticIndexPattern } from 'ui/index_patterns'; + +import { sourceSelectors, State } from '../../store'; +import { RendererFunction } from '../../utils/typed_react'; + +const withIndexPattern = connect((state: State) => ({ + indexPattern: sourceSelectors.selectDerivedIndexPattern(state), +})); + +interface WithKueryAutocompletionLifecycleProps { + children: RendererFunction<{ + isLoadingSuggestions: boolean; + loadSuggestions: (expression: string, cursorPosition: number, maxSuggestions?: number) => void; + suggestions: AutocompleteSuggestion[]; + }>; + indexPattern: StaticIndexPattern; +} + +interface WithKueryAutocompletionLifecycleState { + // lacking cancellation support in the autocompletion api, + // this is used to keep older, slower requests from clobbering newer ones + currentRequest: { + expression: string; + cursorPosition: number; + } | null; + suggestions: AutocompleteSuggestion[]; +} + +export const WithKueryAutocompletion = withIndexPattern( + class WithKueryAutocompletionLifecycle extends React.Component< + WithKueryAutocompletionLifecycleProps, + WithKueryAutocompletionLifecycleState + > { + public readonly state: WithKueryAutocompletionLifecycleState = { + currentRequest: null, + suggestions: [], + }; + + public render() { + const { currentRequest, suggestions } = this.state; + + return this.props.children({ + isLoadingSuggestions: currentRequest !== null, + loadSuggestions: this.loadSuggestions, + suggestions, + }); + } + + private loadSuggestions = async ( + expression: string, + cursorPosition: number, + maxSuggestions?: number + ) => { + const { indexPattern } = this.props; + const autocompletionProvider = getAutocompleteProvider('kuery'); + const config = { + get: () => true, + }; + + if (!autocompletionProvider) { + return; + } + + const getSuggestions = autocompletionProvider({ + config, + indexPatterns: [indexPattern], + boolFilter: [], + }); + + this.setState({ + currentRequest: { + expression, + cursorPosition, + }, + suggestions: [], + }); + + const suggestions = await getSuggestions({ + query: expression, + selectionStart: cursorPosition, + selectionEnd: cursorPosition, + }); + + this.setState( + state => + state.currentRequest && + state.currentRequest.expression !== expression && + state.currentRequest.cursorPosition !== cursorPosition + ? state // ignore this result, since a newer request is in flight + : { + ...state, + currentRequest: null, + suggestions: maxSuggestions ? suggestions.slice(0, maxSuggestions) : suggestions, + } + ); + }; + } +); diff --git a/x-pack/plugins/ingest/public/logs/containers/with_options.tsx b/x-pack/plugins/ingest/public/logs/containers/with_options.tsx new file mode 100644 index 0000000000000..e57ed3cc86c44 --- /dev/null +++ b/x-pack/plugins/ingest/public/logs/containers/with_options.tsx @@ -0,0 +1,95 @@ +/* + * 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 moment from 'moment'; +import React from 'react'; + +import { InfraMetricType, InfraPathType } from '../../../common/graphql/types'; +import { + InfraFormatterType, + InfraOptions, + InfraWaffleMapLegendMode, + // InfraWaffleMapRuleOperator, +} from '../../lib/lib'; +import { RendererFunction } from '../../utils/typed_react'; + +const initialState = { + options: { + sourceId: 'default', + timerange: { + interval: '1m', + to: moment.utc().valueOf(), + from: moment + .utc() + .subtract(1, 'h') + .valueOf(), + }, + wafflemap: { + formatter: InfraFormatterType.percent, + formatTemplate: '{{value}}', + metric: { type: InfraMetricType.cpu }, + path: [{ type: InfraPathType.hosts }], + /* + legend: { + type: InfraWaffleMapLegendMode.step, + rules: [ + { + value: 0, + color: '#00B3A4', + operator: InfraWaffleMapRuleOperator.gte, + label: 'Ok', + }, + { + value: 10000, + color: '#DB1374', + operator: InfraWaffleMapRuleOperator.gte, + label: 'Over 10,000', + }, + ], + }, + */ + legend: { + type: InfraWaffleMapLegendMode.gradient, + rules: [ + { + value: 0, + color: '#D9D9D9', + }, + { + value: 0.65, + color: '#00B3A4', + }, + { + value: 0.8, + color: '#E6C220', + }, + { + value: 1, + color: '#DB1374', + }, + ], + }, + }, + } as InfraOptions, +}; + +interface WithOptionsProps { + children: RendererFunction; +} + +type State = Readonly; + +export const withOptions =

(WrappedComponent: React.ComponentType

) => ( + {args => } +); + +export class WithOptions extends React.Component { + public readonly state: State = initialState; + + public render() { + return this.props.children(this.state.options); + } +} diff --git a/x-pack/plugins/ingest/public/logs/containers/with_source.ts b/x-pack/plugins/ingest/public/logs/containers/with_source.ts new file mode 100644 index 0000000000000..4ca9397972ba4 --- /dev/null +++ b/x-pack/plugins/ingest/public/logs/containers/with_source.ts @@ -0,0 +1,18 @@ +/* + * 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 { connect } from 'react-redux'; + +import { sourceSelectors, State } from '../../store'; +import { asChildFunctionRenderer } from '../../utils/typed_react'; + +export const withSource = connect((state: State) => ({ + configuredFields: sourceSelectors.selectSourceFields(state), + logIndicesExist: sourceSelectors.selectSourceLogIndicesExist(state), + metricIndicesExist: sourceSelectors.selectSourceMetricIndicesExist(state), +})); + +export const WithSource = asChildFunctionRenderer(withSource); diff --git a/x-pack/plugins/ingest/public/logs/containers/with_state_from_location.tsx b/x-pack/plugins/ingest/public/logs/containers/with_state_from_location.tsx new file mode 100644 index 0000000000000..17df3f5c27454 --- /dev/null +++ b/x-pack/plugins/ingest/public/logs/containers/with_state_from_location.tsx @@ -0,0 +1,126 @@ +/* + * 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 { Location } from 'history'; +import omit from 'lodash/fp/omit'; +import { parse as parseQueryString, stringify as stringifyQueryString } from 'querystring'; +import React from 'react'; +import { RouteComponentProps, withRouter } from 'react-router'; +import { decode_object, encode_object } from 'rison-node'; +import { Omit } from '../../lib/lib'; + +interface AnyObject { + [key: string]: any; +} + +interface WithStateFromLocationOptions { + mapLocationToState: (location: Location) => StateInLocation; + mapStateToLocation: (state: StateInLocation, location: Location) => Location; +} + +type InjectedPropsFromLocation = Partial & { + pushStateInLocation?: (state: StateInLocation) => void; + replaceStateInLocation?: (state: StateInLocation) => void; +}; + +export const withStateFromLocation = ({ + mapLocationToState, + mapStateToLocation, +}: WithStateFromLocationOptions) => < + WrappedComponentProps extends InjectedPropsFromLocation +>( + WrappedComponent: React.ComponentType +) => { + const wrappedName = WrappedComponent.displayName || WrappedComponent.name; + + return withRouter( + class WithStateFromLocation extends React.PureComponent< + RouteComponentProps<{}> & + Omit> + > { + public static displayName = `WithStateFromLocation(${wrappedName})`; + + public render() { + const { location } = this.props; + const otherProps = omit(['location', 'history', 'match', 'staticContext'], this.props); + + const stateFromLocation = mapLocationToState(location); + + return ( + + ); + } + + private pushStateInLocation = (state: StateInLocation) => { + const { history, location } = this.props; + + const newLocation = mapStateToLocation(state, this.props.location); + + if (newLocation !== location) { + history.push(newLocation); + } + }; + + private replaceStateInLocation = (state: StateInLocation) => { + const { history, location } = this.props; + + const newLocation = mapStateToLocation(state, this.props.location); + + if (newLocation !== location) { + history.replace(newLocation); + } + }; + } + ); +}; + +const decodeRisonAppState = (queryValues: { _a?: string }): AnyObject => { + try { + return queryValues && queryValues._a ? decode_object(queryValues._a) : {}; + } catch (error) { + if (error instanceof Error && error.message.startsWith('rison decoder error')) { + return {}; + } + throw error; + } +}; + +const encodeRisonAppState = (state: AnyObject) => ({ + _a: encode_object(state), +}); + +export const mapRisonAppLocationToState = ( + mapState: (risonAppState: AnyObject) => State = (state: AnyObject) => state as State +) => (location: Location): State => { + const queryValues = parseQueryString(location.search.substring(1)); + const decodedState = decodeRisonAppState(queryValues); + return mapState(decodedState); +}; + +export const mapStateToRisonAppLocation = ( + mapState: (state: State) => AnyObject = (state: State) => state +) => (state: State, location: Location): Location => { + const previousQueryValues = parseQueryString(location.search.substring(1)); + const previousState = decodeRisonAppState(previousQueryValues); + + const encodedState = encodeRisonAppState({ + ...previousState, + ...mapState(state), + }); + const newQueryValues = stringifyQueryString({ + ...previousQueryValues, + ...encodedState, + }); + return { + ...location, + search: `?${newQueryValues}`, + }; +}; diff --git a/x-pack/plugins/infra/public/pages/logs/index.ts b/x-pack/plugins/ingest/public/logs/pages/logs/index.ts similarity index 100% rename from x-pack/plugins/infra/public/pages/logs/index.ts rename to x-pack/plugins/ingest/public/logs/pages/logs/index.ts diff --git a/x-pack/plugins/infra/public/pages/logs/logs.tsx b/x-pack/plugins/ingest/public/logs/pages/logs/logs.tsx similarity index 91% rename from x-pack/plugins/infra/public/pages/logs/logs.tsx rename to x-pack/plugins/ingest/public/logs/pages/logs/logs.tsx index 1b001d7404785..1fcfa4f263027 100644 --- a/x-pack/plugins/infra/public/pages/logs/logs.tsx +++ b/x-pack/plugins/ingest/public/logs/pages/logs/logs.tsx @@ -9,9 +9,9 @@ import React from 'react'; import { LogsPageContent } from './page_content'; import { LogsToolbar } from './toolbar'; -import { EmptyPage } from '../../components/empty_page'; -import { Header } from '../../components/header'; -import { ColumnarPage } from '../../components/page'; +import { EmptyPage } from '../../../components/empty_page'; +import { Header } from '../../../components/header'; +import { ColumnarPage } from '../../../components/page'; import { WithLogFilterUrlState } from '../../containers/logs/with_log_filter'; import { WithLogMinimapUrlState } from '../../containers/logs/with_log_minimap'; diff --git a/x-pack/plugins/infra/public/pages/logs/page_content.tsx b/x-pack/plugins/ingest/public/logs/pages/logs/page_content.tsx similarity index 97% rename from x-pack/plugins/infra/public/pages/logs/page_content.tsx rename to x-pack/plugins/ingest/public/logs/pages/logs/page_content.tsx index b30eed4b9c039..dbe3471700d7b 100644 --- a/x-pack/plugins/infra/public/pages/logs/page_content.tsx +++ b/x-pack/plugins/ingest/public/logs/pages/logs/page_content.tsx @@ -7,10 +7,10 @@ import React from 'react'; import styled from 'styled-components'; -import { AutoSizer } from '../../components/auto_sizer'; +import { AutoSizer } from '../../../components/auto_sizer'; +import { PageContent } from '../../../components/page'; import { LogMinimap } from '../../components/logging/log_minimap'; import { ScrollableLogTextStreamView } from '../../components/logging/log_text_stream'; -import { PageContent } from '../../components/page'; import { WithLogMinimap } from '../../containers/logs/with_log_minimap'; import { WithLogPosition } from '../../containers/logs/with_log_position'; import { WithLogTextview } from '../../containers/logs/with_log_textview'; diff --git a/x-pack/plugins/infra/public/pages/logs/toolbar.tsx b/x-pack/plugins/ingest/public/logs/pages/logs/toolbar.tsx similarity index 96% rename from x-pack/plugins/infra/public/pages/logs/toolbar.tsx rename to x-pack/plugins/ingest/public/logs/pages/logs/toolbar.tsx index 7c7c7004c4674..48de9137a11ec 100644 --- a/x-pack/plugins/infra/public/pages/logs/toolbar.tsx +++ b/x-pack/plugins/ingest/public/logs/pages/logs/toolbar.tsx @@ -7,8 +7,8 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import React from 'react'; -import { AutocompleteField } from '../../components/autocomplete_field'; -import { Toolbar } from '../../components/eui'; +import { AutocompleteField } from '../../../components/autocomplete_field'; +import { Toolbar } from '../../../components/eui'; import { LogCustomizationMenu } from '../../components/logging/log_customization_menu'; import { LogMinimapScaleControls } from '../../components/logging/log_minimap_scale_controls'; import { LogTextScaleControls } from '../../components/logging/log_text_scale_controls'; diff --git a/x-pack/plugins/ingest/public/logs/routes.tsx b/x-pack/plugins/ingest/public/logs/routes.tsx new file mode 100644 index 0000000000000..afa14560721d0 --- /dev/null +++ b/x-pack/plugins/ingest/public/logs/routes.tsx @@ -0,0 +1,19 @@ +/* + * 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 React from 'react'; +import { Redirect, Route, Switch } from 'react-router-dom'; + +import { NotFoundPage } from '../components/404'; +import { LogsPage } from './pages/logs'; + +export const LogsRoutes: React.SFC = () => ( + + + + + +); diff --git a/x-pack/plugins/infra/public/register_feature.ts b/x-pack/plugins/ingest/public/register_feature.ts similarity index 91% rename from x-pack/plugins/infra/public/register_feature.ts rename to x-pack/plugins/ingest/public/register_feature.ts index ca1260798b83c..235a8172fa254 100644 --- a/x-pack/plugins/infra/public/register_feature.ts +++ b/x-pack/plugins/ingest/public/register_feature.ts @@ -9,7 +9,7 @@ import { FeatureCatalogueRegistryProvider, } from 'ui/registry/feature_catalogue'; -const APP_ID = 'infra'; +const APP_ID = 'ingest'; FeatureCatalogueRegistryProvider.register(() => ({ id: 'infraops', @@ -17,7 +17,7 @@ FeatureCatalogueRegistryProvider.register(() => ({ description: 'Explore infrastructure metrics and logs for common servers, containers, and services.', icon: 'infraApp', - path: `/app/${APP_ID}#home`, + path: `/app/${APP_ID}#/infraops`, showOnHomePage: true, category: FeatureCatalogueCategory.DATA, })); @@ -28,7 +28,7 @@ FeatureCatalogueRegistryProvider.register(() => ({ description: 'Stream logs in real time or scroll through historical views in a console-like experience.', icon: 'loggingApp', - path: `/app/${APP_ID}#logs`, + path: `/app/${APP_ID}#/logs`, showOnHomePage: true, category: FeatureCatalogueCategory.DATA, })); diff --git a/x-pack/plugins/infra/public/routes.tsx b/x-pack/plugins/ingest/public/routes.tsx similarity index 60% rename from x-pack/plugins/infra/public/routes.tsx rename to x-pack/plugins/ingest/public/routes.tsx index ca23ebae2279f..46b132e79f64e 100644 --- a/x-pack/plugins/infra/public/routes.tsx +++ b/x-pack/plugins/ingest/public/routes.tsx @@ -8,11 +8,10 @@ import { History } from 'history'; import React from 'react'; import { Redirect, Route, Router, Switch } from 'react-router-dom'; -import { NotFoundPage } from './pages/404'; -import { HomePage } from './pages/home'; -import { LinkToPage } from './pages/link_to'; -import { LogsPage } from './pages/logs'; -import { MetricDetail } from './pages/metrics'; +import { NotFoundPage } from './components/404'; +import { InfraOpsApp } from './infraops/app'; +import { LinkToPage } from './link_to'; +import { LogsApp } from './logs/app'; interface RouterProps { history: History; @@ -22,11 +21,10 @@ export const PageRouter: React.SFC = ({ history }) => { return ( - - - + + + - diff --git a/x-pack/plugins/infra/public/store/actions.ts b/x-pack/plugins/ingest/public/store/actions.ts similarity index 100% rename from x-pack/plugins/infra/public/store/actions.ts rename to x-pack/plugins/ingest/public/store/actions.ts diff --git a/x-pack/plugins/infra/public/store/epics.ts b/x-pack/plugins/ingest/public/store/epics.ts similarity index 100% rename from x-pack/plugins/infra/public/store/epics.ts rename to x-pack/plugins/ingest/public/store/epics.ts diff --git a/x-pack/plugins/infra/public/store/index.ts b/x-pack/plugins/ingest/public/store/index.ts similarity index 100% rename from x-pack/plugins/infra/public/store/index.ts rename to x-pack/plugins/ingest/public/store/index.ts diff --git a/x-pack/plugins/infra/public/store/local/actions.ts b/x-pack/plugins/ingest/public/store/local/actions.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/actions.ts rename to x-pack/plugins/ingest/public/store/local/actions.ts diff --git a/x-pack/plugins/infra/public/store/local/epic.ts b/x-pack/plugins/ingest/public/store/local/epic.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/epic.ts rename to x-pack/plugins/ingest/public/store/local/epic.ts diff --git a/x-pack/plugins/infra/public/store/local/index.ts b/x-pack/plugins/ingest/public/store/local/index.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/index.ts rename to x-pack/plugins/ingest/public/store/local/index.ts diff --git a/x-pack/plugins/infra/public/store/local/log_filter/actions.ts b/x-pack/plugins/ingest/public/store/local/log_filter/actions.ts similarity index 87% rename from x-pack/plugins/infra/public/store/local/log_filter/actions.ts rename to x-pack/plugins/ingest/public/store/local/log_filter/actions.ts index acf28ab6092c6..1b6c24c18df6b 100644 --- a/x-pack/plugins/infra/public/store/local/log_filter/actions.ts +++ b/x-pack/plugins/ingest/public/store/local/log_filter/actions.ts @@ -8,7 +8,7 @@ import actionCreatorFactory from 'typescript-fsa'; import { FilterQuery } from './reducer'; -const actionCreator = actionCreatorFactory('x-pack/infra/local/log_filter'); +const actionCreator = actionCreatorFactory('x-pack/ingest/local/log_filter'); export const setLogFilterQueryDraft = actionCreator('SET_LOG_FILTER_QUERY_DRAFT'); diff --git a/x-pack/plugins/infra/public/store/local/log_filter/index.ts b/x-pack/plugins/ingest/public/store/local/log_filter/index.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/log_filter/index.ts rename to x-pack/plugins/ingest/public/store/local/log_filter/index.ts diff --git a/x-pack/plugins/infra/public/store/local/log_filter/reducer.ts b/x-pack/plugins/ingest/public/store/local/log_filter/reducer.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/log_filter/reducer.ts rename to x-pack/plugins/ingest/public/store/local/log_filter/reducer.ts diff --git a/x-pack/plugins/infra/public/store/local/log_filter/selectors.ts b/x-pack/plugins/ingest/public/store/local/log_filter/selectors.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/log_filter/selectors.ts rename to x-pack/plugins/ingest/public/store/local/log_filter/selectors.ts diff --git a/x-pack/plugins/infra/public/store/local/log_minimap/actions.ts b/x-pack/plugins/ingest/public/store/local/log_minimap/actions.ts similarity index 83% rename from x-pack/plugins/infra/public/store/local/log_minimap/actions.ts rename to x-pack/plugins/ingest/public/store/local/log_minimap/actions.ts index 019b1034b2bd9..6d11c6700e719 100644 --- a/x-pack/plugins/infra/public/store/local/log_minimap/actions.ts +++ b/x-pack/plugins/ingest/public/store/local/log_minimap/actions.ts @@ -6,6 +6,6 @@ import actionCreatorFactory from 'typescript-fsa'; -const actionCreator = actionCreatorFactory('x-pack/infra/local/log_minimap'); +const actionCreator = actionCreatorFactory('x-pack/ingest/local/log_minimap'); export const setMinimapIntervalSize = actionCreator('SET_MINIMAP_INTERVAL_SIZE'); diff --git a/x-pack/plugins/infra/public/store/local/log_minimap/index.ts b/x-pack/plugins/ingest/public/store/local/log_minimap/index.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/log_minimap/index.ts rename to x-pack/plugins/ingest/public/store/local/log_minimap/index.ts diff --git a/x-pack/plugins/infra/public/store/local/log_minimap/reducer.ts b/x-pack/plugins/ingest/public/store/local/log_minimap/reducer.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/log_minimap/reducer.ts rename to x-pack/plugins/ingest/public/store/local/log_minimap/reducer.ts diff --git a/x-pack/plugins/infra/public/store/local/log_minimap/selectors.ts b/x-pack/plugins/ingest/public/store/local/log_minimap/selectors.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/log_minimap/selectors.ts rename to x-pack/plugins/ingest/public/store/local/log_minimap/selectors.ts diff --git a/x-pack/plugins/infra/public/store/local/log_position/actions.ts b/x-pack/plugins/ingest/public/store/local/log_position/actions.ts similarity index 94% rename from x-pack/plugins/infra/public/store/local/log_position/actions.ts rename to x-pack/plugins/ingest/public/store/local/log_position/actions.ts index 0c677f17dd7ac..296237d95fe58 100644 --- a/x-pack/plugins/infra/public/store/local/log_position/actions.ts +++ b/x-pack/plugins/ingest/public/store/local/log_position/actions.ts @@ -8,7 +8,7 @@ import actionCreatorFactory from 'typescript-fsa'; import { TimeKey } from '../../../../common/time'; -const actionCreator = actionCreatorFactory('x-pack/infra/local/log_position'); +const actionCreator = actionCreatorFactory('x-pack/ingest/local/log_position'); export const jumpToTargetPosition = actionCreator('JUMP_TO_TARGET_POSITION'); diff --git a/x-pack/plugins/infra/public/store/local/log_position/epic.ts b/x-pack/plugins/ingest/public/store/local/log_position/epic.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/log_position/epic.ts rename to x-pack/plugins/ingest/public/store/local/log_position/epic.ts diff --git a/x-pack/plugins/infra/public/store/local/log_position/index.ts b/x-pack/plugins/ingest/public/store/local/log_position/index.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/log_position/index.ts rename to x-pack/plugins/ingest/public/store/local/log_position/index.ts diff --git a/x-pack/plugins/infra/public/store/local/log_position/reducer.ts b/x-pack/plugins/ingest/public/store/local/log_position/reducer.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/log_position/reducer.ts rename to x-pack/plugins/ingest/public/store/local/log_position/reducer.ts diff --git a/x-pack/plugins/infra/public/store/local/log_position/selectors.ts b/x-pack/plugins/ingest/public/store/local/log_position/selectors.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/log_position/selectors.ts rename to x-pack/plugins/ingest/public/store/local/log_position/selectors.ts diff --git a/x-pack/plugins/infra/public/store/local/log_textview/actions.ts b/x-pack/plugins/ingest/public/store/local/log_textview/actions.ts similarity index 86% rename from x-pack/plugins/infra/public/store/local/log_textview/actions.ts rename to x-pack/plugins/ingest/public/store/local/log_textview/actions.ts index 7aa63c8bb7fdd..25b4071fcffa4 100644 --- a/x-pack/plugins/infra/public/store/local/log_textview/actions.ts +++ b/x-pack/plugins/ingest/public/store/local/log_textview/actions.ts @@ -8,7 +8,7 @@ import actionCreatorFactory from 'typescript-fsa'; import { TextScale } from '../../../../common/log_text_scale'; -const actionCreator = actionCreatorFactory('x-pack/infra/local/log_textview'); +const actionCreator = actionCreatorFactory('x-pack/ingest/local/log_textview'); export const setTextviewScale = actionCreator('SET_TEXTVIEW_SCALE'); diff --git a/x-pack/plugins/infra/public/store/local/log_textview/index.ts b/x-pack/plugins/ingest/public/store/local/log_textview/index.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/log_textview/index.ts rename to x-pack/plugins/ingest/public/store/local/log_textview/index.ts diff --git a/x-pack/plugins/infra/public/store/local/log_textview/reducer.ts b/x-pack/plugins/ingest/public/store/local/log_textview/reducer.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/log_textview/reducer.ts rename to x-pack/plugins/ingest/public/store/local/log_textview/reducer.ts diff --git a/x-pack/plugins/infra/public/store/local/log_textview/selectors.ts b/x-pack/plugins/ingest/public/store/local/log_textview/selectors.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/log_textview/selectors.ts rename to x-pack/plugins/ingest/public/store/local/log_textview/selectors.ts diff --git a/x-pack/plugins/infra/public/store/local/metric_time/actions.ts b/x-pack/plugins/ingest/public/store/local/metric_time/actions.ts similarity index 88% rename from x-pack/plugins/infra/public/store/local/metric_time/actions.ts rename to x-pack/plugins/ingest/public/store/local/metric_time/actions.ts index 8dec727c895c0..4df8fc5099982 100644 --- a/x-pack/plugins/infra/public/store/local/metric_time/actions.ts +++ b/x-pack/plugins/ingest/public/store/local/metric_time/actions.ts @@ -6,7 +6,7 @@ import actionCreatorFactory from 'typescript-fsa'; -const actionCreator = actionCreatorFactory('x-pack/infra/local/waffle_time'); +const actionCreator = actionCreatorFactory('x-pack/ingest/local/waffle_time'); export interface MetricRangeTimeState { to: number; diff --git a/x-pack/plugins/infra/public/store/local/metric_time/epic.ts b/x-pack/plugins/ingest/public/store/local/metric_time/epic.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/metric_time/epic.ts rename to x-pack/plugins/ingest/public/store/local/metric_time/epic.ts diff --git a/x-pack/plugins/infra/public/store/local/metric_time/index.ts b/x-pack/plugins/ingest/public/store/local/metric_time/index.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/metric_time/index.ts rename to x-pack/plugins/ingest/public/store/local/metric_time/index.ts diff --git a/x-pack/plugins/infra/public/store/local/metric_time/reducer.ts b/x-pack/plugins/ingest/public/store/local/metric_time/reducer.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/metric_time/reducer.ts rename to x-pack/plugins/ingest/public/store/local/metric_time/reducer.ts diff --git a/x-pack/plugins/infra/public/store/local/metric_time/selectors.ts b/x-pack/plugins/ingest/public/store/local/metric_time/selectors.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/metric_time/selectors.ts rename to x-pack/plugins/ingest/public/store/local/metric_time/selectors.ts diff --git a/x-pack/plugins/infra/public/store/local/reducer.ts b/x-pack/plugins/ingest/public/store/local/reducer.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/reducer.ts rename to x-pack/plugins/ingest/public/store/local/reducer.ts diff --git a/x-pack/plugins/infra/public/store/local/selectors.ts b/x-pack/plugins/ingest/public/store/local/selectors.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/selectors.ts rename to x-pack/plugins/ingest/public/store/local/selectors.ts diff --git a/x-pack/plugins/infra/public/store/local/waffle_filter/actions.ts b/x-pack/plugins/ingest/public/store/local/waffle_filter/actions.ts similarity index 86% rename from x-pack/plugins/infra/public/store/local/waffle_filter/actions.ts rename to x-pack/plugins/ingest/public/store/local/waffle_filter/actions.ts index 3f2c8839308c1..39f89728505cd 100644 --- a/x-pack/plugins/infra/public/store/local/waffle_filter/actions.ts +++ b/x-pack/plugins/ingest/public/store/local/waffle_filter/actions.ts @@ -8,7 +8,7 @@ import actionCreatorFactory from 'typescript-fsa'; import { FilterQuery } from './reducer'; -const actionCreator = actionCreatorFactory('x-pack/infra/local/waffle_filter'); +const actionCreator = actionCreatorFactory('x-pack/ingest/local/waffle_filter'); export const setWaffleFilterQueryDraft = actionCreator( 'SET_WAFFLE_FILTER_QUERY_DRAFT' diff --git a/x-pack/plugins/infra/public/store/local/waffle_filter/index.ts b/x-pack/plugins/ingest/public/store/local/waffle_filter/index.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/waffle_filter/index.ts rename to x-pack/plugins/ingest/public/store/local/waffle_filter/index.ts diff --git a/x-pack/plugins/infra/public/store/local/waffle_filter/reducer.ts b/x-pack/plugins/ingest/public/store/local/waffle_filter/reducer.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/waffle_filter/reducer.ts rename to x-pack/plugins/ingest/public/store/local/waffle_filter/reducer.ts diff --git a/x-pack/plugins/infra/public/store/local/waffle_filter/selectors.ts b/x-pack/plugins/ingest/public/store/local/waffle_filter/selectors.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/waffle_filter/selectors.ts rename to x-pack/plugins/ingest/public/store/local/waffle_filter/selectors.ts diff --git a/x-pack/plugins/infra/public/store/local/waffle_options/actions.ts b/x-pack/plugins/ingest/public/store/local/waffle_options/actions.ts similarity index 89% rename from x-pack/plugins/infra/public/store/local/waffle_options/actions.ts rename to x-pack/plugins/ingest/public/store/local/waffle_options/actions.ts index 04c0a1d112306..a703731b62a30 100644 --- a/x-pack/plugins/infra/public/store/local/waffle_options/actions.ts +++ b/x-pack/plugins/ingest/public/store/local/waffle_options/actions.ts @@ -8,7 +8,7 @@ import actionCreatorFactory from 'typescript-fsa'; import { InfraMetricInput, InfraPathInput } from '../../../../common/graphql/types'; import { InfraNodeType } from '../../../../server/lib/adapters/nodes'; -const actionCreator = actionCreatorFactory('x-pack/infra/local/waffle_options'); +const actionCreator = actionCreatorFactory('x-pack/ingest/local/waffle_options'); export const changeMetric = actionCreator('CHANGE_METRIC'); export const changeGroupBy = actionCreator('CHANGE_GROUP_BY'); diff --git a/x-pack/plugins/infra/public/store/local/waffle_options/index.ts b/x-pack/plugins/ingest/public/store/local/waffle_options/index.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/waffle_options/index.ts rename to x-pack/plugins/ingest/public/store/local/waffle_options/index.ts diff --git a/x-pack/plugins/infra/public/store/local/waffle_options/reducer.ts b/x-pack/plugins/ingest/public/store/local/waffle_options/reducer.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/waffle_options/reducer.ts rename to x-pack/plugins/ingest/public/store/local/waffle_options/reducer.ts diff --git a/x-pack/plugins/infra/public/store/local/waffle_options/selector.ts b/x-pack/plugins/ingest/public/store/local/waffle_options/selector.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/waffle_options/selector.ts rename to x-pack/plugins/ingest/public/store/local/waffle_options/selector.ts diff --git a/x-pack/plugins/infra/public/store/local/waffle_time/actions.ts b/x-pack/plugins/ingest/public/store/local/waffle_time/actions.ts similarity index 86% rename from x-pack/plugins/infra/public/store/local/waffle_time/actions.ts rename to x-pack/plugins/ingest/public/store/local/waffle_time/actions.ts index fe79f2f536a93..ef8c294838d8a 100644 --- a/x-pack/plugins/infra/public/store/local/waffle_time/actions.ts +++ b/x-pack/plugins/ingest/public/store/local/waffle_time/actions.ts @@ -6,7 +6,7 @@ import actionCreatorFactory from 'typescript-fsa'; -const actionCreator = actionCreatorFactory('x-pack/infra/local/waffle_time'); +const actionCreator = actionCreatorFactory('x-pack/ingest/local/waffle_time'); export const jumpToTime = actionCreator('JUMP_TO_TIME'); diff --git a/x-pack/plugins/infra/public/store/local/waffle_time/epic.ts b/x-pack/plugins/ingest/public/store/local/waffle_time/epic.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/waffle_time/epic.ts rename to x-pack/plugins/ingest/public/store/local/waffle_time/epic.ts diff --git a/x-pack/plugins/infra/public/store/local/waffle_time/index.ts b/x-pack/plugins/ingest/public/store/local/waffle_time/index.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/waffle_time/index.ts rename to x-pack/plugins/ingest/public/store/local/waffle_time/index.ts diff --git a/x-pack/plugins/infra/public/store/local/waffle_time/reducer.ts b/x-pack/plugins/ingest/public/store/local/waffle_time/reducer.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/waffle_time/reducer.ts rename to x-pack/plugins/ingest/public/store/local/waffle_time/reducer.ts diff --git a/x-pack/plugins/infra/public/store/local/waffle_time/selectors.ts b/x-pack/plugins/ingest/public/store/local/waffle_time/selectors.ts similarity index 100% rename from x-pack/plugins/infra/public/store/local/waffle_time/selectors.ts rename to x-pack/plugins/ingest/public/store/local/waffle_time/selectors.ts diff --git a/x-pack/plugins/infra/public/store/reducer.ts b/x-pack/plugins/ingest/public/store/reducer.ts similarity index 100% rename from x-pack/plugins/infra/public/store/reducer.ts rename to x-pack/plugins/ingest/public/store/reducer.ts diff --git a/x-pack/plugins/infra/public/store/remote/actions.ts b/x-pack/plugins/ingest/public/store/remote/actions.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/actions.ts rename to x-pack/plugins/ingest/public/store/remote/actions.ts diff --git a/x-pack/plugins/infra/public/store/remote/epic.ts b/x-pack/plugins/ingest/public/store/remote/epic.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/epic.ts rename to x-pack/plugins/ingest/public/store/remote/epic.ts diff --git a/x-pack/plugins/infra/public/store/remote/index.ts b/x-pack/plugins/ingest/public/store/remote/index.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/index.ts rename to x-pack/plugins/ingest/public/store/remote/index.ts diff --git a/x-pack/plugins/infra/public/store/remote/log_entries/actions.ts b/x-pack/plugins/ingest/public/store/remote/log_entries/actions.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/log_entries/actions.ts rename to x-pack/plugins/ingest/public/store/remote/log_entries/actions.ts diff --git a/x-pack/plugins/infra/public/store/remote/log_entries/epic.ts b/x-pack/plugins/ingest/public/store/remote/log_entries/epic.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/log_entries/epic.ts rename to x-pack/plugins/ingest/public/store/remote/log_entries/epic.ts diff --git a/x-pack/plugins/infra/public/store/remote/log_entries/index.ts b/x-pack/plugins/ingest/public/store/remote/log_entries/index.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/log_entries/index.ts rename to x-pack/plugins/ingest/public/store/remote/log_entries/index.ts diff --git a/x-pack/plugins/infra/public/store/remote/log_entries/operations/load.ts b/x-pack/plugins/ingest/public/store/remote/log_entries/operations/load.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/log_entries/operations/load.ts rename to x-pack/plugins/ingest/public/store/remote/log_entries/operations/load.ts diff --git a/x-pack/plugins/infra/public/store/remote/log_entries/operations/load_more.ts b/x-pack/plugins/ingest/public/store/remote/log_entries/operations/load_more.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/log_entries/operations/load_more.ts rename to x-pack/plugins/ingest/public/store/remote/log_entries/operations/load_more.ts diff --git a/x-pack/plugins/infra/public/store/remote/log_entries/operations/log_entries.gql_query.ts b/x-pack/plugins/ingest/public/store/remote/log_entries/operations/log_entries.gql_query.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/log_entries/operations/log_entries.gql_query.ts rename to x-pack/plugins/ingest/public/store/remote/log_entries/operations/log_entries.gql_query.ts diff --git a/x-pack/plugins/infra/public/store/remote/log_entries/reducer.ts b/x-pack/plugins/ingest/public/store/remote/log_entries/reducer.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/log_entries/reducer.ts rename to x-pack/plugins/ingest/public/store/remote/log_entries/reducer.ts diff --git a/x-pack/plugins/infra/public/store/remote/log_entries/selectors.ts b/x-pack/plugins/ingest/public/store/remote/log_entries/selectors.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/log_entries/selectors.ts rename to x-pack/plugins/ingest/public/store/remote/log_entries/selectors.ts diff --git a/x-pack/plugins/infra/public/store/remote/log_entries/state.ts b/x-pack/plugins/ingest/public/store/remote/log_entries/state.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/log_entries/state.ts rename to x-pack/plugins/ingest/public/store/remote/log_entries/state.ts diff --git a/x-pack/plugins/infra/public/store/remote/log_summary/actions.ts b/x-pack/plugins/ingest/public/store/remote/log_summary/actions.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/log_summary/actions.ts rename to x-pack/plugins/ingest/public/store/remote/log_summary/actions.ts diff --git a/x-pack/plugins/infra/public/store/remote/log_summary/epic.ts b/x-pack/plugins/ingest/public/store/remote/log_summary/epic.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/log_summary/epic.ts rename to x-pack/plugins/ingest/public/store/remote/log_summary/epic.ts diff --git a/x-pack/plugins/infra/public/store/remote/log_summary/index.ts b/x-pack/plugins/ingest/public/store/remote/log_summary/index.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/log_summary/index.ts rename to x-pack/plugins/ingest/public/store/remote/log_summary/index.ts diff --git a/x-pack/plugins/infra/public/store/remote/log_summary/operations/load.ts b/x-pack/plugins/ingest/public/store/remote/log_summary/operations/load.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/log_summary/operations/load.ts rename to x-pack/plugins/ingest/public/store/remote/log_summary/operations/load.ts diff --git a/x-pack/plugins/infra/public/store/remote/log_summary/operations/log_summary.gql_query.ts b/x-pack/plugins/ingest/public/store/remote/log_summary/operations/log_summary.gql_query.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/log_summary/operations/log_summary.gql_query.ts rename to x-pack/plugins/ingest/public/store/remote/log_summary/operations/log_summary.gql_query.ts diff --git a/x-pack/plugins/infra/public/store/remote/log_summary/reducer.ts b/x-pack/plugins/ingest/public/store/remote/log_summary/reducer.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/log_summary/reducer.ts rename to x-pack/plugins/ingest/public/store/remote/log_summary/reducer.ts diff --git a/x-pack/plugins/infra/public/store/remote/log_summary/selectors.ts b/x-pack/plugins/ingest/public/store/remote/log_summary/selectors.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/log_summary/selectors.ts rename to x-pack/plugins/ingest/public/store/remote/log_summary/selectors.ts diff --git a/x-pack/plugins/infra/public/store/remote/log_summary/state.ts b/x-pack/plugins/ingest/public/store/remote/log_summary/state.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/log_summary/state.ts rename to x-pack/plugins/ingest/public/store/remote/log_summary/state.ts diff --git a/x-pack/plugins/infra/public/store/remote/reducer.ts b/x-pack/plugins/ingest/public/store/remote/reducer.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/reducer.ts rename to x-pack/plugins/ingest/public/store/remote/reducer.ts diff --git a/x-pack/plugins/infra/public/store/remote/selectors.ts b/x-pack/plugins/ingest/public/store/remote/selectors.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/selectors.ts rename to x-pack/plugins/ingest/public/store/remote/selectors.ts diff --git a/x-pack/plugins/infra/public/store/remote/source/actions.ts b/x-pack/plugins/ingest/public/store/remote/source/actions.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/source/actions.ts rename to x-pack/plugins/ingest/public/store/remote/source/actions.ts diff --git a/x-pack/plugins/infra/public/store/remote/source/epic.ts b/x-pack/plugins/ingest/public/store/remote/source/epic.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/source/epic.ts rename to x-pack/plugins/ingest/public/store/remote/source/epic.ts diff --git a/x-pack/plugins/infra/public/store/remote/source/index.ts b/x-pack/plugins/ingest/public/store/remote/source/index.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/source/index.ts rename to x-pack/plugins/ingest/public/store/remote/source/index.ts diff --git a/x-pack/plugins/infra/public/store/remote/source/operations/load.ts b/x-pack/plugins/ingest/public/store/remote/source/operations/load.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/source/operations/load.ts rename to x-pack/plugins/ingest/public/store/remote/source/operations/load.ts diff --git a/x-pack/plugins/infra/public/store/remote/source/operations/query_source.gql_query.ts b/x-pack/plugins/ingest/public/store/remote/source/operations/query_source.gql_query.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/source/operations/query_source.gql_query.ts rename to x-pack/plugins/ingest/public/store/remote/source/operations/query_source.gql_query.ts diff --git a/x-pack/plugins/infra/public/store/remote/source/reducer.ts b/x-pack/plugins/ingest/public/store/remote/source/reducer.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/source/reducer.ts rename to x-pack/plugins/ingest/public/store/remote/source/reducer.ts diff --git a/x-pack/plugins/infra/public/store/remote/source/selectors.ts b/x-pack/plugins/ingest/public/store/remote/source/selectors.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/source/selectors.ts rename to x-pack/plugins/ingest/public/store/remote/source/selectors.ts diff --git a/x-pack/plugins/infra/public/store/remote/source/state.ts b/x-pack/plugins/ingest/public/store/remote/source/state.ts similarity index 100% rename from x-pack/plugins/infra/public/store/remote/source/state.ts rename to x-pack/plugins/ingest/public/store/remote/source/state.ts diff --git a/x-pack/plugins/infra/public/store/selectors.ts b/x-pack/plugins/ingest/public/store/selectors.ts similarity index 100% rename from x-pack/plugins/infra/public/store/selectors.ts rename to x-pack/plugins/ingest/public/store/selectors.ts diff --git a/x-pack/plugins/infra/public/store/store.ts b/x-pack/plugins/ingest/public/store/store.ts similarity index 100% rename from x-pack/plugins/infra/public/store/store.ts rename to x-pack/plugins/ingest/public/store/store.ts diff --git a/x-pack/plugins/infra/public/utils/formatters/data.ts b/x-pack/plugins/ingest/public/utils/formatters/data.ts similarity index 100% rename from x-pack/plugins/infra/public/utils/formatters/data.ts rename to x-pack/plugins/ingest/public/utils/formatters/data.ts diff --git a/x-pack/plugins/infra/public/utils/formatters/index.ts b/x-pack/plugins/ingest/public/utils/formatters/index.ts similarity index 100% rename from x-pack/plugins/infra/public/utils/formatters/index.ts rename to x-pack/plugins/ingest/public/utils/formatters/index.ts diff --git a/x-pack/plugins/infra/public/utils/formatters/number.ts b/x-pack/plugins/ingest/public/utils/formatters/number.ts similarity index 100% rename from x-pack/plugins/infra/public/utils/formatters/number.ts rename to x-pack/plugins/ingest/public/utils/formatters/number.ts diff --git a/x-pack/plugins/infra/public/utils/formatters/percent.ts b/x-pack/plugins/ingest/public/utils/formatters/percent.ts similarity index 100% rename from x-pack/plugins/infra/public/utils/formatters/percent.ts rename to x-pack/plugins/ingest/public/utils/formatters/percent.ts diff --git a/x-pack/plugins/infra/public/utils/handlers.ts b/x-pack/plugins/ingest/public/utils/handlers.ts similarity index 100% rename from x-pack/plugins/infra/public/utils/handlers.ts rename to x-pack/plugins/ingest/public/utils/handlers.ts diff --git a/x-pack/plugins/infra/public/utils/loading_state/index.ts b/x-pack/plugins/ingest/public/utils/loading_state/index.ts similarity index 100% rename from x-pack/plugins/infra/public/utils/loading_state/index.ts rename to x-pack/plugins/ingest/public/utils/loading_state/index.ts diff --git a/x-pack/plugins/infra/public/utils/loading_state/loading_policy.ts b/x-pack/plugins/ingest/public/utils/loading_state/loading_policy.ts similarity index 100% rename from x-pack/plugins/infra/public/utils/loading_state/loading_policy.ts rename to x-pack/plugins/ingest/public/utils/loading_state/loading_policy.ts diff --git a/x-pack/plugins/infra/public/utils/loading_state/loading_progress.ts b/x-pack/plugins/ingest/public/utils/loading_state/loading_progress.ts similarity index 100% rename from x-pack/plugins/infra/public/utils/loading_state/loading_progress.ts rename to x-pack/plugins/ingest/public/utils/loading_state/loading_progress.ts diff --git a/x-pack/plugins/infra/public/utils/loading_state/loading_result.ts b/x-pack/plugins/ingest/public/utils/loading_state/loading_result.ts similarity index 100% rename from x-pack/plugins/infra/public/utils/loading_state/loading_result.ts rename to x-pack/plugins/ingest/public/utils/loading_state/loading_result.ts diff --git a/x-pack/plugins/infra/public/utils/loading_state/loading_state.ts b/x-pack/plugins/ingest/public/utils/loading_state/loading_state.ts similarity index 100% rename from x-pack/plugins/infra/public/utils/loading_state/loading_state.ts rename to x-pack/plugins/ingest/public/utils/loading_state/loading_state.ts diff --git a/x-pack/plugins/infra/public/utils/log_entry/index.ts b/x-pack/plugins/ingest/public/utils/log_entry/index.ts similarity index 100% rename from x-pack/plugins/infra/public/utils/log_entry/index.ts rename to x-pack/plugins/ingest/public/utils/log_entry/index.ts diff --git a/x-pack/plugins/infra/public/utils/log_entry/log_entry.ts b/x-pack/plugins/ingest/public/utils/log_entry/log_entry.ts similarity index 100% rename from x-pack/plugins/infra/public/utils/log_entry/log_entry.ts rename to x-pack/plugins/ingest/public/utils/log_entry/log_entry.ts diff --git a/x-pack/plugins/infra/public/utils/memoize_last.ts b/x-pack/plugins/ingest/public/utils/memoize_last.ts similarity index 100% rename from x-pack/plugins/infra/public/utils/memoize_last.ts rename to x-pack/plugins/ingest/public/utils/memoize_last.ts diff --git a/x-pack/plugins/infra/public/utils/remote_state/remote_graphql_state.ts b/x-pack/plugins/ingest/public/utils/remote_state/remote_graphql_state.ts similarity index 98% rename from x-pack/plugins/infra/public/utils/remote_state/remote_graphql_state.ts rename to x-pack/plugins/ingest/public/utils/remote_state/remote_graphql_state.ts index 6a03def5d068d..de60e3691c9a5 100644 --- a/x-pack/plugins/infra/public/utils/remote_state/remote_graphql_state.ts +++ b/x-pack/plugins/ingest/public/utils/remote_state/remote_graphql_state.ts @@ -61,7 +61,7 @@ export const createGraphqlOperationActionCreators = => { - const actionCreator = actionCreatorFactory(`x-pack/infra/remote/${stateKey}/${operationKey}`); + const actionCreator = actionCreatorFactory(`x-pack/ingest/remote/${stateKey}/${operationKey}`); const resolve = actionCreator('RESOLVE'); const resolveEffect = actionCreator.async>('RESOLVE'); diff --git a/x-pack/plugins/infra/public/utils/styles.ts b/x-pack/plugins/ingest/public/utils/styles.ts similarity index 100% rename from x-pack/plugins/infra/public/utils/styles.ts rename to x-pack/plugins/ingest/public/utils/styles.ts diff --git a/x-pack/plugins/infra/public/utils/typed_react.tsx b/x-pack/plugins/ingest/public/utils/typed_react.tsx similarity index 100% rename from x-pack/plugins/infra/public/utils/typed_react.tsx rename to x-pack/plugins/ingest/public/utils/typed_react.tsx diff --git a/x-pack/plugins/infra/public/utils/typed_redux.ts b/x-pack/plugins/ingest/public/utils/typed_redux.ts similarity index 100% rename from x-pack/plugins/infra/public/utils/typed_redux.ts rename to x-pack/plugins/ingest/public/utils/typed_redux.ts diff --git a/x-pack/plugins/infra/public/utils/url_state.tsx b/x-pack/plugins/ingest/public/utils/url_state.tsx similarity index 100% rename from x-pack/plugins/infra/public/utils/url_state.tsx rename to x-pack/plugins/ingest/public/utils/url_state.tsx diff --git a/x-pack/plugins/infra/scripts/combined_schema.ts b/x-pack/plugins/ingest/scripts/combined_schema.ts similarity index 100% rename from x-pack/plugins/infra/scripts/combined_schema.ts rename to x-pack/plugins/ingest/scripts/combined_schema.ts diff --git a/x-pack/plugins/infra/scripts/generate_types_from_graphql.js b/x-pack/plugins/ingest/scripts/generate_types_from_graphql.js similarity index 100% rename from x-pack/plugins/infra/scripts/generate_types_from_graphql.js rename to x-pack/plugins/ingest/scripts/generate_types_from_graphql.js diff --git a/x-pack/plugins/infra/scripts/gql_gen.json b/x-pack/plugins/ingest/scripts/gql_gen.json similarity index 100% rename from x-pack/plugins/infra/scripts/gql_gen.json rename to x-pack/plugins/ingest/scripts/gql_gen.json diff --git a/x-pack/plugins/infra/server/graphql/capabilities/index.ts b/x-pack/plugins/ingest/server/graphql/capabilities/index.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/capabilities/index.ts rename to x-pack/plugins/ingest/server/graphql/capabilities/index.ts diff --git a/x-pack/plugins/infra/server/graphql/capabilities/resolvers.ts b/x-pack/plugins/ingest/server/graphql/capabilities/resolvers.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/capabilities/resolvers.ts rename to x-pack/plugins/ingest/server/graphql/capabilities/resolvers.ts diff --git a/x-pack/plugins/infra/server/graphql/capabilities/schema.gql.ts b/x-pack/plugins/ingest/server/graphql/capabilities/schema.gql.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/capabilities/schema.gql.ts rename to x-pack/plugins/ingest/server/graphql/capabilities/schema.gql.ts diff --git a/x-pack/plugins/infra/server/graphql/index.ts b/x-pack/plugins/ingest/server/graphql/index.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/index.ts rename to x-pack/plugins/ingest/server/graphql/index.ts diff --git a/x-pack/plugins/infra/server/graphql/log_entries/index.ts b/x-pack/plugins/ingest/server/graphql/log_entries/index.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/log_entries/index.ts rename to x-pack/plugins/ingest/server/graphql/log_entries/index.ts diff --git a/x-pack/plugins/infra/server/graphql/log_entries/resolvers.ts b/x-pack/plugins/ingest/server/graphql/log_entries/resolvers.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/log_entries/resolvers.ts rename to x-pack/plugins/ingest/server/graphql/log_entries/resolvers.ts diff --git a/x-pack/plugins/infra/server/graphql/log_entries/schema.gql.ts b/x-pack/plugins/ingest/server/graphql/log_entries/schema.gql.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/log_entries/schema.gql.ts rename to x-pack/plugins/ingest/server/graphql/log_entries/schema.gql.ts diff --git a/x-pack/plugins/infra/server/graphql/metrics/index.ts b/x-pack/plugins/ingest/server/graphql/metrics/index.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/metrics/index.ts rename to x-pack/plugins/ingest/server/graphql/metrics/index.ts diff --git a/x-pack/plugins/infra/server/graphql/metrics/resolvers.ts b/x-pack/plugins/ingest/server/graphql/metrics/resolvers.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/metrics/resolvers.ts rename to x-pack/plugins/ingest/server/graphql/metrics/resolvers.ts diff --git a/x-pack/plugins/infra/server/graphql/metrics/schema.gql.ts b/x-pack/plugins/ingest/server/graphql/metrics/schema.gql.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/metrics/schema.gql.ts rename to x-pack/plugins/ingest/server/graphql/metrics/schema.gql.ts diff --git a/x-pack/plugins/infra/server/graphql/nodes/index.ts b/x-pack/plugins/ingest/server/graphql/nodes/index.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/nodes/index.ts rename to x-pack/plugins/ingest/server/graphql/nodes/index.ts diff --git a/x-pack/plugins/infra/server/graphql/nodes/resolvers.ts b/x-pack/plugins/ingest/server/graphql/nodes/resolvers.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/nodes/resolvers.ts rename to x-pack/plugins/ingest/server/graphql/nodes/resolvers.ts diff --git a/x-pack/plugins/infra/server/graphql/nodes/schema.gql.ts b/x-pack/plugins/ingest/server/graphql/nodes/schema.gql.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/nodes/schema.gql.ts rename to x-pack/plugins/ingest/server/graphql/nodes/schema.gql.ts diff --git a/x-pack/plugins/infra/server/graphql/source_status/index.ts b/x-pack/plugins/ingest/server/graphql/source_status/index.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/source_status/index.ts rename to x-pack/plugins/ingest/server/graphql/source_status/index.ts diff --git a/x-pack/plugins/infra/server/graphql/source_status/resolvers.ts b/x-pack/plugins/ingest/server/graphql/source_status/resolvers.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/source_status/resolvers.ts rename to x-pack/plugins/ingest/server/graphql/source_status/resolvers.ts diff --git a/x-pack/plugins/infra/server/graphql/source_status/schema.gql.ts b/x-pack/plugins/ingest/server/graphql/source_status/schema.gql.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/source_status/schema.gql.ts rename to x-pack/plugins/ingest/server/graphql/source_status/schema.gql.ts diff --git a/x-pack/plugins/infra/server/graphql/sources/index.ts b/x-pack/plugins/ingest/server/graphql/sources/index.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/sources/index.ts rename to x-pack/plugins/ingest/server/graphql/sources/index.ts diff --git a/x-pack/plugins/infra/server/graphql/sources/resolvers.ts b/x-pack/plugins/ingest/server/graphql/sources/resolvers.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/sources/resolvers.ts rename to x-pack/plugins/ingest/server/graphql/sources/resolvers.ts diff --git a/x-pack/plugins/infra/server/graphql/sources/schema.gql.ts b/x-pack/plugins/ingest/server/graphql/sources/schema.gql.ts similarity index 100% rename from x-pack/plugins/infra/server/graphql/sources/schema.gql.ts rename to x-pack/plugins/ingest/server/graphql/sources/schema.gql.ts diff --git a/x-pack/plugins/infra/server/infra_server.ts b/x-pack/plugins/ingest/server/init_server.ts similarity index 94% rename from x-pack/plugins/infra/server/infra_server.ts rename to x-pack/plugins/ingest/server/init_server.ts index eb68e44af6423..40cb78ae6dafe 100644 --- a/x-pack/plugins/infra/server/infra_server.ts +++ b/x-pack/plugins/ingest/server/init_server.ts @@ -28,7 +28,7 @@ export const initInfraServer = (libs: InfraBackendLibs) => { typeDefs: schemas, }); - libs.framework.registerGraphQLEndpoint('/api/infra/graphql', schema); + libs.framework.registerGraphQLEndpoint('/api/ingest/graphql', schema); initLegacyLoggingRoutes(libs.framework); }; diff --git a/x-pack/plugins/infra/server/kibana.index.ts b/x-pack/plugins/ingest/server/kibana.index.ts similarity index 97% rename from x-pack/plugins/infra/server/kibana.index.ts rename to x-pack/plugins/ingest/server/kibana.index.ts index c916203648024..101b5ffabd53e 100644 --- a/x-pack/plugins/infra/server/kibana.index.ts +++ b/x-pack/plugins/ingest/server/kibana.index.ts @@ -6,7 +6,7 @@ import { Server } from 'hapi'; import JoiNamespace from 'joi'; -import { initInfraServer } from './infra_server'; +import { initInfraServer } from './init_server'; import { compose } from './lib/compose/kibana'; import { UsageCollector } from './usage/usage_collector'; diff --git a/x-pack/plugins/infra/server/lib/adapters/capabilities/adapter_types.ts b/x-pack/plugins/ingest/server/lib/adapters/capabilities/adapter_types.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/capabilities/adapter_types.ts rename to x-pack/plugins/ingest/server/lib/adapters/capabilities/adapter_types.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/capabilities/elasticsearch_capabilities_adapter.ts b/x-pack/plugins/ingest/server/lib/adapters/capabilities/elasticsearch_capabilities_adapter.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/capabilities/elasticsearch_capabilities_adapter.ts rename to x-pack/plugins/ingest/server/lib/adapters/capabilities/elasticsearch_capabilities_adapter.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/capabilities/index.ts b/x-pack/plugins/ingest/server/lib/adapters/capabilities/index.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/capabilities/index.ts rename to x-pack/plugins/ingest/server/lib/adapters/capabilities/index.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/configuration/adapter_types.ts b/x-pack/plugins/ingest/server/lib/adapters/configuration/adapter_types.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/configuration/adapter_types.ts rename to x-pack/plugins/ingest/server/lib/adapters/configuration/adapter_types.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/configuration/index.ts b/x-pack/plugins/ingest/server/lib/adapters/configuration/index.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/configuration/index.ts rename to x-pack/plugins/ingest/server/lib/adapters/configuration/index.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/configuration/inmemory_configuration_adapter.ts b/x-pack/plugins/ingest/server/lib/adapters/configuration/inmemory_configuration_adapter.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/configuration/inmemory_configuration_adapter.ts rename to x-pack/plugins/ingest/server/lib/adapters/configuration/inmemory_configuration_adapter.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/configuration/kibana_configuration_adapter.test.ts b/x-pack/plugins/ingest/server/lib/adapters/configuration/kibana_configuration_adapter.test.ts similarity index 88% rename from x-pack/plugins/infra/server/lib/adapters/configuration/kibana_configuration_adapter.test.ts rename to x-pack/plugins/ingest/server/lib/adapters/configuration/kibana_configuration_adapter.test.ts index 4d87878e9aa87..fe6bf93bf0c3b 100644 --- a/x-pack/plugins/infra/server/lib/adapters/configuration/kibana_configuration_adapter.test.ts +++ b/x-pack/plugins/ingest/server/lib/adapters/configuration/kibana_configuration_adapter.test.ts @@ -7,7 +7,7 @@ import { InfraKibanaConfigurationAdapter } from './kibana_configuration_adapter'; describe('the InfraKibanaConfigurationAdapter', () => { - test('queries the xpack.infra configuration of the server', async () => { + test('queries the xpack.ingest configuration of the server', async () => { const mockConfig = { get: jest.fn(), }; @@ -18,7 +18,7 @@ describe('the InfraKibanaConfigurationAdapter', () => { await configurationAdapter.get(); - expect(mockConfig.get).toBeCalledWith('xpack.infra'); + expect(mockConfig.get).toBeCalledWith('xpack.ingest'); }); test('applies the query defaults', async () => { diff --git a/x-pack/plugins/infra/server/lib/adapters/configuration/kibana_configuration_adapter.ts b/x-pack/plugins/ingest/server/lib/adapters/configuration/kibana_configuration_adapter.ts similarity index 96% rename from x-pack/plugins/infra/server/lib/adapters/configuration/kibana_configuration_adapter.ts rename to x-pack/plugins/ingest/server/lib/adapters/configuration/kibana_configuration_adapter.ts index 62b01b3eac2a3..b2b89079dc5ea 100644 --- a/x-pack/plugins/infra/server/lib/adapters/configuration/kibana_configuration_adapter.ts +++ b/x-pack/plugins/ingest/server/lib/adapters/configuration/kibana_configuration_adapter.ts @@ -27,7 +27,7 @@ export class InfraKibanaConfigurationAdapter throw new Error('Failed to access configuration of server.'); } - const configuration = config.get('xpack.infra') || {}; + const configuration = config.get('xpack.ingest') || {}; const configurationWithDefaults = { enabled: true, query: { diff --git a/x-pack/plugins/infra/server/lib/adapters/fields/adapter_types.ts b/x-pack/plugins/ingest/server/lib/adapters/fields/adapter_types.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/fields/adapter_types.ts rename to x-pack/plugins/ingest/server/lib/adapters/fields/adapter_types.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/fields/framework_fields_adapter.ts b/x-pack/plugins/ingest/server/lib/adapters/fields/framework_fields_adapter.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/fields/framework_fields_adapter.ts rename to x-pack/plugins/ingest/server/lib/adapters/fields/framework_fields_adapter.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/fields/index.ts b/x-pack/plugins/ingest/server/lib/adapters/fields/index.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/fields/index.ts rename to x-pack/plugins/ingest/server/lib/adapters/fields/index.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/ingest/server/lib/adapters/framework/adapter_types.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts rename to x-pack/plugins/ingest/server/lib/adapters/framework/adapter_types.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/framework/apollo_server_hapi.ts b/x-pack/plugins/ingest/server/lib/adapters/framework/apollo_server_hapi.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/framework/apollo_server_hapi.ts rename to x-pack/plugins/ingest/server/lib/adapters/framework/apollo_server_hapi.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/framework/index.ts b/x-pack/plugins/ingest/server/lib/adapters/framework/index.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/framework/index.ts rename to x-pack/plugins/ingest/server/lib/adapters/framework/index.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts b/x-pack/plugins/ingest/server/lib/adapters/framework/kibana_framework_adapter.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts rename to x-pack/plugins/ingest/server/lib/adapters/framework/kibana_framework_adapter.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/log_entries/adapter_types.ts b/x-pack/plugins/ingest/server/lib/adapters/log_entries/adapter_types.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/log_entries/adapter_types.ts rename to x-pack/plugins/ingest/server/lib/adapters/log_entries/adapter_types.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/log_entries/index.ts b/x-pack/plugins/ingest/server/lib/adapters/log_entries/index.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/log_entries/index.ts rename to x-pack/plugins/ingest/server/lib/adapters/log_entries/index.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/log_entries/kibana_log_entries_adapter.ts b/x-pack/plugins/ingest/server/lib/adapters/log_entries/kibana_log_entries_adapter.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/log_entries/kibana_log_entries_adapter.ts rename to x-pack/plugins/ingest/server/lib/adapters/log_entries/kibana_log_entries_adapter.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/adapter_types.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/adapter_types.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/adapter_types.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/adapter_types.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/index.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/index.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/index.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/index.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/kibana_metrics_adapter.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/kibana_metrics_adapter.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/kibana_metrics_adapter.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/kibana_metrics_adapter.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/lib/check_valid_node.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/lib/check_valid_node.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/lib/check_valid_node.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/lib/check_valid_node.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/container/container_cpu_kernel.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/container/container_cpu_kernel.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/container/container_cpu_kernel.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/container/container_cpu_kernel.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/container/container_cpu_usage.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/container/container_cpu_usage.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/container/container_cpu_usage.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/container/container_cpu_usage.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/container/container_disk_io_bytes.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/container/container_disk_io_bytes.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/container/container_disk_io_bytes.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/container/container_disk_io_bytes.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/container/container_diskio_ops.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/container/container_diskio_ops.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/container/container_diskio_ops.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/container/container_diskio_ops.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/container/container_memory.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/container/container_memory.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/container/container_memory.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/container/container_memory.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/container/container_network_traffic.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/container/container_network_traffic.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/container/container_network_traffic.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/container/container_network_traffic.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/container/container_overview.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/container/container_overview.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/container/container_overview.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/container/container_overview.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_cpu_usage.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_cpu_usage.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_cpu_usage.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_cpu_usage.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_filesystem.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_filesystem.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_filesystem.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_filesystem.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_k8s_cpu_cap.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_k8s_cpu_cap.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_k8s_cpu_cap.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_k8s_cpu_cap.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_k8s_disk_cap.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_k8s_disk_cap.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_k8s_disk_cap.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_k8s_disk_cap.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_k8s_memory_cap.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_k8s_memory_cap.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_k8s_memory_cap.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_k8s_memory_cap.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_k8s_overview.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_k8s_overview.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_k8s_overview.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_k8s_overview.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_k8s_pod_cap.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_k8s_pod_cap.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_k8s_pod_cap.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_k8s_pod_cap.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_load.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_load.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_load.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_load.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_memory_usage.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_memory_usage.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_memory_usage.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_memory_usage.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_network_traffic.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_network_traffic.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_network_traffic.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_network_traffic.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_system_overview.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_system_overview.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/host/host_system_overview.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/host/host_system_overview.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/index.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/index.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/index.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/index.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/nginx/nginx_active_connections.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/nginx/nginx_active_connections.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/nginx/nginx_active_connections.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/nginx/nginx_active_connections.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/nginx/nginx_hits.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/nginx/nginx_hits.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/nginx/nginx_hits.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/nginx/nginx_hits.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/nginx/nginx_request_rate.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/nginx/nginx_request_rate.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/nginx/nginx_request_rate.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/nginx/nginx_request_rate.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/nginx/nginx_requests_per_connection.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/nginx/nginx_requests_per_connection.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/nginx/nginx_requests_per_connection.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/nginx/nginx_requests_per_connection.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/pod/pod_cpu_usage.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/pod/pod_cpu_usage.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/pod/pod_cpu_usage.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/pod/pod_cpu_usage.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/pod/pod_log_usage.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/pod/pod_log_usage.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/pod/pod_log_usage.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/pod/pod_log_usage.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/pod/pod_memory_usage.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/pod/pod_memory_usage.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/pod/pod_memory_usage.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/pod/pod_memory_usage.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/pod/pod_network_traffic.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/pod/pod_network_traffic.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/pod/pod_network_traffic.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/pod/pod_network_traffic.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/models/pod/pod_overview.ts b/x-pack/plugins/ingest/server/lib/adapters/metrics/models/pod/pod_overview.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/metrics/models/pod/pod_overview.ts rename to x-pack/plugins/ingest/server/lib/adapters/metrics/models/pod/pod_overview.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/adapter_types.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/adapter_types.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/adapter_types.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/adapter_types.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/constants.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/constants.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/constants.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/constants.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/elasticsearch_nodes_adapter.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/elasticsearch_nodes_adapter.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/elasticsearch_nodes_adapter.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/elasticsearch_nodes_adapter.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/extract_group_by_and_node_from_path.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/extract_group_by_and_node_from_path.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/extract_group_by_and_node_from_path.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/extract_group_by_and_node_from_path.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/index.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/index.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/index.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/index.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/lib/calculate_cardinality.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/lib/calculate_cardinality.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/lib/calculate_cardinality.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/lib/calculate_cardinality.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/lib/convert_nodes_response_to_groups.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/lib/convert_nodes_response_to_groups.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/lib/convert_nodes_response_to_groups.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/lib/convert_nodes_response_to_groups.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/lib/create_base_path.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/lib/create_base_path.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/lib/create_base_path.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/lib/create_base_path.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/lib/create_node_item.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/lib/create_node_item.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/lib/create_node_item.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/lib/create_node_item.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/lib/create_node_request_body.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/lib/create_node_request_body.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/lib/create_node_request_body.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/lib/create_node_request_body.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/lib/create_partition_bodies.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/lib/create_partition_bodies.ts similarity index 95% rename from x-pack/plugins/infra/server/lib/adapters/nodes/lib/create_partition_bodies.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/lib/create_partition_bodies.ts index 83b0ccec28c96..7c5480a4d6adb 100644 --- a/x-pack/plugins/infra/server/lib/adapters/nodes/lib/create_partition_bodies.ts +++ b/x-pack/plugins/ingest/server/lib/adapters/nodes/lib/create_partition_bodies.ts @@ -28,7 +28,7 @@ export function createPartitionBodies( const indices = nodeOptions.metric.type === InfraMetricType.logRate ? [sourceConfiguration.logAlias] - : [sourceConfiguration.logAlias, sourceConfiguration.metricAlias]; + : [sourceConfiguration.metricAlias]; times( numberOfPartitions, (partitionId: number): void => { diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/lib/create_query.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/lib/create_query.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/lib/create_query.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/lib/create_query.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/lib/extract_group_paths.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/lib/extract_group_paths.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/lib/extract_group_paths.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/lib/extract_group_paths.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/lib/get_bucket_size_in_seconds.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/lib/get_bucket_size_in_seconds.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/lib/get_bucket_size_in_seconds.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/lib/get_bucket_size_in_seconds.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/lib/process_nodes.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/lib/process_nodes.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/lib/process_nodes.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/lib/process_nodes.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/lib/type_guards.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/lib/type_guards.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/lib/type_guards.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/lib/type_guards.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/count.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/count.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/count.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/count.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/cpu.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/cpu.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/cpu.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/cpu.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/index.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/index.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/index.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/index.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/load.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/load.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/load.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/load.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/log_rate.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/log_rate.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/log_rate.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/log_rate.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/memory.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/memory.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/memory.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/memory.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/rate.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/rate.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/rate.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/rate.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/rx.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/rx.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/rx.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/rx.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/tx.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/tx.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/metric_aggregation_creators/tx.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/metric_aggregation_creators/tx.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/processors/common/field_filter_processor.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/processors/common/field_filter_processor.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/processors/common/field_filter_processor.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/processors/common/field_filter_processor.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/processors/common/group_by_processor.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/processors/common/group_by_processor.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/processors/common/group_by_processor.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/processors/common/group_by_processor.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/processors/common/nodes_processor.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/processors/common/nodes_processor.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/processors/common/nodes_processor.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/processors/common/nodes_processor.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/processors/common/query_procssor.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/processors/common/query_procssor.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/processors/common/query_procssor.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/processors/common/query_procssor.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/processors/last/date_histogram_processor.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/processors/last/date_histogram_processor.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/processors/last/date_histogram_processor.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/processors/last/date_histogram_processor.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/processors/last/index.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/processors/last/index.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/processors/last/index.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/processors/last/index.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/nodes/processors/last/metric_buckets_processor.ts b/x-pack/plugins/ingest/server/lib/adapters/nodes/processors/last/metric_buckets_processor.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/nodes/processors/last/metric_buckets_processor.ts rename to x-pack/plugins/ingest/server/lib/adapters/nodes/processors/last/metric_buckets_processor.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/source_status/elasticsearch_source_status_adapter.ts b/x-pack/plugins/ingest/server/lib/adapters/source_status/elasticsearch_source_status_adapter.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/source_status/elasticsearch_source_status_adapter.ts rename to x-pack/plugins/ingest/server/lib/adapters/source_status/elasticsearch_source_status_adapter.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/source_status/index.ts b/x-pack/plugins/ingest/server/lib/adapters/source_status/index.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/source_status/index.ts rename to x-pack/plugins/ingest/server/lib/adapters/source_status/index.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/sources/adapter_types.ts b/x-pack/plugins/ingest/server/lib/adapters/sources/adapter_types.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/sources/adapter_types.ts rename to x-pack/plugins/ingest/server/lib/adapters/sources/adapter_types.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/sources/configuration_sources_adapter.test.ts b/x-pack/plugins/ingest/server/lib/adapters/sources/configuration_sources_adapter.test.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/sources/configuration_sources_adapter.test.ts rename to x-pack/plugins/ingest/server/lib/adapters/sources/configuration_sources_adapter.test.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/sources/configuration_sources_adapter.ts b/x-pack/plugins/ingest/server/lib/adapters/sources/configuration_sources_adapter.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/sources/configuration_sources_adapter.ts rename to x-pack/plugins/ingest/server/lib/adapters/sources/configuration_sources_adapter.ts diff --git a/x-pack/plugins/infra/server/lib/adapters/sources/index.ts b/x-pack/plugins/ingest/server/lib/adapters/sources/index.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/adapters/sources/index.ts rename to x-pack/plugins/ingest/server/lib/adapters/sources/index.ts diff --git a/x-pack/plugins/infra/server/lib/compose/kibana.ts b/x-pack/plugins/ingest/server/lib/compose/kibana.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/compose/kibana.ts rename to x-pack/plugins/ingest/server/lib/compose/kibana.ts diff --git a/x-pack/plugins/infra/server/lib/domains/capabilities_domain/capabilities_domain.ts b/x-pack/plugins/ingest/server/lib/domains/capabilities_domain/capabilities_domain.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/domains/capabilities_domain/capabilities_domain.ts rename to x-pack/plugins/ingest/server/lib/domains/capabilities_domain/capabilities_domain.ts diff --git a/x-pack/plugins/infra/server/lib/domains/capabilities_domain/index.ts b/x-pack/plugins/ingest/server/lib/domains/capabilities_domain/index.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/domains/capabilities_domain/index.ts rename to x-pack/plugins/ingest/server/lib/domains/capabilities_domain/index.ts diff --git a/x-pack/plugins/infra/server/lib/domains/fields_domain.ts b/x-pack/plugins/ingest/server/lib/domains/fields_domain.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/domains/fields_domain.ts rename to x-pack/plugins/ingest/server/lib/domains/fields_domain.ts diff --git a/x-pack/plugins/infra/server/lib/domains/log_entries_domain/builtin_rules/filebeat_apache2.ts b/x-pack/plugins/ingest/server/lib/domains/log_entries_domain/builtin_rules/filebeat_apache2.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/domains/log_entries_domain/builtin_rules/filebeat_apache2.ts rename to x-pack/plugins/ingest/server/lib/domains/log_entries_domain/builtin_rules/filebeat_apache2.ts diff --git a/x-pack/plugins/infra/server/lib/domains/log_entries_domain/builtin_rules/filebeat_nginx.ts b/x-pack/plugins/ingest/server/lib/domains/log_entries_domain/builtin_rules/filebeat_nginx.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/domains/log_entries_domain/builtin_rules/filebeat_nginx.ts rename to x-pack/plugins/ingest/server/lib/domains/log_entries_domain/builtin_rules/filebeat_nginx.ts diff --git a/x-pack/plugins/infra/server/lib/domains/log_entries_domain/builtin_rules/filebeat_redis.ts b/x-pack/plugins/ingest/server/lib/domains/log_entries_domain/builtin_rules/filebeat_redis.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/domains/log_entries_domain/builtin_rules/filebeat_redis.ts rename to x-pack/plugins/ingest/server/lib/domains/log_entries_domain/builtin_rules/filebeat_redis.ts diff --git a/x-pack/plugins/infra/server/lib/domains/log_entries_domain/builtin_rules/filebeat_system.ts b/x-pack/plugins/ingest/server/lib/domains/log_entries_domain/builtin_rules/filebeat_system.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/domains/log_entries_domain/builtin_rules/filebeat_system.ts rename to x-pack/plugins/ingest/server/lib/domains/log_entries_domain/builtin_rules/filebeat_system.ts diff --git a/x-pack/plugins/infra/server/lib/domains/log_entries_domain/builtin_rules/generic.ts b/x-pack/plugins/ingest/server/lib/domains/log_entries_domain/builtin_rules/generic.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/domains/log_entries_domain/builtin_rules/generic.ts rename to x-pack/plugins/ingest/server/lib/domains/log_entries_domain/builtin_rules/generic.ts diff --git a/x-pack/plugins/infra/server/lib/domains/log_entries_domain/builtin_rules/index.ts b/x-pack/plugins/ingest/server/lib/domains/log_entries_domain/builtin_rules/index.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/domains/log_entries_domain/builtin_rules/index.ts rename to x-pack/plugins/ingest/server/lib/domains/log_entries_domain/builtin_rules/index.ts diff --git a/x-pack/plugins/infra/server/lib/domains/log_entries_domain/index.ts b/x-pack/plugins/ingest/server/lib/domains/log_entries_domain/index.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/domains/log_entries_domain/index.ts rename to x-pack/plugins/ingest/server/lib/domains/log_entries_domain/index.ts diff --git a/x-pack/plugins/infra/server/lib/domains/log_entries_domain/log_entries_domain.ts b/x-pack/plugins/ingest/server/lib/domains/log_entries_domain/log_entries_domain.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/domains/log_entries_domain/log_entries_domain.ts rename to x-pack/plugins/ingest/server/lib/domains/log_entries_domain/log_entries_domain.ts diff --git a/x-pack/plugins/infra/server/lib/domains/log_entries_domain/message.ts b/x-pack/plugins/ingest/server/lib/domains/log_entries_domain/message.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/domains/log_entries_domain/message.ts rename to x-pack/plugins/ingest/server/lib/domains/log_entries_domain/message.ts diff --git a/x-pack/plugins/infra/server/lib/domains/metrics_domain.ts b/x-pack/plugins/ingest/server/lib/domains/metrics_domain.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/domains/metrics_domain.ts rename to x-pack/plugins/ingest/server/lib/domains/metrics_domain.ts diff --git a/x-pack/plugins/infra/server/lib/domains/nodes_domain.ts b/x-pack/plugins/ingest/server/lib/domains/nodes_domain.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/domains/nodes_domain.ts rename to x-pack/plugins/ingest/server/lib/domains/nodes_domain.ts diff --git a/x-pack/plugins/infra/server/lib/infra_types.ts b/x-pack/plugins/ingest/server/lib/infra_types.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/infra_types.ts rename to x-pack/plugins/ingest/server/lib/infra_types.ts diff --git a/x-pack/plugins/infra/server/lib/source_status.ts b/x-pack/plugins/ingest/server/lib/source_status.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/source_status.ts rename to x-pack/plugins/ingest/server/lib/source_status.ts diff --git a/x-pack/plugins/infra/server/lib/sources.ts b/x-pack/plugins/ingest/server/lib/sources.ts similarity index 100% rename from x-pack/plugins/infra/server/lib/sources.ts rename to x-pack/plugins/ingest/server/lib/sources.ts diff --git a/x-pack/plugins/infra/server/logging_legacy/adjacent_search_results.ts b/x-pack/plugins/ingest/server/logging_legacy/adjacent_search_results.ts similarity index 100% rename from x-pack/plugins/infra/server/logging_legacy/adjacent_search_results.ts rename to x-pack/plugins/ingest/server/logging_legacy/adjacent_search_results.ts diff --git a/x-pack/plugins/infra/server/logging_legacy/contained_search_results.ts b/x-pack/plugins/ingest/server/logging_legacy/contained_search_results.ts similarity index 100% rename from x-pack/plugins/infra/server/logging_legacy/contained_search_results.ts rename to x-pack/plugins/ingest/server/logging_legacy/contained_search_results.ts diff --git a/x-pack/plugins/infra/server/logging_legacy/converters.ts b/x-pack/plugins/ingest/server/logging_legacy/converters.ts similarity index 100% rename from x-pack/plugins/infra/server/logging_legacy/converters.ts rename to x-pack/plugins/ingest/server/logging_legacy/converters.ts diff --git a/x-pack/plugins/infra/server/logging_legacy/elasticsearch.ts b/x-pack/plugins/ingest/server/logging_legacy/elasticsearch.ts similarity index 100% rename from x-pack/plugins/infra/server/logging_legacy/elasticsearch.ts rename to x-pack/plugins/ingest/server/logging_legacy/elasticsearch.ts diff --git a/x-pack/plugins/infra/server/logging_legacy/index.ts b/x-pack/plugins/ingest/server/logging_legacy/index.ts similarity index 100% rename from x-pack/plugins/infra/server/logging_legacy/index.ts rename to x-pack/plugins/ingest/server/logging_legacy/index.ts diff --git a/x-pack/plugins/infra/server/logging_legacy/latest_log_entries.ts b/x-pack/plugins/ingest/server/logging_legacy/latest_log_entries.ts similarity index 100% rename from x-pack/plugins/infra/server/logging_legacy/latest_log_entries.ts rename to x-pack/plugins/ingest/server/logging_legacy/latest_log_entries.ts diff --git a/x-pack/plugins/infra/server/logging_legacy/schemas.ts b/x-pack/plugins/ingest/server/logging_legacy/schemas.ts similarity index 100% rename from x-pack/plugins/infra/server/logging_legacy/schemas.ts rename to x-pack/plugins/ingest/server/logging_legacy/schemas.ts diff --git a/x-pack/plugins/infra/server/logging_legacy/search_summary.ts b/x-pack/plugins/ingest/server/logging_legacy/search_summary.ts similarity index 100% rename from x-pack/plugins/infra/server/logging_legacy/search_summary.ts rename to x-pack/plugins/ingest/server/logging_legacy/search_summary.ts diff --git a/x-pack/plugins/infra/server/usage/usage_collector.ts b/x-pack/plugins/ingest/server/usage/usage_collector.ts similarity index 100% rename from x-pack/plugins/infra/server/usage/usage_collector.ts rename to x-pack/plugins/ingest/server/usage/usage_collector.ts diff --git a/x-pack/plugins/infra/server/utils/README.md b/x-pack/plugins/ingest/server/utils/README.md similarity index 100% rename from x-pack/plugins/infra/server/utils/README.md rename to x-pack/plugins/ingest/server/utils/README.md diff --git a/x-pack/plugins/infra/server/utils/serialized_query.ts b/x-pack/plugins/ingest/server/utils/serialized_query.ts similarity index 100% rename from x-pack/plugins/infra/server/utils/serialized_query.ts rename to x-pack/plugins/ingest/server/utils/serialized_query.ts diff --git a/x-pack/plugins/infra/types/eui.d.ts b/x-pack/plugins/ingest/types/eui.d.ts similarity index 100% rename from x-pack/plugins/infra/types/eui.d.ts rename to x-pack/plugins/ingest/types/eui.d.ts diff --git a/x-pack/plugins/infra/types/eui_experimental.d.ts b/x-pack/plugins/ingest/types/eui_experimental.d.ts similarity index 100% rename from x-pack/plugins/infra/types/eui_experimental.d.ts rename to x-pack/plugins/ingest/types/eui_experimental.d.ts diff --git a/x-pack/plugins/infra/types/graphql_fields.d.ts b/x-pack/plugins/ingest/types/graphql_fields.d.ts similarity index 100% rename from x-pack/plugins/infra/types/graphql_fields.d.ts rename to x-pack/plugins/ingest/types/graphql_fields.d.ts diff --git a/x-pack/plugins/infra/types/redux_observable.d.ts b/x-pack/plugins/ingest/types/redux_observable.d.ts similarity index 100% rename from x-pack/plugins/infra/types/redux_observable.d.ts rename to x-pack/plugins/ingest/types/redux_observable.d.ts diff --git a/x-pack/plugins/infra/types/rison_node.d.ts b/x-pack/plugins/ingest/types/rison_node.d.ts similarity index 100% rename from x-pack/plugins/infra/types/rison_node.d.ts rename to x-pack/plugins/ingest/types/rison_node.d.ts diff --git a/x-pack/plugins/infra/yarn.lock b/x-pack/plugins/ingest/yarn.lock similarity index 100% rename from x-pack/plugins/infra/yarn.lock rename to x-pack/plugins/ingest/yarn.lock diff --git a/x-pack/plugins/ml/public/components/anomalies_table/anomaly_details.js b/x-pack/plugins/ml/public/components/anomalies_table/anomaly_details.js index 7215faec99912..8ef9cc25dc0bf 100644 --- a/x-pack/plugins/ml/public/components/anomalies_table/anomaly_details.js +++ b/x-pack/plugins/ml/public/components/anomalies_table/anomaly_details.js @@ -219,7 +219,7 @@ export class AnomalyDetails extends Component { return ( -

Description
+

Description

{anomalyDescription} {(mvDescription !== undefined) && @@ -236,11 +236,11 @@ export class AnomalyDetails extends Component { const isInterimResult = _.get(this.props.anomaly, 'source.is_interim', false); return ( - + {this.props.isAggregatedData === true ? ( -
Details on highest severity anomaly
+

Details on highest severity anomaly

) : ( -
Anomaly details
+

Anomaly details

)} {isInterimResult === true && @@ -287,8 +287,8 @@ export class AnomalyDetails extends Component { return ( - -
Influencers
+ +

Influencers

{ return validateModelMemoryLimit(callWithRequest, job, duration).then( (messages) => { const ids = messages.map(m => m.id); - expect(ids).to.eql(['estimated_mml_greater_than_mml']); + expect(ids).to.eql(['half_estimated_mml_greater_than_mml']); } ); }); @@ -173,7 +173,7 @@ describe('ML - validateModelMemoryLimit', () => { return validateModelMemoryLimit(callWithRequest, job, duration).then( (messages) => { const ids = messages.map(m => m.id); - expect(ids).to.eql(['estimated_mml_greater_than_mml']); + expect(ids).to.eql(['half_estimated_mml_greater_than_mml']); } ); }); @@ -262,4 +262,60 @@ describe('ML - validateModelMemoryLimit', () => { ); }); + it('Called with specified invalid mml of "1023KB"', () => { + const dtrs = createDetectors(1); + const job = getJobConfig(['instance'], dtrs); + const duration = { start: 0, end: 1 }; + job.analysis_limits.model_memory_limit = '1023KB'; + + return validateModelMemoryLimit(callWithRequest, job, duration).then( + (messages) => { + const ids = messages.map(m => m.id); + expect(ids).to.eql(['mml_value_invalid']); + } + ); + }); + + it('Called with specified valid mml of "1024KB", still triggers a warning', () => { + const dtrs = createDetectors(1); + const job = getJobConfig(['instance'], dtrs); + const duration = { start: 0, end: 1 }; + job.analysis_limits.model_memory_limit = '1024KB'; + + return validateModelMemoryLimit(callWithRequest, job, duration).then( + (messages) => { + const ids = messages.map(m => m.id); + expect(ids).to.eql(['half_estimated_mml_greater_than_mml']); + } + ); + }); + + it('Called with specified valid mml of "6MB", still triggers info', () => { + const dtrs = createDetectors(1); + const job = getJobConfig(['instance'], dtrs); + const duration = { start: 0, end: 1 }; + job.analysis_limits.model_memory_limit = '6MB'; + + return validateModelMemoryLimit(callWithRequest, job, duration).then( + (messages) => { + const ids = messages.map(m => m.id); + expect(ids).to.eql(['half_estimated_mml_greater_than_mml']); + } + ); + }); + + it('Called with specified valid mml of "20MB", triggers success message', () => { + const dtrs = createDetectors(1); + const job = getJobConfig(['instance'], dtrs); + const duration = { start: 0, end: 1 }; + job.analysis_limits.model_memory_limit = '20MB'; + + return validateModelMemoryLimit(callWithRequest, job, duration).then( + (messages) => { + const ids = messages.map(m => m.id); + expect(ids).to.eql(['success_mml']); + } + ); + }); + }); diff --git a/x-pack/plugins/ml/server/models/job_validation/messages.json b/x-pack/plugins/ml/server/models/job_validation/messages.json index fd150bece4455..94d4d60bbde72 100644 --- a/x-pack/plugins/ml/server/models/job_validation/messages.json +++ b/x-pack/plugins/ml/server/models/job_validation/messages.json @@ -179,11 +179,18 @@ }, "mml_value_invalid": { "status": "ERROR", - "text": "{{mml}} is not a valid value for model memory limit. The value should be specified in bytes e.g. 10MB" + "text": "{{mml}} is not a valid value for model memory limit. The value needs to be at least 1MB and should be specified in bytes e.g. 10MB.", + "url": "https://www.elastic.co/guide/en/kibana/{{version}}/job-tips.html#model-memory-limits" + }, + "half_estimated_mml_greater_than_mml": { + "status": "WARNING", + "text": "The specified model memory limit is less than half of the estimated model memory limit and will likely hit the hard limit.", + "url": "https://www.elastic.co/guide/en/kibana/{{version}}/job-tips.html#model-memory-limits" }, "estimated_mml_greater_than_mml": { "status": "INFO", - "text": "The estimated model memory limit is greater than the model memory limit you have configured." + "text": "The estimated model memory limit is greater than the model memory limit you have configured.", + "url": "https://www.elastic.co/guide/en/kibana/{{version}}/job-tips.html#model-memory-limits" }, "success_mml": { "status": "SUCCESS", diff --git a/x-pack/plugins/ml/server/models/job_validation/validate_model_memory_limit.js b/x-pack/plugins/ml/server/models/job_validation/validate_model_memory_limit.js index f2baa78c4d836..ffef535c9d810 100644 --- a/x-pack/plugins/ml/server/models/job_validation/validate_model_memory_limit.js +++ b/x-pack/plugins/ml/server/models/job_validation/validate_model_memory_limit.js @@ -11,6 +11,9 @@ import { validateJobObject } from './validate_job_object'; import { calculateModelMemoryLimitProvider } from '../../models/calculate_model_memory_limit'; import { ALLOWED_DATA_UNITS } from '../../../common/constants/validation'; +// The minimum value the backend expects is 1MByte +const MODEL_MEMORY_LIMIT_MINIMUM_BYTES = 1048576; + export async function validateModelMemoryLimit(callWithRequest, job, duration) { validateJobObject(job); @@ -116,11 +119,17 @@ export async function validateModelMemoryLimit(callWithRequest, job, duration) { // the max mml if (runEstimateGreaterThenMml && mml !== null) { const mmlBytes = numeral(mml).value(); - if (mmlBytes === 0) { + if (mmlBytes < MODEL_MEMORY_LIMIT_MINIMUM_BYTES) { messages.push({ id: 'mml_value_invalid', mml }); + } else if ((mmlEstimateBytes / 2) > mmlBytes) { + messages.push({ + id: 'half_estimated_mml_greater_than_mml', + maxModelMemoryLimit, + mml + }); } else if (mmlEstimateBytes > mmlBytes) { messages.push({ id: 'estimated_mml_greater_than_mml', diff --git a/x-pack/plugins/monitoring/public/views/elasticsearch/index/advanced/index.html b/x-pack/plugins/monitoring/public/views/elasticsearch/index/advanced/index.html index 67e072bffcf40..72c1b450dd640 100644 --- a/x-pack/plugins/monitoring/public/views/elasticsearch/index/advanced/index.html +++ b/x-pack/plugins/monitoring/public/views/elasticsearch/index/advanced/index.html @@ -18,6 +18,7 @@
+
diff --git a/x-pack/plugins/monitoring/public/views/elasticsearch/node/advanced/index.html b/x-pack/plugins/monitoring/public/views/elasticsearch/node/advanced/index.html index 1756446aa043f..4256c5bb5377b 100644 --- a/x-pack/plugins/monitoring/public/views/elasticsearch/node/advanced/index.html +++ b/x-pack/plugins/monitoring/public/views/elasticsearch/node/advanced/index.html @@ -25,6 +25,7 @@
+
diff --git a/x-pack/plugins/monitoring/server/lib/metrics/__test__/__snapshots__/metrics.test.js.snap b/x-pack/plugins/monitoring/server/lib/metrics/__test__/__snapshots__/metrics.test.js.snap index d9fc45f77c774..e9839730c9f60 100644 --- a/x-pack/plugins/monitoring/server/lib/metrics/__test__/__snapshots__/metrics.test.js.snap +++ b/x-pack/plugins/monitoring/server/lib/metrics/__test__/__snapshots__/metrics.test.js.snap @@ -1955,6 +1955,47 @@ Object { "units": "", "uuidField": "source_node.uuid", }, + "index_index_latency": LatencyMetric { + "aggs": Object { + "event_time_in_millis": Object { + "max": Object { + "field": "index_stats.primaries.indexing.index_time_in_millis", + }, + }, + "event_time_in_millis_deriv": Object { + "derivative": Object { + "buckets_path": "event_time_in_millis", + "gap_policy": "skip", + "unit": "1s", + }, + }, + "event_total": Object { + "max": Object { + "field": "index_stats.primaries.indexing.index_total", + }, + }, + "event_total_deriv": Object { + "derivative": Object { + "buckets_path": "event_total", + "gap_policy": "skip", + "unit": "1s", + }, + }, + }, + "app": "elasticsearch", + "calculation": [Function], + "derivative": false, + "description": "Average latency for indexing documents, which is time it takes to index documents divided by number that were indexed. This only considers primary shards.", + "field": "index_stats.primaries.indexing.index_total", + "format": "0,0.[00]", + "label": "Indexing Latency", + "metricAgg": "sum", + "timestampField": "timestamp", + "title": "Latency", + "type": "cluster", + "units": "ms", + "uuidField": "source_node.uuid", + }, "index_indexing_primaries_time": ElasticsearchMetric { "app": "elasticsearch", "derivative": true, @@ -1997,46 +2038,6 @@ Object { "units": "ms", "uuidField": "source_node.uuid", }, - "index_latency": LatencyMetric { - "aggs": Object { - "event_time_in_millis": Object { - "max": Object { - "field": "index_stats.primaries.indexing.index_time_in_millis", - }, - }, - "event_time_in_millis_deriv": Object { - "derivative": Object { - "buckets_path": "event_time_in_millis", - "gap_policy": "skip", - "unit": "1s", - }, - }, - "event_total": Object { - "max": Object { - "field": "index_stats.primaries.indexing.index_total", - }, - }, - "event_total_deriv": Object { - "derivative": Object { - "buckets_path": "event_total", - "gap_policy": "skip", - "unit": "1s", - }, - }, - }, - "app": "elasticsearch", - "calculation": [Function], - "derivative": false, - "description": "Average latency for indexing documents, which is time it takes to index documents divided by number that were indexed. This only considers primary shards.", - "field": "index_stats.primaries.indexing.index_total", - "format": "0,0.[00]", - "label": "Indexing Latency", - "metricAgg": "sum", - "timestampField": "timestamp", - "type": "cluster", - "units": "ms", - "uuidField": "source_node.uuid", - }, "index_mem_doc_values": SingleIndexMemoryMetric { "app": "elasticsearch", "derivative": false, @@ -2274,6 +2275,46 @@ Object { "units": "/s", "uuidField": "source_node.uuid", }, + "index_query_latency": LatencyMetric { + "aggs": Object { + "event_time_in_millis": Object { + "max": Object { + "field": "index_stats.total.search.query_time_in_millis", + }, + }, + "event_time_in_millis_deriv": Object { + "derivative": Object { + "buckets_path": "event_time_in_millis", + "gap_policy": "skip", + "unit": "1s", + }, + }, + "event_total": Object { + "max": Object { + "field": "index_stats.total.search.query_total", + }, + }, + "event_total_deriv": Object { + "derivative": Object { + "buckets_path": "event_total", + "gap_policy": "skip", + "unit": "1s", + }, + }, + }, + "app": "elasticsearch", + "calculation": [Function], + "derivative": false, + "description": "Average latency for searching, which is time it takes to execute searches divided by number of searches submitted. This considers primary and replica shards.", + "field": "index_stats.total.search.query_total", + "format": "0,0.[00]", + "label": "Search Latency", + "metricAgg": "sum", + "timestampField": "timestamp", + "type": "cluster", + "units": "ms", + "uuidField": "source_node.uuid", + }, "index_refresh_time": ElasticsearchMetric { "app": "elasticsearch", "derivative": true, @@ -4505,46 +4546,6 @@ Object { "units": "ms", "uuidField": "source_node.uuid", }, - "query_latency": LatencyMetric { - "aggs": Object { - "event_time_in_millis": Object { - "max": Object { - "field": "index_stats.total.search.query_time_in_millis", - }, - }, - "event_time_in_millis_deriv": Object { - "derivative": Object { - "buckets_path": "event_time_in_millis", - "gap_policy": "skip", - "unit": "1s", - }, - }, - "event_total": Object { - "max": Object { - "field": "index_stats.total.search.query_total", - }, - }, - "event_total_deriv": Object { - "derivative": Object { - "buckets_path": "event_total", - "gap_policy": "skip", - "unit": "1s", - }, - }, - }, - "app": "elasticsearch", - "calculation": [Function], - "derivative": false, - "description": "Average latency for searching, which is time it takes to execute searches divided by number of searches submitted. This considers primary and replica shards.", - "field": "index_stats.total.search.query_total", - "format": "0,0.[00]", - "label": "Search Latency", - "metricAgg": "sum", - "timestampField": "timestamp", - "type": "cluster", - "units": "ms", - "uuidField": "source_node.uuid", - }, "search_request_rate": RequestRateMetric { "app": "elasticsearch", "derivative": true, diff --git a/x-pack/plugins/monitoring/server/lib/metrics/elasticsearch/metrics.js b/x-pack/plugins/monitoring/server/lib/metrics/elasticsearch/metrics.js index 6dc281b650fbe..fb5fa90a1863e 100644 --- a/x-pack/plugins/monitoring/server/lib/metrics/elasticsearch/metrics.js +++ b/x-pack/plugins/monitoring/server/lib/metrics/elasticsearch/metrics.js @@ -70,10 +70,11 @@ export const metrics = { 'Average latency for indexing documents, which is time it takes to index documents divided by number that were indexed. This considers any shard located on this node, including replicas.', // eslint-disable-line max-len type: 'node' }), - index_latency: new LatencyMetric({ + index_index_latency: new LatencyMetric({ metric: 'index', fieldSource: 'index_stats.primaries', field: 'index_stats.primaries.indexing.index_total', + title: 'Latency', label: 'Indexing Latency', description: 'Average latency for indexing documents, which is time it takes to index documents divided by number that were indexed. This only considers primary shards.', // eslint-disable-line max-len @@ -98,7 +99,7 @@ export const metrics = { 'Average latency for searching, which is time it takes to execute searches divided by number of searches submitted. This considers primary and replica shards.', // eslint-disable-line max-len type: 'node' }), - query_latency: new LatencyMetric({ + index_query_latency: new LatencyMetric({ metric: 'query', fieldSource: 'index_stats.total', field: 'index_stats.total.search.query_total', diff --git a/x-pack/plugins/monitoring/server/routes/api/v1/elasticsearch/metric_set_index_detail.js b/x-pack/plugins/monitoring/server/routes/api/v1/elasticsearch/metric_set_index_detail.js index 91879d1176030..c39527173e908 100644 --- a/x-pack/plugins/monitoring/server/routes/api/v1/elasticsearch/metric_set_index_detail.js +++ b/x-pack/plugins/monitoring/server/routes/api/v1/elasticsearch/metric_set_index_detail.js @@ -75,6 +75,10 @@ export const metricSet = { { keys: ['index_segment_count_total', 'index_segment_count_primaries'], name: 'index_segment_count' + }, + { + keys: ['index_index_latency', 'index_query_latency'], + name: 'index_latency' } ], overview: [ diff --git a/x-pack/plugins/monitoring/server/routes/api/v1/elasticsearch/metric_set_node_detail.js b/x-pack/plugins/monitoring/server/routes/api/v1/elasticsearch/metric_set_node_detail.js index bda77a70a4f8c..b6322bb67f047 100644 --- a/x-pack/plugins/monitoring/server/routes/api/v1/elasticsearch/metric_set_node_detail.js +++ b/x-pack/plugins/monitoring/server/routes/api/v1/elasticsearch/metric_set_node_detail.js @@ -88,6 +88,10 @@ export const metricSets = { { keys: ['node_cgroup_periods', 'node_cgroup_throttled_count'], name: 'node_cgroup_stats' + }, + { + keys: ['node_query_latency', 'node_index_latency'], + name: 'node_latency' } ], overview: [ diff --git a/x-pack/test/api_integration/apis/infra/capabilities.ts b/x-pack/test/api_integration/apis/infra/capabilities.ts index 56b3349b8f943..99bf550922b86 100644 --- a/x-pack/test/api_integration/apis/infra/capabilities.ts +++ b/x-pack/test/api_integration/apis/infra/capabilities.ts @@ -5,8 +5,8 @@ */ import expect from 'expect.js'; -import { CapabilitiesQuery } from '../../../../plugins/infra/common/graphql/types'; -import { capabilitiesQuery } from '../../../../plugins/infra/public/containers/capabilities/capabilities.gql_query'; +import { CapabilitiesQuery } from '../../../../plugins/ingest/common/graphql/types'; +import { capabilitiesQuery } from '../../../../plugins/ingest/public/infraops/containers/capabilities/capabilities.gql_query'; import { KbnTestProvider } from './types'; const capabilitiesTests: KbnTestProvider = ({ getService }) => { diff --git a/x-pack/test/api_integration/apis/infra/metrics.ts b/x-pack/test/api_integration/apis/infra/metrics.ts index 4026a2bc68c9f..c0d59ef690bcc 100644 --- a/x-pack/test/api_integration/apis/infra/metrics.ts +++ b/x-pack/test/api_integration/apis/infra/metrics.ts @@ -6,8 +6,8 @@ import expect from 'expect.js'; import { first, last } from 'lodash'; -import { MetricsQuery } from '../../../../plugins/infra/common/graphql/types'; -import { metricsQuery } from '../../../../plugins/infra/public/containers/metrics/metrics.gql_query'; +import { MetricsQuery } from '../../../../plugins/ingest/common/graphql/types'; +import { metricsQuery } from '../../../../plugins/ingest/public/infraops/containers/metrics/metrics.gql_query'; import { KbnTestProvider } from './types'; const metricTests: KbnTestProvider = ({ getService }) => { diff --git a/x-pack/test/api_integration/apis/infra/sources.ts b/x-pack/test/api_integration/apis/infra/sources.ts index 4b878c071884e..41889f898bfa8 100644 --- a/x-pack/test/api_integration/apis/infra/sources.ts +++ b/x-pack/test/api_integration/apis/infra/sources.ts @@ -5,8 +5,8 @@ */ import expect from 'expect.js'; -import { SourceQuery } from '../../../../plugins/infra/common/graphql/types'; -import { sourceQuery } from '../../../../plugins/infra/public/store/remote/source/operations/query_source.gql_query'; +import { SourceQuery } from '../../../../plugins/ingest/common/graphql/types'; +import { sourceQuery } from '../../../../plugins/ingest/public/store/remote/source/operations/query_source.gql_query'; import { KbnTestProvider } from './types'; diff --git a/x-pack/test/api_integration/apis/infra/waffle.ts b/x-pack/test/api_integration/apis/infra/waffle.ts index ec54cdbd4e217..281ca0f9b52a9 100644 --- a/x-pack/test/api_integration/apis/infra/waffle.ts +++ b/x-pack/test/api_integration/apis/infra/waffle.ts @@ -6,8 +6,8 @@ import expect from 'expect.js'; import { first, last } from 'lodash'; -import { WaffleNodesQuery } from '../../../../plugins/infra/common/graphql/types'; -import { waffleNodesQuery } from '../../../../plugins/infra/public/containers/waffle/waffle_nodes.gql_query'; +import { WaffleNodesQuery } from '../../../../plugins/ingest/common/graphql/types'; +import { waffleNodesQuery } from '../../../../plugins/ingest/public/infraops/containers/waffle/waffle_nodes.gql_query'; import { KbnTestProvider } from './types'; const waffleTests: KbnTestProvider = ({ getService }) => { diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/index_detail_advanced.json b/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/index_detail_advanced.json index ea5bede0db977..01985489bf0d2 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/index_detail_advanced.json +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/index_detail_advanced.json @@ -10,2935 +10,1263 @@ "status": "green" }, "metrics": { - "index_1": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.segments.memory_in_bytes", - "metricAgg": "max", - "label": "Lucene Total", - "title": "Index Memory - Lucene 1", - "description": "Total heap memory used by Lucene for current index. This is the sum of other fields for primary and replica shards.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 2378656 - ], - [ - 1507235530000, - 2378656 - ], - [ - 1507235540000, - 2378656 - ], - [ - 1507235550000, - 2378656 - ], - [ - 1507235560000, - 2378656 - ], - [ - 1507235570000, - 2378656 - ], - [ - 1507235580000, - 2378656 - ], - [ - 1507235590000, - 2378656 - ], - [ - 1507235600000, - 2378656 - ], - [ - 1507235610000, - 2378656 - ], - [ - 1507235620000, - 2378656 - ], - [ - 1507235630000, - 2378656 - ], - [ - 1507235640000, - 2378656 - ], - [ - 1507235650000, - 2378656 - ], - [ - 1507235660000, - 2378656 - ], - [ - 1507235670000, - 2378656 - ], - [ - 1507235680000, - 2378656 - ], - [ - 1507235690000, - 2378656 - ], - [ - 1507235700000, - 2378656 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.segments.stored_fields_memory_in_bytes", - "metricAgg": "max", - "label": "Stored Fields", - "title": "Index Memory", - "description": "Heap memory used by Stored Fields (e.g., _source). This is a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 19024 - ], - [ - 1507235530000, - 19024 - ], - [ - 1507235540000, - 19024 - ], - [ - 1507235550000, - 19024 - ], - [ - 1507235560000, - 19024 - ], - [ - 1507235570000, - 19024 - ], - [ - 1507235580000, - 19024 - ], - [ - 1507235590000, - 19024 - ], - [ - 1507235600000, - 19024 - ], - [ - 1507235610000, - 19024 - ], - [ - 1507235620000, - 19024 - ], - [ - 1507235630000, - 19024 - ], - [ - 1507235640000, - 19024 - ], - [ - 1507235650000, - 19024 - ], - [ - 1507235660000, - 19024 - ], - [ - 1507235670000, - 19024 - ], - [ - 1507235680000, - 19024 - ], - [ - 1507235690000, - 19024 - ], - [ - 1507235700000, - 19024 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.segments.doc_values_memory_in_bytes", - "metricAgg": "max", - "label": "Doc Values", - "title": "Index Memory", - "description": "Heap memory used by Doc Values. This is a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 232336 - ], - [ - 1507235530000, - 232336 - ], - [ - 1507235540000, - 232336 - ], - [ - 1507235550000, - 232336 - ], - [ - 1507235560000, - 232336 - ], - [ - 1507235570000, - 232336 - ], - [ - 1507235580000, - 232336 - ], - [ - 1507235590000, - 232336 - ], - [ - 1507235600000, - 232336 - ], - [ - 1507235610000, - 232336 - ], - [ - 1507235620000, - 232336 - ], - [ - 1507235630000, - 232336 - ], - [ - 1507235640000, - 232336 - ], - [ - 1507235650000, - 232336 - ], - [ - 1507235660000, - 232336 - ], - [ - 1507235670000, - 232336 - ], - [ - 1507235680000, - 232336 - ], - [ - 1507235690000, - 232336 - ], - [ - 1507235700000, - 232336 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.segments.norms_memory_in_bytes", - "metricAgg": "max", - "label": "Norms", - "title": "Index Memory", - "description": "Heap memory used by Norms (normalization factors for query-time, text scoring). This is a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 233472 - ], - [ - 1507235530000, - 233472 - ], - [ - 1507235540000, - 233472 - ], - [ - 1507235550000, - 233472 - ], - [ - 1507235560000, - 233472 - ], - [ - 1507235570000, - 233472 - ], - [ - 1507235580000, - 233472 - ], - [ - 1507235590000, - 233472 - ], - [ - 1507235600000, - 233472 - ], - [ - 1507235610000, - 233472 - ], - [ - 1507235620000, - 233472 - ], - [ - 1507235630000, - 233472 - ], - [ - 1507235640000, - 233472 - ], - [ - 1507235650000, - 233472 - ], - [ - 1507235660000, - 233472 - ], - [ - 1507235670000, - 233472 - ], - [ - 1507235680000, - 233472 - ], - [ - 1507235690000, - 233472 - ], - [ - 1507235700000, - 233472 - ] - ] - } - ], - "index_2": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.segments.memory_in_bytes", - "metricAgg": "max", - "label": "Lucene Total", - "title": "Index Memory - Lucene 2", - "description": "Total heap memory used by Lucene for current index. This is the sum of other fields for primary and replica shards.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 2378656 - ], - [ - 1507235530000, - 2378656 - ], - [ - 1507235540000, - 2378656 - ], - [ - 1507235550000, - 2378656 - ], - [ - 1507235560000, - 2378656 - ], - [ - 1507235570000, - 2378656 - ], - [ - 1507235580000, - 2378656 - ], - [ - 1507235590000, - 2378656 - ], - [ - 1507235600000, - 2378656 - ], - [ - 1507235610000, - 2378656 - ], - [ - 1507235620000, - 2378656 - ], - [ - 1507235630000, - 2378656 - ], - [ - 1507235640000, - 2378656 - ], - [ - 1507235650000, - 2378656 - ], - [ - 1507235660000, - 2378656 - ], - [ - 1507235670000, - 2378656 - ], - [ - 1507235680000, - 2378656 - ], - [ - 1507235690000, - 2378656 - ], - [ - 1507235700000, - 2378656 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.segments.terms_memory_in_bytes", - "metricAgg": "max", - "label": "Terms", - "title": "Index Memory", - "description": "Heap memory used by Terms (e.g., text). This is a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 1889180 - ], - [ - 1507235530000, - 1889180 - ], - [ - 1507235540000, - 1889180 - ], - [ - 1507235550000, - 1889180 - ], - [ - 1507235560000, - 1889180 - ], - [ - 1507235570000, - 1889180 - ], - [ - 1507235580000, - 1889180 - ], - [ - 1507235590000, - 1889180 - ], - [ - 1507235600000, - 1889180 - ], - [ - 1507235610000, - 1889180 - ], - [ - 1507235620000, - 1889180 - ], - [ - 1507235630000, - 1889180 - ], - [ - 1507235640000, - 1889180 - ], - [ - 1507235650000, - 1889180 - ], - [ - 1507235660000, - 1889180 - ], - [ - 1507235670000, - 1889180 - ], - [ - 1507235680000, - 1889180 - ], - [ - 1507235690000, - 1889180 - ], - [ - 1507235700000, - 1889180 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.segments.points_memory_in_bytes", - "metricAgg": "max", - "label": "Points", - "title": "Index Memory", - "description": "Heap memory used by Points (e.g., numbers, IPs, and geo data). This is a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 4644 - ], - [ - 1507235530000, - 4644 - ], - [ - 1507235540000, - 4644 - ], - [ - 1507235550000, - 4644 - ], - [ - 1507235560000, - 4644 - ], - [ - 1507235570000, - 4644 - ], - [ - 1507235580000, - 4644 - ], - [ - 1507235590000, - 4644 - ], - [ - 1507235600000, - 4644 - ], - [ - 1507235610000, - 4644 - ], - [ - 1507235620000, - 4644 - ], - [ - 1507235630000, - 4644 - ], - [ - 1507235640000, - 4644 - ], - [ - 1507235650000, - 4644 - ], - [ - 1507235660000, - 4644 - ], - [ - 1507235670000, - 4644 - ], - [ - 1507235680000, - 4644 - ], - [ - 1507235690000, - 4644 - ], - [ - 1507235700000, - 4644 - ] - ] - } - ], - "index_3": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.segments.memory_in_bytes", - "metricAgg": "max", - "label": "Lucene Total", - "title": "Index Memory - Lucene 3", - "description": "Total heap memory used by Lucene for current index. This is the sum of other fields for primary and replica shards.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 2378656 - ], - [ - 1507235530000, - 2378656 - ], - [ - 1507235540000, - 2378656 - ], - [ - 1507235550000, - 2378656 - ], - [ - 1507235560000, - 2378656 - ], - [ - 1507235570000, - 2378656 - ], - [ - 1507235580000, - 2378656 - ], - [ - 1507235590000, - 2378656 - ], - [ - 1507235600000, - 2378656 - ], - [ - 1507235610000, - 2378656 - ], - [ - 1507235620000, - 2378656 - ], - [ - 1507235630000, - 2378656 - ], - [ - 1507235640000, - 2378656 - ], - [ - 1507235650000, - 2378656 - ], - [ - 1507235660000, - 2378656 - ], - [ - 1507235670000, - 2378656 - ], - [ - 1507235680000, - 2378656 - ], - [ - 1507235690000, - 2378656 - ], - [ - 1507235700000, - 2378656 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.segments.fixed_bit_set_memory_in_bytes", - "metricAgg": "max", - "label": "Fixed Bitsets", - "title": "Index Memory", - "description": "Heap memory used by Fixed Bit Sets (e.g., deeply nested documents). This is a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 0 - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.segments.term_vectors_memory_in_bytes", - "metricAgg": "max", - "label": "Term Vectors", - "title": "Index Memory", - "description": "Heap memory used by Term Vectors. This is a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 0 - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.segments.version_map_memory_in_bytes", - "metricAgg": "max", - "label": "Version Map", - "title": "Index Memory", - "description": "Heap memory used by Versioning (e.g., updates and deletes). This is NOT a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 0 - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - } - ], - "index_4": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.query_cache.memory_size_in_bytes", - "metricAgg": "max", - "label": "Query Cache", - "title": "Index Memory - Elasticsearch", - "description": "Heap memory used by Query Cache (e.g., cached filters). This is for the same shards, but not a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 0 - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.request_cache.memory_size_in_bytes", - "metricAgg": "max", - "label": "Request Cache", - "title": "Index Memory", - "description": "Heap memory used by Request Cache (e.g., instant aggregations). This is for the same shards, but not a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 0 - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.fielddata.memory_size_in_bytes", - "metricAgg": "max", - "label": "Fielddata", - "title": "Index Memory", - "description": "Heap memory used by Fielddata (e.g., global ordinals or explicitly enabled fielddata on text fields). This is for the same shards, but not a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 0 - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.segments.index_writer_memory_in_bytes", - "metricAgg": "max", - "label": "Index Writer", - "title": "Index Memory", - "description": "Heap memory used by the Index Writer. This is NOT a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 0 - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - } - ], - "index_total": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.search.query_total", - "metricAgg": "max", - "label": "Search Total", - "title": "Request Rate", - "description": "Amount of search operations (per shard).", - "units": "", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.primaries.indexing.index_total", - "metricAgg": "max", - "label": "Index Total", - "title": "Request Rate", - "description": "Amount of indexing operations.", - "units": "", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - } - ], - "index_time": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.search.query_time_in_millis", - "metricAgg": "max", - "label": "Search", - "title": "Request Time", - "description": "Amount of time spent performing search operations (per shard).", - "units": "ms", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.indexing.index_time_in_millis", - "metricAgg": "max", - "label": "Indexing", - "title": "Request Time", - "description": "Amount of time spent performing index operations on primary and replica shards.", - "units": "ms", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.primaries.indexing.index_time_in_millis", - "metricAgg": "max", - "label": "Indexing (Primaries)", - "title": "Request Time", - "description": "Amount of time spent performing index operations on primary shards only.", - "units": "ms", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - } - ], - "index_throttling": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.indexing.throttle_time_in_millis", - "metricAgg": "max", - "label": "Indexing", - "title": "Throttle Time", - "description": "Amount of time spent throttling index operations on primary and replica shards.", - "units": "ms", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.primaries.indexing.throttle_time_in_millis", - "metricAgg": "max", - "label": "Indexing (Primaries)", - "title": "Throttle Time", - "description": "Amount of time spent throttling index operations on primary shards.", - "units": "ms", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - } - ], - "index_refresh": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.refresh.total_time_in_millis", - "metricAgg": "max", - "label": "Total", - "title": "Refresh Time", - "description": "Amount of time spent to perform refresh operations on primary and replica shards.", - "units": "ms", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.primaries.refresh.total_time_in_millis", - "metricAgg": "max", - "label": "Primaries", - "title": "Refresh Time", - "description": "Amount of time spent to perform refresh operations on primary shards.", - "units": "ms", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - } - ], - "index_disk": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.store.size_in_bytes", - "metricAgg": "max", - "label": "Store", - "title": "Disk", - "description": "Size of primary and replica shards on disk.", - "units": "B", - "format": "0,0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 9202023 - ], - [ - 1507235530000, - 9202023 - ], - [ - 1507235540000, - 9202023 - ], - [ - 1507235550000, - 9202023 - ], - [ - 1507235560000, - 9202023 - ], - [ - 1507235570000, - 9202023 - ], - [ - 1507235580000, - 9202023 - ], - [ - 1507235590000, - 9202023 - ], - [ - 1507235600000, - 9202023 - ], - [ - 1507235610000, - 9202023 - ], - [ - 1507235620000, - 9202023 - ], - [ - 1507235630000, - 9202023 - ], - [ - 1507235640000, - 9202023 - ], - [ - 1507235650000, - 9202023 - ], - [ - 1507235660000, - 9202023 - ], - [ - 1507235670000, - 9202023 - ], - [ - 1507235680000, - 9202023 - ], - [ - 1507235690000, - 9202023 - ], - [ - 1507235700000, - 9202023 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.primaries.store.size_in_bytes", - "metricAgg": "max", - "label": "Store (Primaries)", - "title": "Disk", - "description": "Size of primary shards on disk.", - "units": "B", - "format": "0,0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 4601000 - ], - [ - 1507235530000, - 4601000 - ], - [ - 1507235540000, - 4601000 - ], - [ - 1507235550000, - 4601000 - ], - [ - 1507235560000, - 4601000 - ], - [ - 1507235570000, - 4601000 - ], - [ - 1507235580000, - 4601000 - ], - [ - 1507235590000, - 4601000 - ], - [ - 1507235600000, - 4601000 - ], - [ - 1507235610000, - 4601000 - ], - [ - 1507235620000, - 4601000 - ], - [ - 1507235630000, - 4601000 - ], - [ - 1507235640000, - 4601000 - ], - [ - 1507235650000, - 4601000 - ], - [ - 1507235660000, - 4601000 - ], - [ - 1507235670000, - 4601000 - ], - [ - 1507235680000, - 4601000 - ], - [ - 1507235690000, - 4601000 - ], - [ - 1507235700000, - 4601000 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.merges.total_size_in_bytes", - "metricAgg": "max", - "label": "Merges", - "title": "Disk", - "description": "Size of merges on primary and replica shards.", - "units": "B", - "format": "0,0.0 b", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.primaries.merges.total_size_in_bytes", - "metricAgg": "max", - "label": "Merges (Primaries)", - "title": "Disk", - "description": "Size of merges on primary shards.", - "units": "B", - "format": "0,0.0 b", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - } - ], - "index_segment_count": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.total.segments.count", - "metricAgg": "max", - "label": "Total", - "title": "Segment Count", - "description": "Number of segments for primary and replica shards.", - "units": "", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 60 - ], - [ - 1507235530000, - 60 - ], - [ - 1507235540000, - 60 - ], - [ - 1507235550000, - 60 - ], - [ - 1507235560000, - 60 - ], - [ - 1507235570000, - 60 - ], - [ - 1507235580000, - 60 - ], - [ - 1507235590000, - 60 - ], - [ - 1507235600000, - 60 - ], - [ - 1507235610000, - 60 - ], - [ - 1507235620000, - 60 - ], - [ - 1507235630000, - 60 - ], - [ - 1507235640000, - 60 - ], - [ - 1507235650000, - 60 - ], - [ - 1507235660000, - 60 - ], - [ - 1507235670000, - 60 - ], - [ - 1507235680000, - 60 - ], - [ - 1507235690000, - 60 - ], - [ - 1507235700000, - 60 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "index_stats.primaries.segments.count", - "metricAgg": "max", - "label": "Primaries", - "title": "Segment Count", - "description": "Number of segments for primary shards.", - "units": "", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 30 - ], - [ - 1507235530000, - 30 - ], - [ - 1507235540000, - 30 - ], - [ - 1507235550000, - 30 - ], - [ - 1507235560000, - 30 - ], - [ - 1507235570000, - 30 - ], - [ - 1507235580000, - 30 - ], - [ - 1507235590000, - 30 - ], - [ - 1507235600000, - 30 - ], - [ - 1507235610000, - 30 - ], - [ - 1507235620000, - 30 - ], - [ - 1507235630000, - 30 - ], - [ - 1507235640000, - 30 - ], - [ - 1507235650000, - 30 - ], - [ - 1507235660000, - 30 - ], - [ - 1507235670000, - 30 - ], - [ - 1507235680000, - 30 - ], - [ - 1507235690000, - 30 - ], - [ - 1507235700000, - 30 - ] - ] - } - ] + "index_1": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.segments.memory_in_bytes", + "metricAgg": "max", + "label": "Lucene Total", + "title": "Index Memory - Lucene 1", + "description": "Total heap memory used by Lucene for current index. This is the sum of other fields for primary and replica shards.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 2378656], + [1507235530000, 2378656], + [1507235540000, 2378656], + [1507235550000, 2378656], + [1507235560000, 2378656], + [1507235570000, 2378656], + [1507235580000, 2378656], + [1507235590000, 2378656], + [1507235600000, 2378656], + [1507235610000, 2378656], + [1507235620000, 2378656], + [1507235630000, 2378656], + [1507235640000, 2378656], + [1507235650000, 2378656], + [1507235660000, 2378656], + [1507235670000, 2378656], + [1507235680000, 2378656], + [1507235690000, 2378656], + [1507235700000, 2378656] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.segments.stored_fields_memory_in_bytes", + "metricAgg": "max", + "label": "Stored Fields", + "title": "Index Memory", + "description": "Heap memory used by Stored Fields (e.g., _source). This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 19024], + [1507235530000, 19024], + [1507235540000, 19024], + [1507235550000, 19024], + [1507235560000, 19024], + [1507235570000, 19024], + [1507235580000, 19024], + [1507235590000, 19024], + [1507235600000, 19024], + [1507235610000, 19024], + [1507235620000, 19024], + [1507235630000, 19024], + [1507235640000, 19024], + [1507235650000, 19024], + [1507235660000, 19024], + [1507235670000, 19024], + [1507235680000, 19024], + [1507235690000, 19024], + [1507235700000, 19024] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.segments.doc_values_memory_in_bytes", + "metricAgg": "max", + "label": "Doc Values", + "title": "Index Memory", + "description": "Heap memory used by Doc Values. This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 232336], + [1507235530000, 232336], + [1507235540000, 232336], + [1507235550000, 232336], + [1507235560000, 232336], + [1507235570000, 232336], + [1507235580000, 232336], + [1507235590000, 232336], + [1507235600000, 232336], + [1507235610000, 232336], + [1507235620000, 232336], + [1507235630000, 232336], + [1507235640000, 232336], + [1507235650000, 232336], + [1507235660000, 232336], + [1507235670000, 232336], + [1507235680000, 232336], + [1507235690000, 232336], + [1507235700000, 232336] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.segments.norms_memory_in_bytes", + "metricAgg": "max", + "label": "Norms", + "title": "Index Memory", + "description": "Heap memory used by Norms (normalization factors for query-time, text scoring). This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 233472], + [1507235530000, 233472], + [1507235540000, 233472], + [1507235550000, 233472], + [1507235560000, 233472], + [1507235570000, 233472], + [1507235580000, 233472], + [1507235590000, 233472], + [1507235600000, 233472], + [1507235610000, 233472], + [1507235620000, 233472], + [1507235630000, 233472], + [1507235640000, 233472], + [1507235650000, 233472], + [1507235660000, 233472], + [1507235670000, 233472], + [1507235680000, 233472], + [1507235690000, 233472], + [1507235700000, 233472] + ] + }], + "index_2": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.segments.memory_in_bytes", + "metricAgg": "max", + "label": "Lucene Total", + "title": "Index Memory - Lucene 2", + "description": "Total heap memory used by Lucene for current index. This is the sum of other fields for primary and replica shards.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 2378656], + [1507235530000, 2378656], + [1507235540000, 2378656], + [1507235550000, 2378656], + [1507235560000, 2378656], + [1507235570000, 2378656], + [1507235580000, 2378656], + [1507235590000, 2378656], + [1507235600000, 2378656], + [1507235610000, 2378656], + [1507235620000, 2378656], + [1507235630000, 2378656], + [1507235640000, 2378656], + [1507235650000, 2378656], + [1507235660000, 2378656], + [1507235670000, 2378656], + [1507235680000, 2378656], + [1507235690000, 2378656], + [1507235700000, 2378656] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.segments.terms_memory_in_bytes", + "metricAgg": "max", + "label": "Terms", + "title": "Index Memory", + "description": "Heap memory used by Terms (e.g., text). This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 1889180], + [1507235530000, 1889180], + [1507235540000, 1889180], + [1507235550000, 1889180], + [1507235560000, 1889180], + [1507235570000, 1889180], + [1507235580000, 1889180], + [1507235590000, 1889180], + [1507235600000, 1889180], + [1507235610000, 1889180], + [1507235620000, 1889180], + [1507235630000, 1889180], + [1507235640000, 1889180], + [1507235650000, 1889180], + [1507235660000, 1889180], + [1507235670000, 1889180], + [1507235680000, 1889180], + [1507235690000, 1889180], + [1507235700000, 1889180] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.segments.points_memory_in_bytes", + "metricAgg": "max", + "label": "Points", + "title": "Index Memory", + "description": "Heap memory used by Points (e.g., numbers, IPs, and geo data). This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 4644], + [1507235530000, 4644], + [1507235540000, 4644], + [1507235550000, 4644], + [1507235560000, 4644], + [1507235570000, 4644], + [1507235580000, 4644], + [1507235590000, 4644], + [1507235600000, 4644], + [1507235610000, 4644], + [1507235620000, 4644], + [1507235630000, 4644], + [1507235640000, 4644], + [1507235650000, 4644], + [1507235660000, 4644], + [1507235670000, 4644], + [1507235680000, 4644], + [1507235690000, 4644], + [1507235700000, 4644] + ] + }], + "index_3": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.segments.memory_in_bytes", + "metricAgg": "max", + "label": "Lucene Total", + "title": "Index Memory - Lucene 3", + "description": "Total heap memory used by Lucene for current index. This is the sum of other fields for primary and replica shards.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 2378656], + [1507235530000, 2378656], + [1507235540000, 2378656], + [1507235550000, 2378656], + [1507235560000, 2378656], + [1507235570000, 2378656], + [1507235580000, 2378656], + [1507235590000, 2378656], + [1507235600000, 2378656], + [1507235610000, 2378656], + [1507235620000, 2378656], + [1507235630000, 2378656], + [1507235640000, 2378656], + [1507235650000, 2378656], + [1507235660000, 2378656], + [1507235670000, 2378656], + [1507235680000, 2378656], + [1507235690000, 2378656], + [1507235700000, 2378656] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.segments.fixed_bit_set_memory_in_bytes", + "metricAgg": "max", + "label": "Fixed Bitsets", + "title": "Index Memory", + "description": "Heap memory used by Fixed Bit Sets (e.g., deeply nested documents). This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 0], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.segments.term_vectors_memory_in_bytes", + "metricAgg": "max", + "label": "Term Vectors", + "title": "Index Memory", + "description": "Heap memory used by Term Vectors. This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 0], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.segments.version_map_memory_in_bytes", + "metricAgg": "max", + "label": "Version Map", + "title": "Index Memory", + "description": "Heap memory used by Versioning (e.g., updates and deletes). This is NOT a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 0], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }], + "index_4": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.query_cache.memory_size_in_bytes", + "metricAgg": "max", + "label": "Query Cache", + "title": "Index Memory - Elasticsearch", + "description": "Heap memory used by Query Cache (e.g., cached filters). This is for the same shards, but not a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 0], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.request_cache.memory_size_in_bytes", + "metricAgg": "max", + "label": "Request Cache", + "title": "Index Memory", + "description": "Heap memory used by Request Cache (e.g., instant aggregations). This is for the same shards, but not a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 0], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.fielddata.memory_size_in_bytes", + "metricAgg": "max", + "label": "Fielddata", + "title": "Index Memory", + "description": "Heap memory used by Fielddata (e.g., global ordinals or explicitly enabled fielddata on text fields). This is for the same shards, but not a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 0], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.segments.index_writer_memory_in_bytes", + "metricAgg": "max", + "label": "Index Writer", + "title": "Index Memory", + "description": "Heap memory used by the Index Writer. This is NOT a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 0], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }], + "index_total": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.search.query_total", + "metricAgg": "max", + "label": "Search Total", + "title": "Request Rate", + "description": "Amount of search operations (per shard).", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.primaries.indexing.index_total", + "metricAgg": "max", + "label": "Index Total", + "title": "Request Rate", + "description": "Amount of indexing operations.", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }], + "index_time": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.search.query_time_in_millis", + "metricAgg": "max", + "label": "Search", + "title": "Request Time", + "description": "Amount of time spent performing search operations (per shard).", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.indexing.index_time_in_millis", + "metricAgg": "max", + "label": "Indexing", + "title": "Request Time", + "description": "Amount of time spent performing index operations on primary and replica shards.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.primaries.indexing.index_time_in_millis", + "metricAgg": "max", + "label": "Indexing (Primaries)", + "title": "Request Time", + "description": "Amount of time spent performing index operations on primary shards only.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }], + "index_throttling": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.indexing.throttle_time_in_millis", + "metricAgg": "max", + "label": "Indexing", + "title": "Throttle Time", + "description": "Amount of time spent throttling index operations on primary and replica shards.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.primaries.indexing.throttle_time_in_millis", + "metricAgg": "max", + "label": "Indexing (Primaries)", + "title": "Throttle Time", + "description": "Amount of time spent throttling index operations on primary shards.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }], + "index_refresh": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.refresh.total_time_in_millis", + "metricAgg": "max", + "label": "Total", + "title": "Refresh Time", + "description": "Amount of time spent to perform refresh operations on primary and replica shards.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.primaries.refresh.total_time_in_millis", + "metricAgg": "max", + "label": "Primaries", + "title": "Refresh Time", + "description": "Amount of time spent to perform refresh operations on primary shards.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }], + "index_disk": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.store.size_in_bytes", + "metricAgg": "max", + "label": "Store", + "title": "Disk", + "description": "Size of primary and replica shards on disk.", + "units": "B", + "format": "0,0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 9202023], + [1507235530000, 9202023], + [1507235540000, 9202023], + [1507235550000, 9202023], + [1507235560000, 9202023], + [1507235570000, 9202023], + [1507235580000, 9202023], + [1507235590000, 9202023], + [1507235600000, 9202023], + [1507235610000, 9202023], + [1507235620000, 9202023], + [1507235630000, 9202023], + [1507235640000, 9202023], + [1507235650000, 9202023], + [1507235660000, 9202023], + [1507235670000, 9202023], + [1507235680000, 9202023], + [1507235690000, 9202023], + [1507235700000, 9202023] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.primaries.store.size_in_bytes", + "metricAgg": "max", + "label": "Store (Primaries)", + "title": "Disk", + "description": "Size of primary shards on disk.", + "units": "B", + "format": "0,0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 4601000], + [1507235530000, 4601000], + [1507235540000, 4601000], + [1507235550000, 4601000], + [1507235560000, 4601000], + [1507235570000, 4601000], + [1507235580000, 4601000], + [1507235590000, 4601000], + [1507235600000, 4601000], + [1507235610000, 4601000], + [1507235620000, 4601000], + [1507235630000, 4601000], + [1507235640000, 4601000], + [1507235650000, 4601000], + [1507235660000, 4601000], + [1507235670000, 4601000], + [1507235680000, 4601000], + [1507235690000, 4601000], + [1507235700000, 4601000] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.merges.total_size_in_bytes", + "metricAgg": "max", + "label": "Merges", + "title": "Disk", + "description": "Size of merges on primary and replica shards.", + "units": "B", + "format": "0,0.0 b", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.primaries.merges.total_size_in_bytes", + "metricAgg": "max", + "label": "Merges (Primaries)", + "title": "Disk", + "description": "Size of merges on primary shards.", + "units": "B", + "format": "0,0.0 b", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }], + "index_segment_count": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.segments.count", + "metricAgg": "max", + "label": "Total", + "title": "Segment Count", + "description": "Number of segments for primary and replica shards.", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 60], + [1507235530000, 60], + [1507235540000, 60], + [1507235550000, 60], + [1507235560000, 60], + [1507235570000, 60], + [1507235580000, 60], + [1507235590000, 60], + [1507235600000, 60], + [1507235610000, 60], + [1507235620000, 60], + [1507235630000, 60], + [1507235640000, 60], + [1507235650000, 60], + [1507235660000, 60], + [1507235670000, 60], + [1507235680000, 60], + [1507235690000, 60], + [1507235700000, 60] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.primaries.segments.count", + "metricAgg": "max", + "label": "Primaries", + "title": "Segment Count", + "description": "Number of segments for primary shards.", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 30], + [1507235530000, 30], + [1507235540000, 30], + [1507235550000, 30], + [1507235560000, 30], + [1507235570000, 30], + [1507235580000, 30], + [1507235590000, 30], + [1507235600000, 30], + [1507235610000, 30], + [1507235620000, 30], + [1507235630000, 30], + [1507235640000, 30], + [1507235650000, 30], + [1507235660000, 30], + [1507235670000, 30], + [1507235680000, 30], + [1507235690000, 30], + [1507235700000, 30] + ] + }], + "index_latency": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.primaries.indexing.index_total", + "metricAgg": "sum", + "label": "Indexing Latency", + "title": "Latency", + "description": "Average latency for indexing documents, which is time it takes to index documents divided by number that were indexed. This only considers primary shards.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": true, + "isDerivative": false + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "index_stats.total.search.query_total", + "metricAgg": "sum", + "label": "Search Latency", + "description": "Average latency for searching, which is time it takes to execute searches divided by number of searches submitted. This considers primary and replica shards.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": true, + "isDerivative": false + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }] } } diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/node_detail_advanced.json b/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/node_detail_advanced.json index 14c2faf20f17f..acb7ca71f0e2a 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/node_detail_advanced.json +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/fixtures/node_detail_advanced.json @@ -1,9 +1,7 @@ { "nodeSummary": { "resolver": "jUT5KdxfRbORSCWkb5zjmA", - "node_ids": [ - "jUT5KdxfRbORSCWkb5zjmA" - ], + "node_ids": ["jUT5KdxfRbORSCWkb5zjmA"], "attributes": { "ml.max_open_jobs": "10", "ml.enabled": "true" @@ -23,3621 +21,1540 @@ "isOnline": true }, "metrics": { - "node_jvm_mem": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.jvm.mem.heap_max_in_bytes", - "metricAgg": "max", - "label": "Max Heap", - "title": "JVM Heap", - "description": "Total heap available to Elasticsearch running in the JVM.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 709623808 - ], - [ - 1507235530000, - 709623808 - ], - [ - 1507235540000, - 709623808 - ], - [ - 1507235550000, - 709623808 - ], - [ - 1507235560000, - 709623808 - ], - [ - 1507235570000, - 709623808 - ], - [ - 1507235580000, - 709623808 - ], - [ - 1507235590000, - 709623808 - ], - [ - 1507235600000, - 709623808 - ], - [ - 1507235610000, - 709623808 - ], - [ - 1507235620000, - 709623808 - ], - [ - 1507235630000, - 709623808 - ], - [ - 1507235640000, - 709623808 - ], - [ - 1507235650000, - 709623808 - ], - [ - 1507235660000, - 709623808 - ], - [ - 1507235670000, - 709623808 - ], - [ - 1507235680000, - 709623808 - ], - [ - 1507235690000, - 709623808 - ], - [ - 1507235700000, - 709623808 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.jvm.mem.heap_used_in_bytes", - "metricAgg": "max", - "label": "Used Heap", - "title": "JVM Heap", - "description": "Total heap used by Elasticsearch running in the JVM.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 317052776 - ], - [ - 1507235530000, - 344014976 - ], - [ - 1507235540000, - 368593248 - ], - [ - 1507235550000, - 253850400 - ], - [ - 1507235560000, - 348095032 - ], - [ - 1507235570000, - 182919712 - ], - [ - 1507235580000, - 212395016 - ], - [ - 1507235590000, - 244004144 - ], - [ - 1507235600000, - 270412240 - ], - [ - 1507235610000, - 245052864 - ], - [ - 1507235620000, - 370270616 - ], - [ - 1507235630000, - 196944168 - ], - [ - 1507235640000, - 223491760 - ], - [ - 1507235650000, - 253878472 - ], - [ - 1507235660000, - 280811736 - ], - [ - 1507235670000, - 371931976 - ], - [ - 1507235680000, - 329874616 - ], - [ - 1507235690000, - 363869776 - ], - [ - 1507235700000, - 211045968 - ] - ] - } - ], - "node_gc": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.jvm.gc.collectors.old.collection_count", - "metricAgg": "max", - "label": "Old", - "title": "GC Count", - "description": "Number of old Garbage Collections.", - "units": "", - "format": "0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.jvm.gc.collectors.young.collection_count", - "metricAgg": "max", - "label": "Young", - "title": "GC Count", - "description": "Number of young Garbage Collections.", - "units": "", - "format": "0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0.1 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0.1 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0.1 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0.1 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0.1 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0.1 - ] - ] - } - ], - "node_gc_time": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.jvm.gc.collectors.old.collection_time_in_millis", - "metricAgg": "max", - "label": "Old", - "title": "GC Duration", - "description": "Time spent performing old Garbage Collections.", - "units": "ms", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.jvm.gc.collectors.young.collection_time_in_millis", - "metricAgg": "max", - "label": "Young", - "title": "GC Duration", - "description": "Time spent performing young Garbage Collections.", - "units": "ms", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 1.1 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 1.2 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 1 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 1.1 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 2.9 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 2.1 - ] - ] - } - ], - "node_index_1": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.segments.memory_in_bytes", - "metricAgg": "max", - "label": "Lucene Total", - "title": "Index Memory - Lucene 1", - "description": "Total heap memory used by Lucene for current index. This is the sum of other fields for primary and replica shards on this node.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 4797457 - ], - [ - 1507235530000, - 4797457 - ], - [ - 1507235540000, - 4797457 - ], - [ - 1507235550000, - 4797457 - ], - [ - 1507235560000, - 4823580 - ], - [ - 1507235570000, - 4823580 - ], - [ - 1507235580000, - 4823580 - ], - [ - 1507235590000, - 4823580 - ], - [ - 1507235600000, - 4823580 - ], - [ - 1507235610000, - 4838368 - ], - [ - 1507235620000, - 4741420 - ], - [ - 1507235630000, - 4741420 - ], - [ - 1507235640000, - 4741420 - ], - [ - 1507235650000, - 4741420 - ], - [ - 1507235660000, - 4741420 - ], - [ - 1507235670000, - 4757998 - ], - [ - 1507235680000, - 4787542 - ], - [ - 1507235690000, - 4787542 - ], - [ - 1507235700000, - 4787542 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.segments.stored_fields_memory_in_bytes", - "metricAgg": "max", - "label": "Stored Fields", - "title": "Index Memory", - "description": "Heap memory used by Stored Fields (e.g., _source). This is a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 56792 - ], - [ - 1507235530000, - 56792 - ], - [ - 1507235540000, - 56792 - ], - [ - 1507235550000, - 56792 - ], - [ - 1507235560000, - 57728 - ], - [ - 1507235570000, - 57728 - ], - [ - 1507235580000, - 57728 - ], - [ - 1507235590000, - 57728 - ], - [ - 1507235600000, - 57728 - ], - [ - 1507235610000, - 58352 - ], - [ - 1507235620000, - 56192 - ], - [ - 1507235630000, - 56192 - ], - [ - 1507235640000, - 56192 - ], - [ - 1507235650000, - 56192 - ], - [ - 1507235660000, - 56192 - ], - [ - 1507235670000, - 56816 - ], - [ - 1507235680000, - 57440 - ], - [ - 1507235690000, - 57440 - ], - [ - 1507235700000, - 57440 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.segments.doc_values_memory_in_bytes", - "metricAgg": "max", - "label": "Doc Values", - "title": "Index Memory", - "description": "Heap memory used by Doc Values. This is a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 516824 - ], - [ - 1507235530000, - 516824 - ], - [ - 1507235540000, - 516824 - ], - [ - 1507235550000, - 516824 - ], - [ - 1507235560000, - 517292 - ], - [ - 1507235570000, - 517292 - ], - [ - 1507235580000, - 517292 - ], - [ - 1507235590000, - 517292 - ], - [ - 1507235600000, - 517292 - ], - [ - 1507235610000, - 517612 - ], - [ - 1507235620000, - 514808 - ], - [ - 1507235630000, - 514808 - ], - [ - 1507235640000, - 514808 - ], - [ - 1507235650000, - 514808 - ], - [ - 1507235660000, - 514808 - ], - [ - 1507235670000, - 515312 - ], - [ - 1507235680000, - 516008 - ], - [ - 1507235690000, - 516008 - ], - [ - 1507235700000, - 516008 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.segments.norms_memory_in_bytes", - "metricAgg": "max", - "label": "Norms", - "title": "Index Memory", - "description": "Heap memory used by Norms (normalization factors for query-time, text scoring). This is a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 447232 - ], - [ - 1507235530000, - 447232 - ], - [ - 1507235540000, - 447232 - ], - [ - 1507235550000, - 447232 - ], - [ - 1507235560000, - 449600 - ], - [ - 1507235570000, - 449600 - ], - [ - 1507235580000, - 449600 - ], - [ - 1507235590000, - 449600 - ], - [ - 1507235600000, - 449600 - ], - [ - 1507235610000, - 450880 - ], - [ - 1507235620000, - 442304 - ], - [ - 1507235630000, - 442304 - ], - [ - 1507235640000, - 442304 - ], - [ - 1507235650000, - 442304 - ], - [ - 1507235660000, - 442304 - ], - [ - 1507235670000, - 443840 - ], - [ - 1507235680000, - 446400 - ], - [ - 1507235690000, - 446400 - ], - [ - 1507235700000, - 446400 - ] - ] - } - ], - "node_index_2": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.segments.memory_in_bytes", - "metricAgg": "max", - "label": "Lucene Total", - "title": "Index Memory - Lucene 2", - "description": "Total heap memory used by Lucene for current index. This is the sum of other fields for primary and replica shards on this node.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 4797457 - ], - [ - 1507235530000, - 4797457 - ], - [ - 1507235540000, - 4797457 - ], - [ - 1507235550000, - 4797457 - ], - [ - 1507235560000, - 4823580 - ], - [ - 1507235570000, - 4823580 - ], - [ - 1507235580000, - 4823580 - ], - [ - 1507235590000, - 4823580 - ], - [ - 1507235600000, - 4823580 - ], - [ - 1507235610000, - 4838368 - ], - [ - 1507235620000, - 4741420 - ], - [ - 1507235630000, - 4741420 - ], - [ - 1507235640000, - 4741420 - ], - [ - 1507235650000, - 4741420 - ], - [ - 1507235660000, - 4741420 - ], - [ - 1507235670000, - 4757998 - ], - [ - 1507235680000, - 4787542 - ], - [ - 1507235690000, - 4787542 - ], - [ - 1507235700000, - 4787542 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.segments.terms_memory_in_bytes", - "metricAgg": "max", - "label": "Terms", - "title": "Index Memory", - "description": "Heap memory used by Terms (e.g., text). This is a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 3764438 - ], - [ - 1507235530000, - 3764438 - ], - [ - 1507235540000, - 3764438 - ], - [ - 1507235550000, - 3764438 - ], - [ - 1507235560000, - 3786762 - ], - [ - 1507235570000, - 3786762 - ], - [ - 1507235580000, - 3786762 - ], - [ - 1507235590000, - 3786762 - ], - [ - 1507235600000, - 3786762 - ], - [ - 1507235610000, - 3799306 - ], - [ - 1507235620000, - 3715996 - ], - [ - 1507235630000, - 3715996 - ], - [ - 1507235640000, - 3715996 - ], - [ - 1507235650000, - 3715996 - ], - [ - 1507235660000, - 3715996 - ], - [ - 1507235670000, - 3729890 - ], - [ - 1507235680000, - 3755528 - ], - [ - 1507235690000, - 3755528 - ], - [ - 1507235700000, - 3755528 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.segments.points_memory_in_bytes", - "metricAgg": "max", - "label": "Points", - "title": "Index Memory", - "description": "Heap memory used by Points (e.g., numbers, IPs, and geo data). This is a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 12171 - ], - [ - 1507235530000, - 12171 - ], - [ - 1507235540000, - 12171 - ], - [ - 1507235550000, - 12171 - ], - [ - 1507235560000, - 12198 - ], - [ - 1507235570000, - 12198 - ], - [ - 1507235580000, - 12198 - ], - [ - 1507235590000, - 12198 - ], - [ - 1507235600000, - 12198 - ], - [ - 1507235610000, - 12218 - ], - [ - 1507235620000, - 12120 - ], - [ - 1507235630000, - 12120 - ], - [ - 1507235640000, - 12120 - ], - [ - 1507235650000, - 12120 - ], - [ - 1507235660000, - 12120 - ], - [ - 1507235670000, - 12140 - ], - [ - 1507235680000, - 12166 - ], - [ - 1507235690000, - 12166 - ], - [ - 1507235700000, - 12166 - ] - ] - } - ], - "node_index_3": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.segments.memory_in_bytes", - "metricAgg": "max", - "label": "Lucene Total", - "title": "Index Memory - Lucene 3", - "description": "Total heap memory used by Lucene for current index. This is the sum of other fields for primary and replica shards on this node.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 4797457 - ], - [ - 1507235530000, - 4797457 - ], - [ - 1507235540000, - 4797457 - ], - [ - 1507235550000, - 4797457 - ], - [ - 1507235560000, - 4823580 - ], - [ - 1507235570000, - 4823580 - ], - [ - 1507235580000, - 4823580 - ], - [ - 1507235590000, - 4823580 - ], - [ - 1507235600000, - 4823580 - ], - [ - 1507235610000, - 4838368 - ], - [ - 1507235620000, - 4741420 - ], - [ - 1507235630000, - 4741420 - ], - [ - 1507235640000, - 4741420 - ], - [ - 1507235650000, - 4741420 - ], - [ - 1507235660000, - 4741420 - ], - [ - 1507235670000, - 4757998 - ], - [ - 1507235680000, - 4787542 - ], - [ - 1507235690000, - 4787542 - ], - [ - 1507235700000, - 4787542 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.segments.fixed_bit_set_memory_in_bytes", - "metricAgg": "max", - "label": "Fixed Bitsets", - "title": "Index Memory", - "description": "Heap memory used by Fixed Bit Sets (e.g., deeply nested documents). This is a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 4024 - ], - [ - 1507235530000, - 4024 - ], - [ - 1507235540000, - 4024 - ], - [ - 1507235550000, - 4024 - ], - [ - 1507235560000, - 4120 - ], - [ - 1507235570000, - 4120 - ], - [ - 1507235580000, - 4120 - ], - [ - 1507235590000, - 4120 - ], - [ - 1507235600000, - 4120 - ], - [ - 1507235610000, - 4168 - ], - [ - 1507235620000, - 3832 - ], - [ - 1507235630000, - 3832 - ], - [ - 1507235640000, - 3832 - ], - [ - 1507235650000, - 3832 - ], - [ - 1507235660000, - 3832 - ], - [ - 1507235670000, - 3880 - ], - [ - 1507235680000, - 3976 - ], - [ - 1507235690000, - 3976 - ], - [ - 1507235700000, - 3976 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.segments.term_vectors_memory_in_bytes", - "metricAgg": "max", - "label": "Term Vectors", - "title": "Index Memory", - "description": "Heap memory used by Term Vectors. This is a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 0 - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.segments.version_map_memory_in_bytes", - "metricAgg": "max", - "label": "Version Map", - "title": "Index Memory", - "description": "Heap memory used by Versioning (e.g., updates and deletes). This is NOT a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 5551 - ], - [ - 1507235530000, - 5551 - ], - [ - 1507235540000, - 5551 - ], - [ - 1507235550000, - 6594 - ], - [ - 1507235560000, - 6662 - ], - [ - 1507235570000, - 6662 - ], - [ - 1507235580000, - 6662 - ], - [ - 1507235590000, - 6662 - ], - [ - 1507235600000, - 6662 - ], - [ - 1507235610000, - 7531 - ], - [ - 1507235620000, - 7837 - ], - [ - 1507235630000, - 7837 - ], - [ - 1507235640000, - 7837 - ], - [ - 1507235650000, - 7837 - ], - [ - 1507235660000, - 7837 - ], - [ - 1507235670000, - 9974 - ], - [ - 1507235680000, - 9716 - ], - [ - 1507235690000, - 9716 - ], - [ - 1507235700000, - 9716 - ] - ] - } - ], - "node_index_4": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.query_cache.memory_size_in_bytes", - "metricAgg": "max", - "label": "Query Cache", - "title": "Index Memory - Elasticsearch", - "description": "Heap memory used by Query Cache (e.g., cached filters). This is for the same shards, but not a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 0 - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.request_cache.memory_size_in_bytes", - "metricAgg": "max", - "label": "Request Cache", - "title": "Index Memory", - "description": "Heap memory used by Request Cache (e.g., instant aggregations). This is for the same shards, but not a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 2921 - ], - [ - 1507235530000, - 2921 - ], - [ - 1507235540000, - 2921 - ], - [ - 1507235550000, - 2921 - ], - [ - 1507235560000, - 2921 - ], - [ - 1507235570000, - 2921 - ], - [ - 1507235580000, - 2921 - ], - [ - 1507235590000, - 2921 - ], - [ - 1507235600000, - 2921 - ], - [ - 1507235610000, - 2921 - ], - [ - 1507235620000, - 2921 - ], - [ - 1507235630000, - 2921 - ], - [ - 1507235640000, - 2921 - ], - [ - 1507235650000, - 2921 - ], - [ - 1507235660000, - 2921 - ], - [ - 1507235670000, - 2921 - ], - [ - 1507235680000, - 2921 - ], - [ - 1507235690000, - 2921 - ], - [ - 1507235700000, - 2921 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.fielddata.memory_size_in_bytes", - "metricAgg": "max", - "label": "Fielddata", - "title": "Index Memory", - "description": "Heap memory used by Fielddata (e.g., global ordinals or explicitly enabled fielddata on text fields). This is for the same shards, but not a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 0 - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.segments.index_writer_memory_in_bytes", - "metricAgg": "max", - "label": "Index Writer", - "title": "Index Memory", - "description": "Heap memory used by the Index Writer. This is NOT a part of Lucene Total.", - "units": "B", - "format": "0.0 b", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 153549 - ], - [ - 1507235530000, - 153549 - ], - [ - 1507235540000, - 153549 - ], - [ - 1507235550000, - 849833 - ], - [ - 1507235560000, - 156505 - ], - [ - 1507235570000, - 156505 - ], - [ - 1507235580000, - 156505 - ], - [ - 1507235590000, - 156505 - ], - [ - 1507235600000, - 156505 - ], - [ - 1507235610000, - 3140275 - ], - [ - 1507235620000, - 159637 - ], - [ - 1507235630000, - 159637 - ], - [ - 1507235640000, - 159637 - ], - [ - 1507235650000, - 159637 - ], - [ - 1507235660000, - 159637 - ], - [ - 1507235670000, - 3737997 - ], - [ - 1507235680000, - 164351 - ], - [ - 1507235690000, - 164351 - ], - [ - 1507235700000, - 164351 - ] - ] - } - ], - "node_request_total": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.search.query_total", - "metricAgg": "max", - "label": "Search Total", - "title": "Request Rate", - "description": "Amount of search operations (per shard).", - "units": "", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0.3 - ], - [ - 1507235540000, - 0.3 - ], - [ - 1507235550000, - 0.3 - ], - [ - 1507235560000, - 0.3 - ], - [ - 1507235570000, - 0.3 - ], - [ - 1507235580000, - 0.3 - ], - [ - 1507235590000, - 0.4 - ], - [ - 1507235600000, - 0.3 - ], - [ - 1507235610000, - 0.5 - ], - [ - 1507235620000, - 0.3 - ], - [ - 1507235630000, - 0.3 - ], - [ - 1507235640000, - 0.2 - ], - [ - 1507235650000, - 0.3 - ], - [ - 1507235660000, - 0.3 - ], - [ - 1507235670000, - 0.5 - ], - [ - 1507235680000, - 0.5 - ], - [ - 1507235690000, - 0.1 - ], - [ - 1507235700000, - 0.4 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.indexing.index_total", - "metricAgg": "max", - "label": "Indexing Total", - "title": "Request Rate", - "description": "Amount of indexing operations.", - "units": "", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0.9 - ], - [ - 1507235560000, - 0.6 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0.9 - ], - [ - 1507235620000, - 0.6 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 1.8 - ], - [ - 1507235680000, - 0.8 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - } - ], - "node_index_time": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.indexing.index_time_in_millis", - "metricAgg": "max", - "label": "Index Time", - "title": "Indexing Time", - "description": "Amount of time spent on indexing operations.", - "units": "ms", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0.8 - ], - [ - 1507235560000, - 0.7 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 1.2 - ], - [ - 1507235620000, - 0.7 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 4.2 - ], - [ - 1507235680000, - 2.3 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.indices.indexing.throttle_time_in_millis", - "metricAgg": "max", - "label": "Index Throttling Time", - "title": "Indexing Time", - "description": "Amount of time spent with index throttling, which indicates slow disks on a node.", - "units": "ms", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - } - ], - "node_index_threads": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.thread_pool.write.queue", - "metricAgg": "max", - "label": "Write Queue", - "title": "Indexing Threads", - "description": "Number of index, bulk, and write operations in the queue. The bulk threadpool was renamed to write in 6.3, and the index threadpool is deprecated.", - "units": "", - "format": "0.[00]", - "hasCalculation": true, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 0 - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.thread_pool.write.rejected", - "metricAgg": "max", - "label": "Write Rejections", - "title": "Indexing Threads", - "description": "Number of index, bulk, and write operations that have been rejected, which occurs when the queue is full. The bulk threadpool was renamed to write in 6.3, and the index threadpool is deprecated.", - "units": "", - "format": "0.[00]", - "hasCalculation": true, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - } - ], - "node_read_threads": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.thread_pool.search.queue", - "metricAgg": "max", - "label": "Search Queue", - "title": "Read Threads", - "description": "Number of search operations in the queue (e.g., shard level searches).", - "units": "", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0.2 - ], - [ - 1507235680000, - null - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.thread_pool.search.rejected", - "metricAgg": "max", - "label": "Search Rejections", - "title": "Read Threads", - "description": "Number of search operations that have been rejected, which occurs when the queue is full.", - "units": "", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.thread_pool.get.queue", - "metricAgg": "max", - "label": "GET Queue", - "title": "Read Threads", - "description": "Number of GET operations in the queue.", - "units": "", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.thread_pool.get.rejected", - "metricAgg": "max", - "label": "GET Rejections", - "title": "Read Threads", - "description": "Number of GET operations that have been rejected, which occurs when the queue is full.", - "units": "", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 0 - ], - [ - 1507235560000, - 0 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 0 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 0 - ], - [ - 1507235620000, - 0 - ], - [ - 1507235630000, - 0 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 0 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 0 - ], - [ - 1507235680000, - 0 - ], - [ - 1507235690000, - 0 - ], - [ - 1507235700000, - 0 - ] - ] - } - ], - "node_cpu_utilization": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.process.cpu.percent", - "metricAgg": "max", - "label": "CPU Utilization", - "description": "Percentage of CPU usage for the Elasticsearch process.", - "units": "%", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": false - }, - "data": [ - [ - 1507235520000, - 1 - ], - [ - 1507235530000, - 0 - ], - [ - 1507235540000, - 0 - ], - [ - 1507235550000, - 1 - ], - [ - 1507235560000, - 2 - ], - [ - 1507235570000, - 0 - ], - [ - 1507235580000, - 2 - ], - [ - 1507235590000, - 0 - ], - [ - 1507235600000, - 0 - ], - [ - 1507235610000, - 3 - ], - [ - 1507235620000, - 2 - ], - [ - 1507235630000, - 2 - ], - [ - 1507235640000, - 0 - ], - [ - 1507235650000, - 1 - ], - [ - 1507235660000, - 0 - ], - [ - 1507235670000, - 2 - ], - [ - 1507235680000, - 2 - ], - [ - 1507235690000, - 1 - ], - [ - 1507235700000, - 0 - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.process.cpu.percent", - "metricAgg": "max", - "label": "Cgroup CPU Utilization", - "title": "CPU Utilization", - "description": "CPU Usage time compared to the CPU quota shown in percentage. If CPU quotas are not set, then no data will be shown.", - "units": "%", - "format": "0,0.[00]", - "hasCalculation": true, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - null - ], - [ - 1507235540000, - null - ], - [ - 1507235550000, - null - ], - [ - 1507235560000, - null - ], - [ - 1507235570000, - null - ], - [ - 1507235580000, - null - ], - [ - 1507235590000, - null - ], - [ - 1507235600000, - null - ], - [ - 1507235610000, - null - ], - [ - 1507235620000, - null - ], - [ - 1507235630000, - null - ], - [ - 1507235640000, - null - ], - [ - 1507235650000, - null - ], - [ - 1507235660000, - null - ], - [ - 1507235670000, - null - ], - [ - 1507235680000, - null - ], - [ - 1507235690000, - null - ], - [ - 1507235700000, - null - ] - ] - } - ], - "node_cgroup_cpu": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.os.cgroup.cpuacct.usage_nanos", - "metricAgg": "max", - "label": "Cgroup Usage", - "title": "Cgroup CPU Performance", - "description": "The usage, reported in nanoseconds, of the Cgroup. Compare this with the throttling to discover issues.", - "units": "ns", - "format": "0,0.[0]a", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - null - ], - [ - 1507235540000, - null - ], - [ - 1507235550000, - null - ], - [ - 1507235560000, - null - ], - [ - 1507235570000, - null - ], - [ - 1507235580000, - null - ], - [ - 1507235590000, - null - ], - [ - 1507235600000, - null - ], - [ - 1507235610000, - null - ], - [ - 1507235620000, - null - ], - [ - 1507235630000, - null - ], - [ - 1507235640000, - null - ], - [ - 1507235650000, - null - ], - [ - 1507235660000, - null - ], - [ - 1507235670000, - null - ], - [ - 1507235680000, - null - ], - [ - 1507235690000, - null - ], - [ - 1507235700000, - null - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.os.cgroup.cpu.stat.time_throttled_nanos", - "metricAgg": "max", - "label": "Cgroup Throttling", - "title": "Cgroup CPU Performance", - "description": "The amount of throttled time, reported in nanoseconds, of the Cgroup.", - "units": "ns", - "format": "0,0.[0]a", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - null - ], - [ - 1507235540000, - null - ], - [ - 1507235550000, - null - ], - [ - 1507235560000, - null - ], - [ - 1507235570000, - null - ], - [ - 1507235580000, - null - ], - [ - 1507235590000, - null - ], - [ - 1507235600000, - null - ], - [ - 1507235610000, - null - ], - [ - 1507235620000, - null - ], - [ - 1507235630000, - null - ], - [ - 1507235640000, - null - ], - [ - 1507235650000, - null - ], - [ - 1507235660000, - null - ], - [ - 1507235670000, - null - ], - [ - 1507235680000, - null - ], - [ - 1507235690000, - null - ], - [ - 1507235700000, - null - ] - ] - } - ], - "node_cgroup_stats": [ - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.os.cgroup.cpu.stat.number_of_elapsed_periods", - "metricAgg": "max", - "label": "Cgroup Elapsed Periods", - "title": "Cgroup CFS Stats", - "description": "The number of sampling periods from the Completely Fair Scheduler (CFS). Compare against the number of times throttled.", - "units": "", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - null - ], - [ - 1507235540000, - null - ], - [ - 1507235550000, - null - ], - [ - 1507235560000, - null - ], - [ - 1507235570000, - null - ], - [ - 1507235580000, - null - ], - [ - 1507235590000, - null - ], - [ - 1507235600000, - null - ], - [ - 1507235610000, - null - ], - [ - 1507235620000, - null - ], - [ - 1507235630000, - null - ], - [ - 1507235640000, - null - ], - [ - 1507235650000, - null - ], - [ - 1507235660000, - null - ], - [ - 1507235670000, - null - ], - [ - 1507235680000, - null - ], - [ - 1507235690000, - null - ], - [ - 1507235700000, - null - ] - ] - }, - { - "bucket_size": "10 seconds", - "timeRange": { - "min": 1507235508000, - "max": 1507235712000 - }, - "metric": { - "app": "elasticsearch", - "field": "node_stats.os.cgroup.cpu.stat.number_of_times_throttled", - "metricAgg": "max", - "label": "Cgroup Throttled Count", - "title": "Cgroup CFS Stats", - "description": "The number of times that the CPU was throttled by the Cgroup.", - "units": "", - "format": "0,0.[00]", - "hasCalculation": false, - "isDerivative": true - }, - "data": [ - [ - 1507235520000, - null - ], - [ - 1507235530000, - null - ], - [ - 1507235540000, - null - ], - [ - 1507235550000, - null - ], - [ - 1507235560000, - null - ], - [ - 1507235570000, - null - ], - [ - 1507235580000, - null - ], - [ - 1507235590000, - null - ], - [ - 1507235600000, - null - ], - [ - 1507235610000, - null - ], - [ - 1507235620000, - null - ], - [ - 1507235630000, - null - ], - [ - 1507235640000, - null - ], - [ - 1507235650000, - null - ], - [ - 1507235660000, - null - ], - [ - 1507235670000, - null - ], - [ - 1507235680000, - null - ], - [ - 1507235690000, - null - ], - [ - 1507235700000, - null - ] - ] - } - ] + "node_jvm_mem": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.jvm.mem.heap_max_in_bytes", + "metricAgg": "max", + "label": "Max Heap", + "title": "JVM Heap", + "description": "Total heap available to Elasticsearch running in the JVM.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 709623808], + [1507235530000, 709623808], + [1507235540000, 709623808], + [1507235550000, 709623808], + [1507235560000, 709623808], + [1507235570000, 709623808], + [1507235580000, 709623808], + [1507235590000, 709623808], + [1507235600000, 709623808], + [1507235610000, 709623808], + [1507235620000, 709623808], + [1507235630000, 709623808], + [1507235640000, 709623808], + [1507235650000, 709623808], + [1507235660000, 709623808], + [1507235670000, 709623808], + [1507235680000, 709623808], + [1507235690000, 709623808], + [1507235700000, 709623808] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.jvm.mem.heap_used_in_bytes", + "metricAgg": "max", + "label": "Used Heap", + "title": "JVM Heap", + "description": "Total heap used by Elasticsearch running in the JVM.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 317052776], + [1507235530000, 344014976], + [1507235540000, 368593248], + [1507235550000, 253850400], + [1507235560000, 348095032], + [1507235570000, 182919712], + [1507235580000, 212395016], + [1507235590000, 244004144], + [1507235600000, 270412240], + [1507235610000, 245052864], + [1507235620000, 370270616], + [1507235630000, 196944168], + [1507235640000, 223491760], + [1507235650000, 253878472], + [1507235660000, 280811736], + [1507235670000, 371931976], + [1507235680000, 329874616], + [1507235690000, 363869776], + [1507235700000, 211045968] + ] + }], + "node_gc": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.jvm.gc.collectors.old.collection_count", + "metricAgg": "max", + "label": "Old", + "title": "GC Count", + "description": "Number of old Garbage Collections.", + "units": "", + "format": "0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.jvm.gc.collectors.young.collection_count", + "metricAgg": "max", + "label": "Young", + "title": "GC Count", + "description": "Number of young Garbage Collections.", + "units": "", + "format": "0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0.1], + [1507235560000, 0], + [1507235570000, 0.1], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0.1], + [1507235620000, 0], + [1507235630000, 0.1], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0.1], + [1507235690000, 0], + [1507235700000, 0.1] + ] + }], + "node_gc_time": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.jvm.gc.collectors.old.collection_time_in_millis", + "metricAgg": "max", + "label": "Old", + "title": "GC Duration", + "description": "Time spent performing old Garbage Collections.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.jvm.gc.collectors.young.collection_time_in_millis", + "metricAgg": "max", + "label": "Young", + "title": "GC Duration", + "description": "Time spent performing young Garbage Collections.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 1.1], + [1507235560000, 0], + [1507235570000, 1.2], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 1], + [1507235620000, 0], + [1507235630000, 1.1], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 2.9], + [1507235690000, 0], + [1507235700000, 2.1] + ] + }], + "node_index_1": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.memory_in_bytes", + "metricAgg": "max", + "label": "Lucene Total", + "title": "Index Memory - Lucene 1", + "description": "Total heap memory used by Lucene for current index. This is the sum of other fields for primary and replica shards on this node.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 4797457], + [1507235530000, 4797457], + [1507235540000, 4797457], + [1507235550000, 4797457], + [1507235560000, 4823580], + [1507235570000, 4823580], + [1507235580000, 4823580], + [1507235590000, 4823580], + [1507235600000, 4823580], + [1507235610000, 4838368], + [1507235620000, 4741420], + [1507235630000, 4741420], + [1507235640000, 4741420], + [1507235650000, 4741420], + [1507235660000, 4741420], + [1507235670000, 4757998], + [1507235680000, 4787542], + [1507235690000, 4787542], + [1507235700000, 4787542] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.stored_fields_memory_in_bytes", + "metricAgg": "max", + "label": "Stored Fields", + "title": "Index Memory", + "description": "Heap memory used by Stored Fields (e.g., _source). This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 56792], + [1507235530000, 56792], + [1507235540000, 56792], + [1507235550000, 56792], + [1507235560000, 57728], + [1507235570000, 57728], + [1507235580000, 57728], + [1507235590000, 57728], + [1507235600000, 57728], + [1507235610000, 58352], + [1507235620000, 56192], + [1507235630000, 56192], + [1507235640000, 56192], + [1507235650000, 56192], + [1507235660000, 56192], + [1507235670000, 56816], + [1507235680000, 57440], + [1507235690000, 57440], + [1507235700000, 57440] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.doc_values_memory_in_bytes", + "metricAgg": "max", + "label": "Doc Values", + "title": "Index Memory", + "description": "Heap memory used by Doc Values. This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 516824], + [1507235530000, 516824], + [1507235540000, 516824], + [1507235550000, 516824], + [1507235560000, 517292], + [1507235570000, 517292], + [1507235580000, 517292], + [1507235590000, 517292], + [1507235600000, 517292], + [1507235610000, 517612], + [1507235620000, 514808], + [1507235630000, 514808], + [1507235640000, 514808], + [1507235650000, 514808], + [1507235660000, 514808], + [1507235670000, 515312], + [1507235680000, 516008], + [1507235690000, 516008], + [1507235700000, 516008] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.norms_memory_in_bytes", + "metricAgg": "max", + "label": "Norms", + "title": "Index Memory", + "description": "Heap memory used by Norms (normalization factors for query-time, text scoring). This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 447232], + [1507235530000, 447232], + [1507235540000, 447232], + [1507235550000, 447232], + [1507235560000, 449600], + [1507235570000, 449600], + [1507235580000, 449600], + [1507235590000, 449600], + [1507235600000, 449600], + [1507235610000, 450880], + [1507235620000, 442304], + [1507235630000, 442304], + [1507235640000, 442304], + [1507235650000, 442304], + [1507235660000, 442304], + [1507235670000, 443840], + [1507235680000, 446400], + [1507235690000, 446400], + [1507235700000, 446400] + ] + }], + "node_index_2": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.memory_in_bytes", + "metricAgg": "max", + "label": "Lucene Total", + "title": "Index Memory - Lucene 2", + "description": "Total heap memory used by Lucene for current index. This is the sum of other fields for primary and replica shards on this node.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 4797457], + [1507235530000, 4797457], + [1507235540000, 4797457], + [1507235550000, 4797457], + [1507235560000, 4823580], + [1507235570000, 4823580], + [1507235580000, 4823580], + [1507235590000, 4823580], + [1507235600000, 4823580], + [1507235610000, 4838368], + [1507235620000, 4741420], + [1507235630000, 4741420], + [1507235640000, 4741420], + [1507235650000, 4741420], + [1507235660000, 4741420], + [1507235670000, 4757998], + [1507235680000, 4787542], + [1507235690000, 4787542], + [1507235700000, 4787542] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.terms_memory_in_bytes", + "metricAgg": "max", + "label": "Terms", + "title": "Index Memory", + "description": "Heap memory used by Terms (e.g., text). This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 3764438], + [1507235530000, 3764438], + [1507235540000, 3764438], + [1507235550000, 3764438], + [1507235560000, 3786762], + [1507235570000, 3786762], + [1507235580000, 3786762], + [1507235590000, 3786762], + [1507235600000, 3786762], + [1507235610000, 3799306], + [1507235620000, 3715996], + [1507235630000, 3715996], + [1507235640000, 3715996], + [1507235650000, 3715996], + [1507235660000, 3715996], + [1507235670000, 3729890], + [1507235680000, 3755528], + [1507235690000, 3755528], + [1507235700000, 3755528] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.points_memory_in_bytes", + "metricAgg": "max", + "label": "Points", + "title": "Index Memory", + "description": "Heap memory used by Points (e.g., numbers, IPs, and geo data). This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 12171], + [1507235530000, 12171], + [1507235540000, 12171], + [1507235550000, 12171], + [1507235560000, 12198], + [1507235570000, 12198], + [1507235580000, 12198], + [1507235590000, 12198], + [1507235600000, 12198], + [1507235610000, 12218], + [1507235620000, 12120], + [1507235630000, 12120], + [1507235640000, 12120], + [1507235650000, 12120], + [1507235660000, 12120], + [1507235670000, 12140], + [1507235680000, 12166], + [1507235690000, 12166], + [1507235700000, 12166] + ] + }], + "node_index_3": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.memory_in_bytes", + "metricAgg": "max", + "label": "Lucene Total", + "title": "Index Memory - Lucene 3", + "description": "Total heap memory used by Lucene for current index. This is the sum of other fields for primary and replica shards on this node.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 4797457], + [1507235530000, 4797457], + [1507235540000, 4797457], + [1507235550000, 4797457], + [1507235560000, 4823580], + [1507235570000, 4823580], + [1507235580000, 4823580], + [1507235590000, 4823580], + [1507235600000, 4823580], + [1507235610000, 4838368], + [1507235620000, 4741420], + [1507235630000, 4741420], + [1507235640000, 4741420], + [1507235650000, 4741420], + [1507235660000, 4741420], + [1507235670000, 4757998], + [1507235680000, 4787542], + [1507235690000, 4787542], + [1507235700000, 4787542] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.fixed_bit_set_memory_in_bytes", + "metricAgg": "max", + "label": "Fixed Bitsets", + "title": "Index Memory", + "description": "Heap memory used by Fixed Bit Sets (e.g., deeply nested documents). This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 4024], + [1507235530000, 4024], + [1507235540000, 4024], + [1507235550000, 4024], + [1507235560000, 4120], + [1507235570000, 4120], + [1507235580000, 4120], + [1507235590000, 4120], + [1507235600000, 4120], + [1507235610000, 4168], + [1507235620000, 3832], + [1507235630000, 3832], + [1507235640000, 3832], + [1507235650000, 3832], + [1507235660000, 3832], + [1507235670000, 3880], + [1507235680000, 3976], + [1507235690000, 3976], + [1507235700000, 3976] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.term_vectors_memory_in_bytes", + "metricAgg": "max", + "label": "Term Vectors", + "title": "Index Memory", + "description": "Heap memory used by Term Vectors. This is a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 0], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.version_map_memory_in_bytes", + "metricAgg": "max", + "label": "Version Map", + "title": "Index Memory", + "description": "Heap memory used by Versioning (e.g., updates and deletes). This is NOT a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 5551], + [1507235530000, 5551], + [1507235540000, 5551], + [1507235550000, 6594], + [1507235560000, 6662], + [1507235570000, 6662], + [1507235580000, 6662], + [1507235590000, 6662], + [1507235600000, 6662], + [1507235610000, 7531], + [1507235620000, 7837], + [1507235630000, 7837], + [1507235640000, 7837], + [1507235650000, 7837], + [1507235660000, 7837], + [1507235670000, 9974], + [1507235680000, 9716], + [1507235690000, 9716], + [1507235700000, 9716] + ] + }], + "node_index_4": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.query_cache.memory_size_in_bytes", + "metricAgg": "max", + "label": "Query Cache", + "title": "Index Memory - Elasticsearch", + "description": "Heap memory used by Query Cache (e.g., cached filters). This is for the same shards, but not a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 0], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.request_cache.memory_size_in_bytes", + "metricAgg": "max", + "label": "Request Cache", + "title": "Index Memory", + "description": "Heap memory used by Request Cache (e.g., instant aggregations). This is for the same shards, but not a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 2921], + [1507235530000, 2921], + [1507235540000, 2921], + [1507235550000, 2921], + [1507235560000, 2921], + [1507235570000, 2921], + [1507235580000, 2921], + [1507235590000, 2921], + [1507235600000, 2921], + [1507235610000, 2921], + [1507235620000, 2921], + [1507235630000, 2921], + [1507235640000, 2921], + [1507235650000, 2921], + [1507235660000, 2921], + [1507235670000, 2921], + [1507235680000, 2921], + [1507235690000, 2921], + [1507235700000, 2921] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.fielddata.memory_size_in_bytes", + "metricAgg": "max", + "label": "Fielddata", + "title": "Index Memory", + "description": "Heap memory used by Fielddata (e.g., global ordinals or explicitly enabled fielddata on text fields). This is for the same shards, but not a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 0], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.segments.index_writer_memory_in_bytes", + "metricAgg": "max", + "label": "Index Writer", + "title": "Index Memory", + "description": "Heap memory used by the Index Writer. This is NOT a part of Lucene Total.", + "units": "B", + "format": "0.0 b", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 153549], + [1507235530000, 153549], + [1507235540000, 153549], + [1507235550000, 849833], + [1507235560000, 156505], + [1507235570000, 156505], + [1507235580000, 156505], + [1507235590000, 156505], + [1507235600000, 156505], + [1507235610000, 3140275], + [1507235620000, 159637], + [1507235630000, 159637], + [1507235640000, 159637], + [1507235650000, 159637], + [1507235660000, 159637], + [1507235670000, 3737997], + [1507235680000, 164351], + [1507235690000, 164351], + [1507235700000, 164351] + ] + }], + "node_request_total": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.search.query_total", + "metricAgg": "max", + "label": "Search Total", + "title": "Request Rate", + "description": "Amount of search operations (per shard).", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0.3], + [1507235540000, 0.3], + [1507235550000, 0.3], + [1507235560000, 0.3], + [1507235570000, 0.3], + [1507235580000, 0.3], + [1507235590000, 0.4], + [1507235600000, 0.3], + [1507235610000, 0.5], + [1507235620000, 0.3], + [1507235630000, 0.3], + [1507235640000, 0.2], + [1507235650000, 0.3], + [1507235660000, 0.3], + [1507235670000, 0.5], + [1507235680000, 0.5], + [1507235690000, 0.1], + [1507235700000, 0.4] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.indexing.index_total", + "metricAgg": "max", + "label": "Indexing Total", + "title": "Request Rate", + "description": "Amount of indexing operations.", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0.9], + [1507235560000, 0.6], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0.9], + [1507235620000, 0.6], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 1.8], + [1507235680000, 0.8], + [1507235690000, 0], + [1507235700000, 0] + ] + }], + "node_index_time": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.indexing.index_time_in_millis", + "metricAgg": "max", + "label": "Index Time", + "title": "Indexing Time", + "description": "Amount of time spent on indexing operations.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0.8], + [1507235560000, 0.7], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 1.2], + [1507235620000, 0.7], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 4.2], + [1507235680000, 2.3], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.indexing.throttle_time_in_millis", + "metricAgg": "max", + "label": "Index Throttling Time", + "title": "Indexing Time", + "description": "Amount of time spent with index throttling, which indicates slow disks on a node.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }], + "node_index_threads": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.thread_pool.write.queue", + "metricAgg": "max", + "label": "Write Queue", + "title": "Indexing Threads", + "description": "Number of index, bulk, and write operations in the queue. The bulk threadpool was renamed to write in 6.3, and the index threadpool is deprecated.", + "units": "", + "format": "0.[00]", + "hasCalculation": true, + "isDerivative": false + }, + "data": [ + [1507235520000, 0], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.thread_pool.write.rejected", + "metricAgg": "max", + "label": "Write Rejections", + "title": "Indexing Threads", + "description": "Number of index, bulk, and write operations that have been rejected, which occurs when the queue is full. The bulk threadpool was renamed to write in 6.3, and the index threadpool is deprecated.", + "units": "", + "format": "0.[00]", + "hasCalculation": true, + "isDerivative": false + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }], + "node_read_threads": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.thread_pool.search.queue", + "metricAgg": "max", + "label": "Search Queue", + "title": "Read Threads", + "description": "Number of search operations in the queue (e.g., shard level searches).", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0.2], + [1507235680000, null], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.thread_pool.search.rejected", + "metricAgg": "max", + "label": "Search Rejections", + "title": "Read Threads", + "description": "Number of search operations that have been rejected, which occurs when the queue is full.", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.thread_pool.get.queue", + "metricAgg": "max", + "label": "GET Queue", + "title": "Read Threads", + "description": "Number of GET operations in the queue.", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.thread_pool.get.rejected", + "metricAgg": "max", + "label": "GET Rejections", + "title": "Read Threads", + "description": "Number of GET operations that have been rejected, which occurs when the queue is full.", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0], + [1507235560000, 0], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }], + "node_cpu_utilization": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.process.cpu.percent", + "metricAgg": "max", + "label": "CPU Utilization", + "description": "Percentage of CPU usage for the Elasticsearch process.", + "units": "%", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": false + }, + "data": [ + [1507235520000, 1], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 1], + [1507235560000, 2], + [1507235570000, 0], + [1507235580000, 2], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 3], + [1507235620000, 2], + [1507235630000, 2], + [1507235640000, 0], + [1507235650000, 1], + [1507235660000, 0], + [1507235670000, 2], + [1507235680000, 2], + [1507235690000, 1], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.process.cpu.percent", + "metricAgg": "max", + "label": "Cgroup CPU Utilization", + "title": "CPU Utilization", + "description": "CPU Usage time compared to the CPU quota shown in percentage. If CPU quotas are not set, then no data will be shown.", + "units": "%", + "format": "0,0.[00]", + "hasCalculation": true, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, null], + [1507235540000, null], + [1507235550000, null], + [1507235560000, null], + [1507235570000, null], + [1507235580000, null], + [1507235590000, null], + [1507235600000, null], + [1507235610000, null], + [1507235620000, null], + [1507235630000, null], + [1507235640000, null], + [1507235650000, null], + [1507235660000, null], + [1507235670000, null], + [1507235680000, null], + [1507235690000, null], + [1507235700000, null] + ] + }], + "node_cgroup_cpu": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.os.cgroup.cpuacct.usage_nanos", + "metricAgg": "max", + "label": "Cgroup Usage", + "title": "Cgroup CPU Performance", + "description": "The usage, reported in nanoseconds, of the Cgroup. Compare this with the throttling to discover issues.", + "units": "ns", + "format": "0,0.[0]a", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, null], + [1507235540000, null], + [1507235550000, null], + [1507235560000, null], + [1507235570000, null], + [1507235580000, null], + [1507235590000, null], + [1507235600000, null], + [1507235610000, null], + [1507235620000, null], + [1507235630000, null], + [1507235640000, null], + [1507235650000, null], + [1507235660000, null], + [1507235670000, null], + [1507235680000, null], + [1507235690000, null], + [1507235700000, null] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.os.cgroup.cpu.stat.time_throttled_nanos", + "metricAgg": "max", + "label": "Cgroup Throttling", + "title": "Cgroup CPU Performance", + "description": "The amount of throttled time, reported in nanoseconds, of the Cgroup.", + "units": "ns", + "format": "0,0.[0]a", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, null], + [1507235540000, null], + [1507235550000, null], + [1507235560000, null], + [1507235570000, null], + [1507235580000, null], + [1507235590000, null], + [1507235600000, null], + [1507235610000, null], + [1507235620000, null], + [1507235630000, null], + [1507235640000, null], + [1507235650000, null], + [1507235660000, null], + [1507235670000, null], + [1507235680000, null], + [1507235690000, null], + [1507235700000, null] + ] + }], + "node_cgroup_stats": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.os.cgroup.cpu.stat.number_of_elapsed_periods", + "metricAgg": "max", + "label": "Cgroup Elapsed Periods", + "title": "Cgroup CFS Stats", + "description": "The number of sampling periods from the Completely Fair Scheduler (CFS). Compare against the number of times throttled.", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, null], + [1507235540000, null], + [1507235550000, null], + [1507235560000, null], + [1507235570000, null], + [1507235580000, null], + [1507235590000, null], + [1507235600000, null], + [1507235610000, null], + [1507235620000, null], + [1507235630000, null], + [1507235640000, null], + [1507235650000, null], + [1507235660000, null], + [1507235670000, null], + [1507235680000, null], + [1507235690000, null], + [1507235700000, null] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.os.cgroup.cpu.stat.number_of_times_throttled", + "metricAgg": "max", + "label": "Cgroup Throttled Count", + "title": "Cgroup CFS Stats", + "description": "The number of times that the CPU was throttled by the Cgroup.", + "units": "", + "format": "0,0.[00]", + "hasCalculation": false, + "isDerivative": true + }, + "data": [ + [1507235520000, null], + [1507235530000, null], + [1507235540000, null], + [1507235550000, null], + [1507235560000, null], + [1507235570000, null], + [1507235580000, null], + [1507235590000, null], + [1507235600000, null], + [1507235610000, null], + [1507235620000, null], + [1507235630000, null], + [1507235640000, null], + [1507235650000, null], + [1507235660000, null], + [1507235670000, null], + [1507235680000, null], + [1507235690000, null], + [1507235700000, null] + ] + }], + "node_latency": [{ + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.search.query_total", + "metricAgg": "sum", + "label": "Search", + "title": "Latency", + "description": "Average latency for searching, which is time it takes to execute searches divided by number of searches submitted. This considers primary and replica shards.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": true, + "isDerivative": false + }, + "data": [ + [1507235520000, null], + [1507235530000, 0.33333333333333337], + [1507235540000, 0], + [1507235550000, 0.33333333333333337], + [1507235560000, 0], + [1507235570000, 0.33333333333333337], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0.33333333333333337], + [1507235610000, 0], + [1507235620000, 0], + [1507235630000, 0.33333333333333337], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 0.2], + [1507235680000, 0], + [1507235690000, 0], + [1507235700000, 0] + ] + }, { + "bucket_size": "10 seconds", + "timeRange": { + "min": 1507235508000, + "max": 1507235712000 + }, + "metric": { + "app": "elasticsearch", + "field": "node_stats.indices.indexing.index_total", + "metricAgg": "sum", + "label": "Indexing", + "title": "Latency", + "description": "Average latency for indexing documents, which is time it takes to index documents divided by number that were indexed. This considers any shard located on this node, including replicas.", + "units": "ms", + "format": "0,0.[00]", + "hasCalculation": true, + "isDerivative": false + }, + "data": [ + [1507235520000, null], + [1507235530000, 0], + [1507235540000, 0], + [1507235550000, 0.888888888888889], + [1507235560000, 1.1666666666666667], + [1507235570000, 0], + [1507235580000, 0], + [1507235590000, 0], + [1507235600000, 0], + [1507235610000, 1.3333333333333333], + [1507235620000, 1.1666666666666667], + [1507235630000, 0], + [1507235640000, 0], + [1507235650000, 0], + [1507235660000, 0], + [1507235670000, 2.3333333333333335], + [1507235680000, 2.8749999999999996], + [1507235690000, 0], + [1507235700000, 0] + ] + }] } }