-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
292d57b
commit cec2f84
Showing
10 changed files
with
3,245 additions
and
38 deletions.
There are no files selected for viewing
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
55 changes: 55 additions & 0 deletions
55
x-pack/test/apm_api_integration/basic/tests/transactions/throughput.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,55 @@ | ||
/* | ||
* 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 archives_metadata from '../../../common/archives_metadata'; | ||
import { PromiseReturnType } from '../../../../../plugins/observability/typings/common'; | ||
import { FtrProviderContext } from '../../../../common/ftr_provider_context'; | ||
|
||
export default function ApiTest({ getService }: FtrProviderContext) { | ||
const supertest = getService('supertest'); | ||
const esArchiver = getService('esArchiver'); | ||
|
||
const archiveName = 'apm_8.0.0'; | ||
const metadata = archives_metadata[archiveName]; | ||
|
||
// url parameters | ||
const start = encodeURIComponent(metadata.start); | ||
const end = encodeURIComponent(metadata.end); | ||
const uiFilters = encodeURIComponent(JSON.stringify({ environment: 'testing' })); | ||
|
||
describe('Throughput', () => { | ||
describe('when data is not loaded ', () => { | ||
it('handles the empty state', async () => { | ||
const response = await supertest.get( | ||
`/api/apm/services/opbeans-node/transactions/charts/throughput?start=${start}&end=${end}&uiFilters=${uiFilters}` | ||
); | ||
|
||
expect(response.status).to.be(200); | ||
|
||
expect(response.body.throughput.length).to.be(0); | ||
}); | ||
}); | ||
|
||
describe('when data is loaded', () => { | ||
before(() => esArchiver.load(archiveName)); | ||
after(() => esArchiver.unload(archiveName)); | ||
|
||
let response: PromiseReturnType<typeof supertest.get>; | ||
|
||
before(async () => { | ||
response = await supertest.get( | ||
`/api/apm/services/opbeans-node/transactions/charts/throughput?start=${start}&end=${end}&uiFilters=${uiFilters}` | ||
); | ||
}); | ||
|
||
it('returns throughput timeseries', async () => { | ||
expect(response.status).to.be(200); | ||
|
||
expect(response.body.throughput.length).to.be.greaterThan(0); | ||
}); | ||
}); | ||
}); | ||
} |
Oops, something went wrong.