-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove raw json Sort service items Fix tsc Add test for trace overview Move sorting to test replace “should” Update x-pack/test/apm_api_integration/basic/tests/services/top_services.ts Co-authored-by: Nathan L Smith <nathan.smith@elastic.co> Update x-pack/test/apm_api_integration/basic/tests/services/transactions/agent_name.ts Co-authored-by: Nathan L Smith <nathan.smith@elastic.co> Update x-pack/test/apm_api_integration/basic/tests/services/transactions/transaction_charts.ts Co-authored-by: Nathan L Smith <nathan.smith@elastic.co> Add additional agent config test
- Loading branch information
Showing
15 changed files
with
33,409 additions
and
11 deletions.
There are no files selected for viewing
Binary file added
BIN
+189 KB
x-pack/test/apm_api_integration/basic/fixtures/es_archiver/8.0.0/data.json.gz
Binary file not shown.
25,698 changes: 25,698 additions & 0 deletions
25,698
x-pack/test/apm_api_integration/basic/fixtures/es_archiver/8.0.0/mappings.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
x-pack/test/apm_api_integration/basic/tests/services/top_services.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* 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 { sortBy } from 'lodash'; | ||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../../common/ftr_provider_context'; | ||
|
||
export default function ApiTest({ getService }: FtrProviderContext) { | ||
const supertest = getService('supertest'); | ||
const esArchiver = getService('esArchiver'); | ||
|
||
// url parameters | ||
const start = encodeURIComponent('2020-06-29T06:45:00.000Z'); | ||
const end = encodeURIComponent('2020-06-29T06:49:00.000Z'); | ||
const uiFilters = encodeURIComponent(JSON.stringify({})); | ||
|
||
describe('APM Services Overview', () => { | ||
describe('when data is not loaded ', () => { | ||
it('handles the empty state', async () => { | ||
const response = await supertest.get( | ||
`/api/apm/services?start=${start}&end=${end}&uiFilters=${uiFilters}` | ||
); | ||
|
||
expect(response.status).to.be(200); | ||
expect(response.body).to.eql({ hasHistoricalData: false, hasLegacyData: false, items: [] }); | ||
}); | ||
}); | ||
|
||
describe('when data is loaded', () => { | ||
before(() => esArchiver.load('8.0.0')); | ||
after(() => esArchiver.unload('8.0.0')); | ||
|
||
it('returns a list of services', async () => { | ||
const response = await supertest.get( | ||
`/api/apm/services?start=${start}&end=${end}&uiFilters=${uiFilters}` | ||
); | ||
// sort services to mitigate unstable sort order | ||
const services = sortBy(response.body.items, ['serviceName']); | ||
|
||
expect(response.status).to.be(200); | ||
expect(services).to.eql([ | ||
{ | ||
serviceName: 'client', | ||
agentName: 'rum-js', | ||
transactionsPerMinute: 2, | ||
errorsPerMinute: 2.75, | ||
avgResponseTime: 116375, | ||
environments: [], | ||
}, | ||
{ | ||
serviceName: 'opbeans-java', | ||
agentName: 'java', | ||
transactionsPerMinute: 30.75, | ||
errorsPerMinute: 4.5, | ||
avgResponseTime: 25636.349593495936, | ||
environments: ['production'], | ||
}, | ||
{ | ||
serviceName: 'opbeans-node', | ||
agentName: 'nodejs', | ||
transactionsPerMinute: 31, | ||
errorsPerMinute: 3.75, | ||
avgResponseTime: 38682.52419354839, | ||
environments: ['production'], | ||
}, | ||
]); | ||
|
||
expect(response.body.hasHistoricalData).to.be(true); | ||
expect(response.body.hasLegacyData).to.be(false); | ||
}); | ||
}); | ||
}); | ||
} |
44 changes: 44 additions & 0 deletions
44
x-pack/test/apm_api_integration/basic/tests/services/transactions/agent_name.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* 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 expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; | ||
|
||
export default function ApiTest({ getService }: FtrProviderContext) { | ||
const supertest = getService('supertest'); | ||
const esArchiver = getService('esArchiver'); | ||
|
||
// url parameters | ||
const start = encodeURIComponent('2020-06-29T06:45:00.000Z'); | ||
const end = encodeURIComponent('2020-06-29T06:49:00.000Z'); | ||
|
||
describe('Agent name', () => { | ||
describe('when data is not loaded ', () => { | ||
it('handles the empty state', async () => { | ||
const response = await supertest.get( | ||
`/api/apm/services/opbeans-node/agent_name?start=${start}&end=${end}` | ||
); | ||
|
||
expect(response.status).to.be(200); | ||
expect(response.body).to.eql({}); | ||
}); | ||
}); | ||
|
||
describe('when data is loaded', () => { | ||
before(() => esArchiver.load('8.0.0')); | ||
after(() => esArchiver.unload('8.0.0')); | ||
|
||
it('returns the agent name', async () => { | ||
const response = await supertest.get( | ||
`/api/apm/services/opbeans-node/agent_name?start=${start}&end=${end}` | ||
); | ||
|
||
expect(response.status).to.be(200); | ||
expect(response.body).to.eql({ agentName: 'nodejs' }); | ||
}); | ||
}); | ||
}); | ||
} |
Oops, something went wrong.