@@ -10,7 +10,9 @@ const clientKey = __ENV.CLIENT_KEY;
1010const generateRPS = 25000 ;
1111const refreshRPS = 25000 ;
1212const identityMapRPS = 1500 ;
13- const testDuration = '15m'
13+
14+ const warmUpTime = '10m'
15+ const testDuration = '20m'
1416
1517export 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
436440async 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