-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds basic performance tests for other supported endpoints in v1, 2 a…
…nd 3
- Loading branch information
Showing
7 changed files
with
263 additions
and
83 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
Dfe.Academies.Performance/scripts/v1/keyStagePerformance.js
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,37 @@ | ||
import http from 'k6/http' | ||
import { check, sleep } from 'k6' | ||
|
||
export const options = { | ||
vus: 20, | ||
duration: '30s' | ||
} | ||
|
||
const baseUrl = 'https://localhost:5001' | ||
|
||
export default function () { | ||
|
||
getEducationPerformanceByUrn('100000') | ||
|
||
sleep(1) | ||
} | ||
|
||
function getEducationPerformanceByUrn(urn) { | ||
const res = http.get(`${baseUrl}/educationPerformance/${urn}`, { | ||
headers: getHeaders() | ||
}) | ||
|
||
isStatus200(res) | ||
} | ||
|
||
function isStatus200(res) { | ||
check(res, { | ||
'status is 200': (r) => r.status === 200, | ||
}) | ||
} | ||
|
||
function getHeaders() { | ||
return { | ||
'ApiKey': 'app-key', | ||
'Content-Type': 'application/json' | ||
} | ||
} |
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,38 @@ | ||
import http from 'k6/http' | ||
import { check, sleep } from 'k6' | ||
|
||
export const options = { | ||
vus: 20, | ||
duration: '30s' | ||
} | ||
|
||
const baseUrl = 'https://localhost:5001/v2' | ||
|
||
export default function () { | ||
|
||
getBaselineTrackers() | ||
|
||
sleep(1) | ||
} | ||
|
||
function getBaselineTrackers() { | ||
// TODO change url endpoint when spelling mistake resolved | ||
const res = http.get(`${baseUrl}/basline-tracker?page=1&count=50`, { | ||
headers: getHeaders() | ||
}) | ||
|
||
isStatus200(res) | ||
} | ||
|
||
function isStatus200(res) { | ||
check(res, { | ||
'status is 200': (r) => r.status === 200, | ||
}) | ||
} | ||
|
||
function getHeaders() { | ||
return { | ||
'ApiKey': 'app-key', | ||
'Content-Type': 'application/json' | ||
} | ||
} |
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,37 @@ | ||
import http from 'k6/http' | ||
import { check, sleep } from 'k6' | ||
|
||
export const options = { | ||
vus: 20, | ||
duration: '30s' | ||
} | ||
|
||
const baseUrl = 'https://localhost:5001/v2' | ||
|
||
export default function () { | ||
|
||
getFreeSchoolProjects() | ||
|
||
sleep(1) | ||
} | ||
|
||
function getFreeSchoolProjects() { | ||
const res = http.get(`${baseUrl}/fss/projects`, { | ||
headers: getHeaders() | ||
}) | ||
|
||
isStatus200(res) | ||
} | ||
|
||
function isStatus200(res) { | ||
check(res, { | ||
'status is 200': (r) => r.status === 200, | ||
}) | ||
} | ||
|
||
function getHeaders() { | ||
return { | ||
'ApiKey': 'app-key', | ||
'Content-Type': 'application/json' | ||
} | ||
} |
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,57 @@ | ||
import http from 'k6/http' | ||
import { check, sleep } from 'k6' | ||
|
||
export const options = { | ||
vus: 20, | ||
duration: '30s' | ||
} | ||
|
||
const baseUrl = 'https://localhost:5001/v3' | ||
|
||
export default function () { | ||
|
||
getTrustByUkPrn('10067112') | ||
|
||
searchTrustByName('SOUTH YORK MULTI ACADEMY TRUST') | ||
|
||
searchTrustByUkPrn('10067112') | ||
|
||
sleep(1) | ||
} | ||
|
||
function getTrustByUkPrn(ukprn) { | ||
const res = http.get(`${baseUrl}/trust/${ukprn}`, { | ||
headers: getHeaders() | ||
}) | ||
|
||
isStatus200(res) | ||
} | ||
|
||
function searchTrustByName(name) { | ||
const res = http.get(`${baseUrl}/trusts?groupName=${name}&page=1&count=10`, { | ||
headers: getHeaders() | ||
}) | ||
|
||
isStatus200(res); | ||
} | ||
|
||
function searchTrustByUkPrn(ukprn) { | ||
const res = http.get(`${baseUrl}/trusts?ukPrn=${ukprn}&page=1&count=10`, { | ||
headers: getHeaders() | ||
}) | ||
|
||
isStatus200(res) | ||
} | ||
|
||
function isStatus200(res) { | ||
check(res, { | ||
'status is 200': (r) => r.status === 200, | ||
}) | ||
} | ||
|
||
function getHeaders() { | ||
return { | ||
'ApiKey': 'app-key', | ||
'Content-Type': 'application/json' | ||
} | ||
} |
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,58 @@ | ||
import http from 'k6/http' | ||
import { check, sleep } from 'k6' | ||
|
||
export const options = { | ||
vus: 20, | ||
duration: '30s', | ||
// httpDebug: 'full', | ||
} | ||
|
||
const baseUrl = 'https://localhost:5001/v4' | ||
|
||
export default function () { | ||
|
||
getEstablishmentByUkPrn('10079319') | ||
|
||
getEstablishmentByUrn('100000') | ||
|
||
getEstablishmentsForTrust('10067112') | ||
|
||
sleep(1) | ||
} | ||
|
||
function getEstablishmentByUkPrn(ukprn) { | ||
const res = http.get(`${baseUrl}/establishment/${ukprn}`, { | ||
headers: getHeaders() | ||
}) | ||
|
||
isStatus200(res) | ||
} | ||
|
||
function getEstablishmentByUrn(urn) { | ||
const res = http.get(`${baseUrl}/establishment/urn/${urn}`, { | ||
headers: getHeaders() | ||
}) | ||
|
||
isStatus200(res) | ||
} | ||
|
||
function getEstablishmentsForTrust(ukprn) { | ||
const res = http.get(`${baseUrl}/establishments/trust?trustUkPrn=${ukprn}`, { | ||
headers: getHeaders() | ||
}) | ||
|
||
isStatus200(res) | ||
} | ||
|
||
function isStatus200(res) { | ||
check(res, { | ||
'status is 200': (r) => r.status === 200, | ||
}) | ||
} | ||
|
||
function getHeaders() { | ||
return { | ||
'ApiKey': 'app-key', | ||
'Content-Type': 'application/json' | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.