Skip to content

Commit

Permalink
Merge branch '7.x' into ua/7.x/step-completion-state
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Sep 8, 2021
2 parents 3340c42 + 8978d1c commit 0e2dc7f
Show file tree
Hide file tree
Showing 107 changed files with 31,711 additions and 29,286 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('getStateDefaults', () => {
"default_column",
],
"filters": undefined,
"hideChart": undefined,
"index": "index-pattern-with-timefield-id",
"interval": "auto",
"query": undefined,
Expand Down Expand Up @@ -54,6 +55,7 @@ describe('getStateDefaults', () => {
"default_column",
],
"filters": undefined,
"hideChart": undefined,
"index": "the-index-pattern-id",
"interval": "auto",
"query": undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export function getStateDefaults({
index: indexPattern!.id,
interval: 'auto',
filters: cloneDeep(searchSource.getOwnField('filter')),
hideChart: undefined,
} as AppState;
if (savedSearch.grid) {
defaultState.grid = savedSearch.grid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ export default function ({ getService }) {
.then(ensureFieldsAreSorted);
});

// https://github.com/elastic/kibana/issues/79813
it.skip('always returns a field for all passed meta fields', async () => {
it('always returns a field for all passed meta fields', async () => {
await supertest
.get('/api/index_patterns/_fields_for_wildcard')
.query({
Expand All @@ -95,7 +94,7 @@ export default function ({ getService }) {
.expect(200, {
fields: [
{
aggregatable: true,
aggregatable: false,
name: '_id',
esTypes: ['_id'],
readFromDocValues: false,
Expand Down
11 changes: 9 additions & 2 deletions test/functional/apps/discover/_data_grid_doc_navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const defaultSettings = { defaultIndex: 'logstash-*', 'doc_table:legacy': false };

describe('discover data grid doc link', function () {
beforeEach(async function () {
before(async () => {
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover');
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
});

after(async () => {
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
});

beforeEach(async function () {
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
await kibanaServer.uiSettings.update(defaultSettings);
await PageObjects.common.navigateToApp('discover');
Expand Down
3 changes: 2 additions & 1 deletion test/functional/apps/discover/_doc_navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('doc link in discover', function contextSize() {
before(async () => {
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover');
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
await kibanaServer.uiSettings.update({
'doc_table:legacy': true,
'discover:searchFieldsFromSource': true,
});
});
after(async () => {
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
await kibanaServer.uiSettings.replace({});
});

Expand Down
7 changes: 6 additions & 1 deletion test/functional/apps/discover/_runtime_fields_editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('discover integration with runtime fields editor', function describeIndexTests() {
before(async function () {
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
await kibanaServer.uiSettings.replace(defaultSettings);
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
await PageObjects.common.navigateToApp('discover');
});

after(async () => {
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
await kibanaServer.savedObjects.clean({ types: ['saved-search'] });
});

it('allows adding custom label to existing fields', async function () {
const customLabel = 'megabytes';
await PageObjects.discover.editField('bytes');
Expand Down
6 changes: 5 additions & 1 deletion test/functional/apps/discover/_sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('discover sidebar', function describeIndexTests() {
before(async function () {
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover');
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
await kibanaServer.uiSettings.replace({
defaultIndex: 'logstash-*',
});
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
await PageObjects.common.navigateToApp('discover');
});

after(async () => {
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
});

describe('field filtering', function () {
it('should reveal and hide the filter form when the toggle is clicked', async function () {
await PageObjects.discover.openSidebarFieldFilter();
Expand Down
2 changes: 1 addition & 1 deletion test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export default async function ({ readConfigFile }) {
cluster: [],
indices: [
{
names: ['message_with_newline'],
names: ['newline-test'],
privileges: ['read', 'view_index_metadata'],
field_security: { grant: ['*'], except: [] },
},
Expand Down
14 changes: 14 additions & 0 deletions x-pack/plugins/apm/common/search_strategies/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export const APM_SEARCH_STRATEGIES = {
APM_FAILED_TRANSACTIONS_CORRELATIONS: 'apmFailedTransactionsCorrelations',
APM_LATENCY_CORRELATIONS: 'apmLatencyCorrelations',
} as const;
export type ApmSearchStrategies = typeof APM_SEARCH_STRATEGIES[keyof typeof APM_SEARCH_STRATEGIES];

export const DEFAULT_PERCENTILE_THRESHOLD = 95;
63 changes: 0 additions & 63 deletions x-pack/plugins/apm/common/search_strategies/correlations/types.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@

import { i18n } from '@kbn/i18n';

export const FAILED_TRANSACTIONS_CORRELATION_SEARCH_STRATEGY =
'apmFailedTransactionsCorrelationsSearchStrategy';

export const FAILED_TRANSACTIONS_IMPACT_THRESHOLD = {
HIGH: i18n.translate(
'xpack.apm.correlations.failedTransactions.highImpactText',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import {
FieldValuePair,
RawResponseBase,
SearchStrategyClientParams,
} from '../types';

import { FAILED_TRANSACTIONS_IMPACT_THRESHOLD } from './constants';

export interface FailedTransactionsCorrelation extends FieldValuePair {
doc_count: number;
bg_count: number;
score: number;
pValue: number | null;
normalizedScore: number;
failurePercentage: number;
successPercentage: number;
}

export type FailedTransactionsCorrelationsImpactThreshold = typeof FAILED_TRANSACTIONS_IMPACT_THRESHOLD[keyof typeof FAILED_TRANSACTIONS_IMPACT_THRESHOLD];

export type FailedTransactionsCorrelationsParams = SearchStrategyClientParams;

export interface FailedTransactionsCorrelationsRawResponse
extends RawResponseBase {
log: string[];
failedTransactionsCorrelations: FailedTransactionsCorrelation[];
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import {
FieldValuePair,
HistogramItem,
RawResponseBase,
SearchStrategyClientParams,
} from '../types';

export interface LatencyCorrelation extends FieldValuePair {
correlation: number;
histogram: HistogramItem[];
ksTest: number;
}

export interface LatencyCorrelationSearchServiceProgress {
started: number;
loadedHistogramStepsize: number;
loadedOverallHistogram: number;
loadedFieldCandidates: number;
loadedFieldValuePairs: number;
loadedHistograms: number;
}

export interface LatencyCorrelationsParams extends SearchStrategyClientParams {
percentileThreshold: number;
analyzeCorrelations: boolean;
}

export interface LatencyCorrelationsRawResponse extends RawResponseBase {
log: string[];
overallHistogram?: HistogramItem[];
percentileThresholdValue?: number;
latencyCorrelations?: LatencyCorrelation[];
}
50 changes: 50 additions & 0 deletions x-pack/plugins/apm/common/search_strategies/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export interface FieldValuePair {
fieldName: string;
// For dynamic fieldValues we only identify fields as `string`,
// but for example `http.response.status_code` which is part of
// of the list of predefined field candidates is of type long/number.
fieldValue: string | number;
}

export interface HistogramItem {
key: number;
doc_count: number;
}

export interface ResponseHitSource {
[s: string]: unknown;
}

export interface ResponseHit {
_source: ResponseHitSource;
}

export interface RawResponseBase {
ccsWarning: boolean;
took: number;
}

export interface SearchStrategyClientParams {
environment: string;
kuery: string;
serviceName?: string;
transactionName?: string;
transactionType?: string;
start?: string;
end?: string;
}

export interface SearchStrategyServerParams {
index: string;
includeFrozen?: boolean;
}

export type SearchStrategyParams = SearchStrategyClientParams &
SearchStrategyServerParams;
Loading

0 comments on commit 0e2dc7f

Please sign in to comment.