Skip to content

Commit

Permalink
Merge branch 'master' into ts-project-refs-es_ui/snapshot_restore
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Feb 1, 2021
2 parents 0c4a28f + 2498f57 commit 2356b7e
Show file tree
Hide file tree
Showing 53 changed files with 485 additions and 278 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/core/public/chrome/ui/header/collapsible_nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export function CollapsibleNav({
label: 'Home',
iconType: 'home',
href: homeHref,
'data-test-subj': 'homeLink',
onClick: (event) => {
if (isModifiedOrPrevented(event)) {
return;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const AddData: FC<Props> = ({ addBasePath, features }) => {
<EuiFlexItem className="homDataAdd__actions" grow={false}>
<div>
<EuiButtonEmpty
data-test-subj="addSampleData"
className="homDataAdd__actionButton"
flush="left"
href="#/tutorial_directory/sampleData"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class TutorialDirectoryUi extends React.Component {
// Add card for sample data that only gets show in "all" tab
tutorialCards.push({
id: 'sample_data',

name: this.props.intl.formatMessage({
id: 'home.tutorial.card.sampleDataTitle',
defaultMessage: 'Sample Data',
Expand Down Expand Up @@ -178,6 +179,7 @@ class TutorialDirectoryUi extends React.Component {
renderTabs = () => {
return this.tabs.map((tab, index) => (
<EuiTab
data-test-subj={`homeTab-${tab.id}`}
onClick={() => this.onSelectedTabChanged(tab.id)}
isSelected={tab.id === this.state.selectedTabId}
key={index}
Expand All @@ -203,7 +205,7 @@ class TutorialDirectoryUi extends React.Component {
})
.map((tutorial) => {
return (
<EuiFlexItem key={tutorial.name}>
<EuiFlexItem data-test-subj={`homeTab-${tutorial.name}`} key={tutorial.name}>
<Synopsis
id={tutorial.id}
iconType={tutorial.icon}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const OverviewPageHeader: FC<Props> = ({
<EuiFlexItem className="kbnOverviewPageHeader__actionItem" grow={false}>
<RedirectAppLinks application={application}>
<EuiButtonEmpty
data-test-subj="homeAddData"
className="kbnOverviewPageHeader__actionButton"
flush="both"
href={addBasePath('/app/home#/tutorial_directory')}
Expand All @@ -96,6 +97,7 @@ export const OverviewPageHeader: FC<Props> = ({
<EuiFlexItem className="kbnOverviewPageHeader__actionItem" grow={false}>
<RedirectAppLinks application={application}>
<EuiButtonEmpty
data-test-subj="homeManage"
className="kbnOverviewPageHeader__actionButton"
flush="both"
iconType="gear"
Expand All @@ -116,6 +118,7 @@ export const OverviewPageHeader: FC<Props> = ({
<EuiFlexItem className="kbnOverviewPageHeader__actionItem" grow={false}>
<RedirectAppLinks application={application}>
<EuiButtonEmpty
data-test-subj="homeDevTools"
className="kbnOverviewPageHeader__actionButton"
flush="both"
iconType="wrench"
Expand Down
13 changes: 11 additions & 2 deletions test/scripts/jenkins_build_load_testing.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/usr/bin/env bash

while getopts s: flag
do
case "${flag}" in
s) simulations=${OPTARG};;
esac
done
echo "Simulation classes: $simulations";

cd "$KIBANA_DIR"
source src/dev/ci_setup/setup_env.sh

Expand All @@ -25,6 +33,7 @@ echo " -> test setup"
source test/scripts/jenkins_test_setup_xpack.sh

echo " -> run gatling load testing"
export GATLING_SIMULATIONS="$simulations"
node scripts/functional_tests \
--kibana-install-dir "$KIBANA_INSTALL_DIR" \
--config test/load/config.ts
--kibana-install-dir "$KIBANA_INSTALL_DIR" \
--config test/load/config.ts

This file was deleted.

1 change: 0 additions & 1 deletion x-pack/plugins/apm/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ export const plugin: PluginInitializer<ApmPluginSetup, ApmPluginStart> = (
) => new ApmPlugin(pluginInitializerContext);

export { ApmPluginSetup, ApmPluginStart };
export { getTraceUrl } from './components/shared/Links/apm/ExternalLinks';
16 changes: 16 additions & 0 deletions x-pack/plugins/apm/server/lib/helpers/calculate_throughput.ts
Original file line number Diff line number Diff line change
@@ -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 { SetupTimeRange } from './setup_request';

export function calculateThroughput({
start,
end,
value,
}: SetupTimeRange & { value: number }) {
const durationAsMinutes = (end - start) / 1000 / 60;
return value / durationAsMinutes;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { rangeFilter } from '../../../common/utils/range_filter';
import { Coordinates } from '../../../../observability/typings/common';
import { Setup, SetupTimeRange } from '../helpers/setup_request';
import { getProcessorEventForAggregatedTransactions } from '../helpers/aggregated_transactions';
import { calculateThroughput } from '../helpers/calculate_throughput';

export async function getTransactionCoordinates({
setup,
Expand Down Expand Up @@ -51,12 +52,10 @@ export async function getTransactionCoordinates({
},
});

const deltaAsMinutes = (end - start) / 1000 / 60;

return (
aggregations?.distribution.buckets.map((bucket) => ({
x: bucket.key,
y: bucket.doc_count / deltaAsMinutes,
y: calculateThroughput({ start, end, value: bucket.doc_count }),
})) || []
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { joinByKey } from '../../../../common/utils/join_by_key';
import { Setup, SetupTimeRange } from '../../helpers/setup_request';
import { getMetrics } from './get_metrics';
import { getDestinationMap } from './get_destination_map';
import { calculateThroughput } from '../../helpers/calculate_throughput';

export type ServiceDependencyItem = {
name: string;
Expand Down Expand Up @@ -51,7 +52,6 @@ export async function getServiceDependencies({
numBuckets: number;
}): Promise<ServiceDependencyItem[]> {
const { start, end } = setup;

const [allMetrics, destinationMap] = await Promise.all([
getMetrics({
setup,
Expand Down Expand Up @@ -134,8 +134,6 @@ export async function getServiceDependencies({
}
);

const deltaAsMinutes = (end - start) / 60 / 1000;

const destMetrics = {
latency: {
value:
Expand All @@ -150,11 +148,18 @@ export async function getServiceDependencies({
throughput: {
value:
mergedMetrics.value.count > 0
? mergedMetrics.value.count / deltaAsMinutes
? calculateThroughput({
start,
end,
value: mergedMetrics.value.count,
})
: null,
timeseries: mergedMetrics.timeseries.map((point) => ({
x: point.x,
y: point.count > 0 ? point.count / deltaAsMinutes : null,
y:
point.count > 0
? calculateThroughput({ start, end, value: point.count })
: null,
})),
},
errorRate: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
getProcessorEventForAggregatedTransactions,
getTransactionDurationFieldForAggregatedTransactions,
} from '../../helpers/aggregated_transactions';
import { calculateThroughput } from '../../helpers/calculate_throughput';

export async function getServiceInstanceTransactionStats({
setup,
Expand Down Expand Up @@ -104,7 +105,6 @@ export async function getServiceInstanceTransactionStats({
},
});

const deltaAsMinutes = (end - start) / 60 / 1000;
const bucketSizeInMinutes = bucketSize / 60;

return (
Expand All @@ -128,7 +128,7 @@ export async function getServiceInstanceTransactionStats({
})),
},
throughput: {
value: count / deltaAsMinutes,
value: calculateThroughput({ start, end, value: count }),
timeseries: timeseries.buckets.map((dateBucket) => ({
x: dateBucket.key,
y: dateBucket.doc_count / bucketSizeInMinutes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
getLatencyAggregation,
getLatencyValue,
} from '../../helpers/latency_aggregation_type';
import { calculateThroughput } from '../../helpers/calculate_throughput';

export type ServiceOverviewTransactionGroupSortField =
| 'name'
Expand Down Expand Up @@ -64,8 +65,6 @@ export async function getTransactionGroupsForPage({
transactionType: string;
latencyAggregationType: LatencyAggregationType;
}) {
const deltaAsMinutes = (end - start) / 1000 / 60;

const field = getTransactionDurationFieldForAggregatedTransactions(
searchAggregatedTransactions
);
Expand Down Expand Up @@ -121,7 +120,11 @@ export async function getTransactionGroupsForPage({
latencyAggregationType,
aggregation: bucket.latency,
}),
throughput: bucket.doc_count / deltaAsMinutes,
throughput: calculateThroughput({
start,
end,
value: bucket.doc_count,
}),
errorRate,
};
}) ?? [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import { EVENT_OUTCOME } from '../../../../common/elasticsearch_fieldnames';
import { LatencyAggregationType } from '../../../../common/latency_aggregation_types';
import { calculateThroughput } from '../../helpers/calculate_throughput';
import { getLatencyValue } from '../../helpers/latency_aggregation_type';
import { TransactionGroupTimeseriesData } from './get_timeseries_data_for_transaction_groups';
import { TransactionGroupWithoutTimeseriesData } from './get_transaction_groups_for_page';
Expand All @@ -25,8 +26,6 @@ export function mergeTransactionGroupData({
latencyAggregationType: LatencyAggregationType;
transactionType: string;
}) {
const deltaAsMinutes = (end - start) / 1000 / 60;

return transactionGroups.map((transactionGroup) => {
const groupBucket = timeseriesData.find(
({ key }) => key === transactionGroup.name
Expand All @@ -52,7 +51,11 @@ export function mergeTransactionGroupData({
...acc.throughput,
timeseries: acc.throughput.timeseries.concat({
x: point.key,
y: point.doc_count / deltaAsMinutes,
y: calculateThroughput({
start,
end,
value: point.doc_count,
}),
}),
},
errorRate: {
Expand Down
Loading

0 comments on commit 2356b7e

Please sign in to comment.