Skip to content

Commit

Permalink
[APM] Rename traceData to synthtraceEsClient (elastic#116215)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv authored Oct 26, 2021
1 parent de2ca18 commit 2dba0d1
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions x-pack/test/apm_api_integration/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { createApmUser, APM_TEST_PASSWORD, ApmUser } from './authentication';
import { APMFtrConfigName } from '../configs';
import { createApmApiClient } from './apm_api_supertest';
import { registry } from './registry';
import { traceData } from './trace_data';
import { synthtraceEsClient } from './synthtrace_es_client';

interface Config {
name: APMFtrConfigName;
Expand Down Expand Up @@ -77,7 +77,7 @@ export function createTestConfig(config: Config) {
servers,
services: {
...services,
traceData,
synthtraceEsClient,
apmApiClient: async (context: InheritedFtrProviderContext) => {
const security = context.getService('security');
await security.init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import pLimit from 'p-limit';
import { inspect } from 'util';
import { InheritedFtrProviderContext } from './ftr_provider_context';

export async function traceData(context: InheritedFtrProviderContext) {
export async function synthtraceEsClient(context: InheritedFtrProviderContext) {
const es = context.getService('es');
return {
index: (events: any[]) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { registry } from '../../common/registry';

export default function ApiTest({ getService }: FtrProviderContext) {
const apmApiClient = getService('apmApiClient');
const traceData = getService('traceData');
const synthtraceEsClient = getService('synthtraceEsClient');

const serviceName = 'synth-go';
const start = new Date('2021-01-01T00:00:00.000Z').getTime();
Expand Down Expand Up @@ -128,7 +128,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
const transactionNameProductList = 'GET /api/product/list';
const transactionNameProductId = 'GET /api/product/:id';

await traceData.index([
await synthtraceEsClient.index([
...timerange(start, end)
.interval('1m')
.rate(GO_PROD_LIST_RATE)
Expand Down Expand Up @@ -176,7 +176,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
]);
});

after(() => traceData.clean());
after(() => synthtraceEsClient.clean());

describe('compare error rate value between service inventory, error rate chart, service inventory and transactions apis', () => {
before(async () => {
Expand Down
6 changes: 3 additions & 3 deletions x-pack/test/apm_api_integration/tests/latency/service_apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { registry } from '../../common/registry';

export default function ApiTest({ getService }: FtrProviderContext) {
const apmApiClient = getService('apmApiClient');
const traceData = getService('traceData');
const synthtraceEsClient = getService('synthtraceEsClient');

const serviceName = 'synth-go';
const start = new Date('2021-01-01T00:00:00.000Z').getTime();
Expand Down Expand Up @@ -129,7 +129,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
const serviceGoDevInstance = service(serviceName, 'development', 'go').instance(
'instance-b'
);
await traceData.index([
await synthtraceEsClient.index([
...timerange(start, end)
.interval('1m')
.rate(GO_PROD_RATE)
Expand All @@ -153,7 +153,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
]);
});

after(() => traceData.clean());
after(() => synthtraceEsClient.clean());

describe('compare latency value between service inventory, latency chart, service inventory and transactions apis', () => {
before(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { roundNumber } from '../../utils';
export default function ApiTest({ getService }: FtrProviderContext) {
const apmApiClient = getService('apmApiClient');

const traceData = getService('traceData');
const synthtraceEsClient = getService('synthtraceEsClient');

const start = new Date('2021-01-01T00:00:00.000Z').getTime();
const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1;
Expand Down Expand Up @@ -99,7 +99,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
'instance-c'
);

await traceData.index([
await synthtraceEsClient.index([
...timerange(start, end)
.interval('1m')
.rate(GO_PROD_RATE)
Expand Down Expand Up @@ -133,7 +133,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
]);
});

after(() => traceData.clean());
after(() => synthtraceEsClient.clean());

describe('compare throughput values', () => {
let throughputValues: PromiseReturnType<typeof getThroughputValues>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { SERVICE_NODE_NAME_MISSING } from '../../../../plugins/apm/common/servic

export default function ApiTest({ getService }: FtrProviderContext) {
const apmApiClient = getService('apmApiClient');
const traceData = getService('traceData');
const synthtraceEsClient = getService('synthtraceEsClient');

const archiveName = 'apm_8.0.0';
const { start, end } = archives[archiveName];
Expand Down Expand Up @@ -320,7 +320,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
);
}

return traceData.index([
return synthtraceEsClient.index([
...interval.rate(GO_A_INSTANCE_RATE_SUCCESS).flatMap((timestamp) =>
goInstanceA
.transaction('GET /api/product/list')
Expand Down Expand Up @@ -361,7 +361,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
});

after(async () => {
return traceData.clean();
return synthtraceEsClient.clean();
});

describe('for the go service', () => {
Expand Down
6 changes: 3 additions & 3 deletions x-pack/test/apm_api_integration/tests/services/throughput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type ThroughputReturn = APIReturnType<'GET /internal/apm/services/{serviceName}/

export default function ApiTest({ getService }: FtrProviderContext) {
const apmApiClient = getService('apmApiClient');
const traceData = getService('traceData');
const synthtraceEsClient = getService('synthtraceEsClient');

const serviceName = 'synth-go';
const start = new Date('2021-01-01T00:00:00.000Z').getTime();
Expand Down Expand Up @@ -81,7 +81,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
'instance-c'
);

await traceData.index([
await synthtraceEsClient.index([
...timerange(start, end)
.interval('1m')
.rate(GO_PROD_RATE)
Expand Down Expand Up @@ -115,7 +115,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
]);
});

after(() => traceData.clean());
after(() => synthtraceEsClient.clean());

describe('compare transactions and metrics based throughput', () => {
let throughputMetrics: ThroughputReturn;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { roundNumber } from '../../utils';

export default function ApiTest({ getService }: FtrProviderContext) {
const apmApiClient = getService('apmApiClient');
const traceData = getService('traceData');
const synthtraceEsClient = getService('synthtraceEsClient');

const start = new Date('2021-01-01T00:00:00.000Z').getTime();
const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1;
Expand Down Expand Up @@ -101,7 +101,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
'instance-c'
);

await traceData.index([
await synthtraceEsClient.index([
...timerange(start, end)
.interval('1m')
.rate(GO_PROD_RATE)
Expand Down Expand Up @@ -159,7 +159,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
]);
});

after(() => traceData.clean());
after(() => synthtraceEsClient.clean());

describe('verify top dependencies', () => {
before(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { roundNumber } from '../../utils';

export default function ApiTest({ getService }: FtrProviderContext) {
const apmApiClient = getService('apmApiClient');
const traceData = getService('traceData');
const synthtraceEsClient = getService('synthtraceEsClient');

const serviceName = 'synth-go';
const start = new Date('2021-01-01T00:00:00.000Z').getTime();
Expand Down Expand Up @@ -115,7 +115,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
const serviceGoDevInstance = service(serviceName, 'development', 'go').instance(
'instance-b'
);
await traceData.index([
await synthtraceEsClient.index([
...timerange(start, end)
.interval('1m')
.rate(GO_PROD_RATE)
Expand All @@ -139,7 +139,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
]);
});

after(() => traceData.clean());
after(() => synthtraceEsClient.clean());

describe('compare throughput value between service inventory, throughput chart, service inventory and transactions apis', () => {
before(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type TransactionsGroupsDetailedStatistics =

export default function ApiTest({ getService }: FtrProviderContext) {
const apmApiClient = getService('apmApiClient');
const traceData = getService('traceData');
const synthtraceEsClient = getService('synthtraceEsClient');

const serviceName = 'synth-go';
const start = new Date('2021-01-01T00:00:00.000Z').getTime();
Expand Down Expand Up @@ -87,7 +87,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {

const transactionName = 'GET /api/product/list';

await traceData.index([
await synthtraceEsClient.index([
...timerange(start, end)
.interval('1m')
.rate(GO_PROD_RATE)
Expand All @@ -113,7 +113,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
]);
});

after(() => traceData.clean());
after(() => synthtraceEsClient.clean());

describe('without comparisons', () => {
let transactionsStatistics: TransactionsGroupsDetailedStatistics;
Expand Down

0 comments on commit 2dba0d1

Please sign in to comment.