Skip to content

Commit 3d043c3

Browse files
committed
NRL-1053 update performance tests
1 parent 58b8086 commit 3d043c3

File tree

6 files changed

+62
-0
lines changed

6 files changed

+62
-0
lines changed

tests/performance/constants.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,10 @@ export const POINTER_TYPES = [
2525
"824321000000109",
2626
"2181441000000107",
2727
];
28+
export const CATEGORIES = [
29+
"734163000",
30+
"1102421000000108",
31+
"823651000000106",
32+
"721981007",
33+
"103693007",
34+
];

tests/performance/consumer/baseline.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ export const options = {
4141
{ target: 5, duration: "1m" },
4242
],
4343
},
44+
searchDocumentReferenceByCategory: {
45+
exec: "searchDocumentReferenceByCategory",
46+
executor: "ramping-arrival-rate",
47+
startRate: 1,
48+
timeUnit: "1s",
49+
preAllocatedVUs: 5,
50+
stages: [
51+
{ target: 5, duration: "30s" },
52+
{ target: 5, duration: "1m" },
53+
],
54+
},
4455
searchPostDocumentReference: {
4556
exec: "searchPostDocumentReference",
4657
executor: "ramping-arrival-rate",

tests/performance/consumer/client.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,27 @@ export function searchDocumentReference() {
8282
checkResponse(res);
8383
}
8484

85+
export function searchDocumentReferenceByCategory() {
86+
const nhsNumber = NHS_NUMBERS[Math.floor(Math.random() * NHS_NUMBERS.length)];
87+
const randomCategory =
88+
CATEGORIES[Math.floor(Math.random() * CATEGORIES.length)];
89+
90+
const identifier = encodeURIComponent(
91+
`https://fhir.nhs.uk/Id/nhs-number|${nhsNumber}`
92+
);
93+
const category = encodeURIComponent(
94+
`http://snomed.info/sct|${randomCategory}`
95+
);
96+
97+
const res = http.get(
98+
`https://${__ENV.HOST}/consumer/DocumentReference?subject:identifier=${identifier}&category=${category}`,
99+
{
100+
headers: getHeaders(),
101+
}
102+
);
103+
checkResponse(res);
104+
}
105+
85106
export function searchPostDocumentReference() {
86107
const nhsNumber = NHS_NUMBERS[Math.floor(Math.random() * NHS_NUMBERS.length)];
87108
const pointer_type =

tests/performance/consumer/soak.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ export const options = {
4444
{ target: 0, duration: "1m" },
4545
],
4646
},
47+
searchDocumentReferenceByCategory: {
48+
exec: "searchDocumentReferenceByCategory",
49+
executor: "ramping-arrival-rate",
50+
startRate: 1,
51+
timeUnit: "1s",
52+
preAllocatedVUs: 5,
53+
stages: [
54+
{ target: 5, duration: "30s" },
55+
{ target: 5, duration: "1m" },
56+
],
57+
},
4758
searchPostDocumentReference: {
4859
exec: "searchPostDocumentReference",
4960
executor: "ramping-arrival-rate",

tests/performance/consumer/stress.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ export const options = {
3535
{ target: 10, duration: "1m" },
3636
],
3737
},
38+
searchDocumentReferenceByCategory: {
39+
exec: "searchDocumentReferenceByCategory",
40+
executor: "ramping-arrival-rate",
41+
startRate: 1,
42+
timeUnit: "1s",
43+
preAllocatedVUs: 5,
44+
stages: [
45+
{ target: 5, duration: "30s" },
46+
{ target: 5, duration: "1m" },
47+
],
48+
},
3849
searchPostDocumentReference: {
3950
exec: "searchPostDocumentReference",
4051
executor: "ramping-vus",

tests/performance/producer/client.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
POINTER_IDS,
77
POINTER_DOCUMENTS,
88
POINTERS_TO_DELETE,
9+
CATEGORIES,
910
} from "../constants.js";
1011
import { check } from "k6";
1112
import { randomItem } from "https://jslib.k6.io/k6-utils/1.2.0/index.js";

0 commit comments

Comments
 (0)