diff --git a/x-pack/plugins/apm/common/utils/formatters/duration.ts b/x-pack/plugins/apm/common/utils/formatters/duration.ts
index 34972ee558875..5b20b2e1827a1 100644
--- a/x-pack/plugins/apm/common/utils/formatters/duration.ts
+++ b/x-pack/plugins/apm/common/utils/formatters/duration.ts
@@ -13,8 +13,6 @@ import { asDecimalOrInteger, asInteger, asDecimal } from './formatters';
import { TimeUnit } from './datetime';
import { Maybe } from '../../../typings/common';
import { isFiniteNumber } from '../is_finite_number';
-// eslint-disable-next-line @kbn/eslint/no-restricted-paths
-import type { ThroughputUnit } from '../../../server/lib/helpers/calculate_throughput';
interface FormatterOptions {
defaultValue?: string;
diff --git a/x-pack/plugins/apm/public/services/rest/apm_observability_overview_fetchers.test.ts b/x-pack/plugins/apm/public/services/rest/apm_observability_overview_fetchers.test.ts
index 00447607cf787..c6513aa24df6b 100644
--- a/x-pack/plugins/apm/public/services/rest/apm_observability_overview_fetchers.test.ts
+++ b/x-pack/plugins/apm/public/services/rest/apm_observability_overview_fetchers.test.ts
@@ -23,7 +23,8 @@ describe('Observability dashboard data', () => {
start: 'now-15m',
end: 'now',
},
- bucketSize: '600s',
+ intervalString: '600s',
+ bucketSize: 600,
};
afterEach(() => {
callApmApiMock.mockClear();
diff --git a/x-pack/plugins/apm/server/routes/services.ts b/x-pack/plugins/apm/server/routes/services.ts
index 523060da2a0ff..c19f8e7206232 100644
--- a/x-pack/plugins/apm/server/routes/services.ts
+++ b/x-pack/plugins/apm/server/routes/services.ts
@@ -12,7 +12,6 @@ import { uniq } from 'lodash';
import { latencyAggregationTypeRt } from '../../common/latency_aggregation_types';
import { ProfilingValueType } from '../../common/profiling';
import { getSearchAggregatedTransactions } from '../lib/helpers/aggregated_transactions';
-import { getThroughputUnit } from '../lib/helpers/calculate_throughput';
import { setupRequest } from '../lib/helpers/setup_request';
import { getServiceAnnotations } from '../lib/services/annotations';
import { getServices } from '../lib/services/get_services';
diff --git a/x-pack/plugins/infra/public/metrics_overview_fetchers.test.ts b/x-pack/plugins/infra/public/metrics_overview_fetchers.test.ts
index e6ffbc30fe24d..51739562a042e 100644
--- a/x-pack/plugins/infra/public/metrics_overview_fetchers.test.ts
+++ b/x-pack/plugins/infra/public/metrics_overview_fetchers.test.ts
@@ -56,7 +56,8 @@ describe('Metrics UI Observability Homepage Functions', () => {
const fetchData = createMetricsFetchData(mockedGetStartServices);
const endTime = moment('2020-07-02T13:25:11.629Z');
const startTime = endTime.clone().subtract(1, 'h');
- const bucketSize = '300s';
+ const bucketSize = 300;
+ const intervalString = '300s';
const response = await fetchData({
absoluteTime: {
start: startTime.valueOf(),
@@ -67,6 +68,7 @@ describe('Metrics UI Observability Homepage Functions', () => {
end: 'now',
},
bucketSize,
+ intervalString,
});
expect(core.http.post).toHaveBeenCalledTimes(1);
expect(core.http.post).toHaveBeenCalledWith('/api/metrics/overview/top', {
diff --git a/x-pack/plugins/infra/public/utils/logs_overview_fetches.test.ts b/x-pack/plugins/infra/public/utils/logs_overview_fetches.test.ts
index 6dfb400567717..467443faacd42 100644
--- a/x-pack/plugins/infra/public/utils/logs_overview_fetches.test.ts
+++ b/x-pack/plugins/infra/public/utils/logs_overview_fetches.test.ts
@@ -29,7 +29,8 @@ const mockedCallFetchLogSourceConfigurationAPI =
const DEFAULT_PARAMS = {
absoluteTime: { start: 1593430680000, end: 1593430800000 },
relativeTime: { start: 'now-2m', end: 'now' }, // Doesn't matter for the test
- bucketSize: '30s', // Doesn't matter for the test
+ intervalString: '30s', // Doesn't matter for the test
+ bucketSize: 30, // Doesn't matter for the test
};
function setup() {
diff --git a/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx b/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx
index 8b1480246210a..c9c2ed549a1c3 100644
--- a/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx
+++ b/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx
@@ -78,7 +78,9 @@ describe('APMSection', () => {
status: fetcherHook.FETCH_STATUS.SUCCESS,
refetch: jest.fn(),
});
- const { getByText, queryAllByTestId } = render();
+ const { getByText, queryAllByTestId } = render(
+
+ );
expect(getByText('APM')).toBeInTheDocument();
expect(getByText('View in app')).toBeInTheDocument();
@@ -93,7 +95,9 @@ describe('APMSection', () => {
status: fetcherHook.FETCH_STATUS.SUCCESS,
refetch: jest.fn(),
});
- const { getByText, queryAllByTestId } = render();
+ const { getByText, queryAllByTestId } = render(
+
+ );
expect(getByText('APM')).toBeInTheDocument();
expect(getByText('View in app')).toBeInTheDocument();
@@ -107,7 +111,9 @@ describe('APMSection', () => {
status: fetcherHook.FETCH_STATUS.LOADING,
refetch: jest.fn(),
});
- const { getByText, queryAllByText, getByTestId } = render();
+ const { getByText, queryAllByText, getByTestId } = render(
+
+ );
expect(getByText('APM')).toBeInTheDocument();
expect(getByTestId('loading')).toBeInTheDocument();
diff --git a/x-pack/plugins/observability/public/components/app/section/ux/index.test.tsx b/x-pack/plugins/observability/public/components/app/section/ux/index.test.tsx
index 19bc20f5da605..8a99b6a53cf06 100644
--- a/x-pack/plugins/observability/public/components/app/section/ux/index.test.tsx
+++ b/x-pack/plugins/observability/public/components/app/section/ux/index.test.tsx
@@ -67,7 +67,9 @@ describe('UXSection', () => {
status: fetcherHook.FETCH_STATUS.SUCCESS,
refetch: jest.fn(),
});
- const { getByText, getAllByText } = render();
+ const { getByText, getAllByText } = render(
+
+ );
expect(getByText('User Experience')).toBeInTheDocument();
expect(getByText('View in app')).toBeInTheDocument();
@@ -99,7 +101,9 @@ describe('UXSection', () => {
status: fetcherHook.FETCH_STATUS.LOADING,
refetch: jest.fn(),
});
- const { getByText, queryAllByText, getAllByText } = render();
+ const { getByText, queryAllByText, getAllByText } = render(
+
+ );
expect(getByText('User Experience')).toBeInTheDocument();
expect(getAllByText('--')).toHaveLength(3);
@@ -112,7 +116,9 @@ describe('UXSection', () => {
status: fetcherHook.FETCH_STATUS.SUCCESS,
refetch: jest.fn(),
});
- const { getByText, queryAllByText, getAllByText } = render();
+ const { getByText, queryAllByText, getAllByText } = render(
+
+ );
expect(getByText('User Experience')).toBeInTheDocument();
expect(getAllByText('No data is available.')).toHaveLength(3);
diff --git a/x-pack/plugins/observability/public/data_handler.test.ts b/x-pack/plugins/observability/public/data_handler.test.ts
index e0b8494d4dbed..fab21a54882b0 100644
--- a/x-pack/plugins/observability/public/data_handler.test.ts
+++ b/x-pack/plugins/observability/public/data_handler.test.ts
@@ -23,7 +23,8 @@ const params = {
start: 'now-15m',
end: 'now',
},
- bucketSize: '10s',
+ intervalString: '10s',
+ bucketSize: 10,
};
describe('registerDataHandler', () => {
diff --git a/x-pack/test/apm_api_integration/tests/services/throughput.ts b/x-pack/test/apm_api_integration/tests/services/throughput.ts
index 631715f99b743..4533f347f0ada 100644
--- a/x-pack/test/apm_api_integration/tests/services/throughput.ts
+++ b/x-pack/test/apm_api_integration/tests/services/throughput.ts
@@ -119,10 +119,6 @@ export default function ApiTest({ getService }: FtrProviderContext) {
body = await callApi();
});
- it('returns the throughput in seconds', () => {
- expect(body.throughputUnit).to.eql('second');
- });
-
it('returns the expected throughput', () => {
const throughputValues = uniq(body.currentPeriod.map((coord) => coord.y));
expect(throughputValues).to.eql([GO_PROD_RATE]);
@@ -141,7 +137,6 @@ export default function ApiTest({ getService }: FtrProviderContext) {
it('returns data for all environments', () => {
const throughputValues = body.currentPeriod.map(({ y }) => y);
expect(uniq(throughputValues)).to.eql([GO_PROD_RATE + GO_DEV_RATE]);
- expect(body.throughputUnit).to.eql('second');
});
});
@@ -158,7 +153,6 @@ export default function ApiTest({ getService }: FtrProviderContext) {
it('returns data that matches the kuery', () => {
const throughputValues = body.currentPeriod.map(({ y }) => y);
expect(uniq(throughputValues)).to.eql([GO_DEV_RATE]);
- expect(body.throughputUnit).to.eql('second');
});
});
}