Skip to content

Commit 23f0410

Browse files
author
Samin Rahman
committed
Added random suffixes to emails and reduced test time
1 parent 00a23bb commit 23f0410

2 files changed

Lines changed: 25 additions & 16 deletions

File tree

performance-testing/uid2-operator/k6-token-generate-refresh-identitymap-scenario-1.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ const refreshRPS = 25000;
1212
const identityMapRPS = 1500;
1313

1414
const warmUpTime = '10m'
15-
const testDuration = '30m'
15+
const testDuration = '20m'
16+
1617

1718
export const options = {
1819
insecureSkipTLSVerify: true,
@@ -154,7 +155,8 @@ export async function setup() {
154155
};
155156

156157
async function generateRefreshRequest() {
157-
let request = await createReq( {'optout_check': 1, 'email': 'test5000@example.com'});
158+
let randomSuffix = Math.floor(Math.random() * 1_000_000_001);
159+
let request = await createReq( {'optout_check': 1, 'email': `test${randomSuffix}@example.com`});
158160
var requestData = {
159161
endpoint: '/v2/token/generate',
160162
requestBody: request,
@@ -269,8 +271,9 @@ function generateIdentityMapRequest(emailCount) {
269271
"email": []
270272
};
271273

274+
let randomSuffix = Math.floor(Math.random() * 1_000_000_001);
272275
for (var i = 0; i < emailCount; ++i) {
273-
data.email.push(`test${i}@example.com`);
276+
data.email.push(`test${randomSuffix}${i}@example.com`);
274277
}
275278

276279
return data;
@@ -436,7 +439,8 @@ async function generateRequestWithTime(obj) {
436439

437440

438441
async function generateTokenGenerateRequestWithTime() {
439-
let requestData = { 'optout_check': 1, 'email': 'test500@example.com' };
442+
let randomSuffix = Math.floor(Math.random() * 1_000_000_001);
443+
let requestData = { 'optout_check': 1, 'email': `test${randomSuffix}@example.com` };
440444
return await generateRequestWithTime(requestData);
441445
}
442446

performance-testing/uid2-operator/k6-token-generate-refresh-identitymap-scenario-2.js

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ const clientKey = __ENV.CLIENT_KEY;
1010
const generateRPS = 25000;
1111
const refreshRPS = 25000;
1212
const identityMapRPS = 1500;
13-
const testDuration = '15m'
13+
14+
const warmUpTime = '10m'
15+
const testDuration = '20m'
1416

1517
export const options = {
1618
insecureSkipTLSVerify: true,
@@ -24,7 +26,7 @@ export const options = {
2426
preAllocatedVUs: 200,
2527
maxVUs: 400,
2628
stages: [
27-
{ duration: '30s', target: generateRPS}
29+
{ duration: warmUpTime, target: generateRPS}
2830
],
2931
},
3032
tokenRefreshWarmup: {
@@ -34,7 +36,7 @@ export const options = {
3436
preAllocatedVUs: 200,
3537
maxVUs: 400,
3638
stages: [
37-
{ duration: '30s', target: refreshRPS}
39+
{ duration: warmUpTime, target: refreshRPS}
3840
],
3941
},
4042
identityMapWarmup: {
@@ -44,14 +46,14 @@ export const options = {
4446
preAllocatedVUs: 1000,
4547
maxVUs: 1500,
4648
stages: [
47-
{ duration: '30s', target: identityMapRPS}
49+
{ duration: warmUpTime, target: identityMapRPS}
4850
],
4951
},/*
5052
keySharingWarmup: {
5153
executor: 'ramping-vus',
5254
exec: 'keySharing',
5355
stages: [
54-
{ duration: '30s', target: keySharingVUs}
56+
{ duration: warmUpTime, target: keySharingVUs}
5557
],
5658
gracefulRampDown: '0s',
5759
},*/
@@ -65,7 +67,7 @@ export const options = {
6567
maxVUs: 400,
6668
duration: testDuration,
6769
gracefulStop: '0s',
68-
startTime: '30s',
70+
startTime: warmUpTime,
6971
},
7072
tokenRefresh: {
7173
executor: 'constant-arrival-rate',
@@ -76,7 +78,7 @@ export const options = {
7678
maxVUs: 400,
7779
duration: testDuration,
7880
gracefulStop: '0s',
79-
startTime: '30s',
81+
startTime: warmUpTime,
8082
},
8183
identityMap: {
8284
executor: 'constant-arrival-rate',
@@ -87,15 +89,15 @@ export const options = {
8789
maxVUs: 1500,
8890
duration: testDuration,
8991
gracefulStop: '0s',
90-
startTime: '30s',
92+
startTime: warmUpTime,
9193
},/*
9294
keySharing:{
9395
executor: 'constant-vus',
9496
exec: 'keySharing',
9597
vus: keySharingVUs,
9698
duration: testDuration,
9799
gracefulStop: '0s',
98-
startTime: '30s',
100+
startTime: warmUpTime,
99101
},*/
100102
/*identityMapLargeBatchSequential: {
101103
executor: 'constant-vus',
@@ -152,7 +154,8 @@ export async function setup() {
152154
};
153155

154156
async function generateRefreshRequest() {
155-
let request = await createReq( {'optout_check': 1, 'email': 'test5000@example.com'});
157+
let randomSuffix = Math.floor(Math.random() * 1_000_000_001);
158+
let request = await createReq( {'optout_check': 1, 'email': `test${randomSuffix}@example.com`});
156159
var requestData = {
157160
endpoint: '/v2/token/generate',
158161
requestBody: request,
@@ -267,8 +270,9 @@ function generateIdentityMapRequest(emailCount) {
267270
"email": []
268271
};
269272

273+
let randomSuffix = Math.floor(Math.random() * 1_000_000_001);
270274
for (var i = 0; i < emailCount; ++i) {
271-
data.email.push(`test${i}@example.com`);
275+
data.email.push(`test${randomSuffix}${i}@example.com`);
272276
}
273277

274278
return data;
@@ -434,7 +438,8 @@ async function generateRequestWithTime(obj) {
434438

435439

436440
async function generateTokenGenerateRequestWithTime() {
437-
let requestData = { 'optout_check': 1, 'email': 'test500@example.com' };
441+
let randomSuffix = Math.floor(Math.random() * 1_000_000_001);
442+
let requestData = { 'optout_check': 1, 'email': `test${randomSuffix}@example.com` };
438443
return await generateRequestWithTime(requestData);
439444
}
440445

0 commit comments

Comments
 (0)