diff --git a/deploy/scripts/README.md b/deploy/scripts/README.md
index fe925c24..8c87089f 100644
--- a/deploy/scripts/README.md
+++ b/deploy/scripts/README.md
@@ -103,6 +103,8 @@ Parameter store locations must start with the prefix `/perfTest/` in order for t
|`SCENARIO`|`all`[_default_]`sign_in``create_account,sign_in`|Comma seperated list of scenarios to enable. Blank strings or `'all'` will default to enabling all scenarios in the selected load profile. Implementation in [`getScenarios`](src/common/utils/config/load-profiles.ts#L27-L36) function|
|`ENVIRONMENT`|`build`[_default_]`staging`|Name of the environment where the test is being conducted. Accepted Values are build/staging depending on the test scenario|
+Note: To overcome latency issues caused by lambda cold starts, a [lambda warmer script](src/common/lambda-warmer.ts) is ran before performance tests. This sends concurrent requests to the respective imposter stub.
+
5. Click 'Start Build'
6. Build progress and the stdout results summary are printed in the 'Build logs'
diff --git a/deploy/scripts/src/common/lambda-warmer.ts b/deploy/scripts/src/common/lambda-warmer.ts
new file mode 100644
index 00000000..e7102ffe
--- /dev/null
+++ b/deploy/scripts/src/common/lambda-warmer.ts
@@ -0,0 +1,32 @@
+import http from 'k6/http'
+import { getEnv } from './utils/config/environment-variables'
+
+const env = {
+ imposterStubURL: getEnv('IDENTITY_IMPOSTER_STUB_URL'),
+ environment: getEnv('ENVIRONMENT')
+}
+const payload = {
+ reqBody: getEnv('IDENTITY_IMPOSTER_PAYLOAD')
+}
+const bearerToken = getEnv('IDENTITY_IMPOSTER_BEARER_TOKEN')
+
+export class Imposter {
+ public handler() {
+ const req = {
+ method: 'POST',
+ url: `https://${env.imposterStubURL}/${env.environment}/individuals/authentication/authenticator/api/match`,
+ body: JSON.stringify(payload.reqBody),
+ params: {
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: bearerToken
+ }
+ }
+ }
+
+ const reqArray = Array(10).fill(req)
+ const response = http.batch(reqArray)
+
+ return response
+ }
+}
diff --git a/deploy/scripts/src/cri-orange/nino-check.ts b/deploy/scripts/src/cri-orange/nino-check.ts
index 6436e03c..71973c53 100644
--- a/deploy/scripts/src/cri-orange/nino-check.ts
+++ b/deploy/scripts/src/cri-orange/nino-check.ts
@@ -15,6 +15,9 @@ import { isStatusCode200, isStatusCode302, pageContentCheck } from '../common/ut
import { sleepBetween } from '../common/utils/sleep/sleepBetween'
import { getEnv } from '../common/utils/config/environment-variables'
import { getThresholds } from '../common/utils/config/thresholds'
+import { Imposter } from '../common/lambda-warmer'
+
+const imposter = new Imposter()
const profiles: ProfileList = {
smoke: {
@@ -40,11 +43,8 @@ const groupMap = {
export const options: Options = {
scenarios: loadProfile.scenarios,
thresholds: getThresholds(groupMap),
- tags: { name: '' }
-}
-
-export function setup(): void {
- describeProfile(loadProfile)
+ tags: { name: '' },
+ batchPerHost: 10
}
const env = {
@@ -83,6 +83,13 @@ const csvData1: Nino[] = new SharedArray('csvDataNino', () => {
})
})
+export function setup(): void {
+ describeProfile(loadProfile)
+ const response = imposter.handler()
+ console.log('Response status: ', response[0].status)
+ console.log('Response body: ', response[0].body)
+}
+
export function ninoCheck(): void {
const groups = groupMap.ninoCheck
let res: Response
diff --git a/deploy/template.yaml b/deploy/template.yaml
index fb597f10..119aae2b 100644
--- a/deploy/template.yaml
+++ b/deploy/template.yaml
@@ -478,6 +478,9 @@ Resources:
IDENTITY_KIWI_F2F_STUB_URL: "/perfTest/identity/kiwi/f2f/stubUrl"
IDENTITY_KIWI_F2F_TARGET: "/perfTest/identity/kiwi/f2f/target"
IDENTITY_KIWI_STUB_SQS: "/perfTest/identity/kiwi/stubTxMAConsumer"
+ IDENTITY_IMPOSTER_BEARER_TOKEN: "/perfTest/identity/nino/bearerToken"
+ IDENTITY_IMPOSTER_PAYLOAD: "/perfTest/identity/nino/imposterStubPayload"
+ IDENTITY_IMPOSTER_STUB_URL: "/perfTest/identity/nino/imposterStubUrl"
IDENTITY_ORCH_STUB_PASSWORD: "/perfTest/identity/orchStubPassword"
IDENTITY_ORCH_STUB_USERNAME: "/perfTest/identity/orchStubUsername"
IDENTITY_PASSPORT_URL: "/perfTest/identity/lime/passportUrl"