Skip to content

Commit

Permalink
Merge pull request #32 from pagopa/pdv-pre-upgrade-test
Browse files Browse the repository at this point in the history
update test parameters
  • Loading branch information
BenitoVisone authored Nov 15, 2023
2 parents c3f3aba + 009f7e5 commit bca0181
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/08-put-token-ramping-and-constant-scenario.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const options = {
executor: 'ramping-arrival-rate',

// Start iterations per `timeUnit`
startRate: 50,
startRate: 25,

// Start `startRate` iterations per seconds
timeUnit: '1s',
Expand All @@ -22,13 +22,13 @@ export const options = {

stages: [
// Start 50 iterations per `timeUnit` for the first minute.
{ target: 50, duration: '1m' },
{ target: 25, duration: '1m' },

// // Linearly ramp-up to starting 100 iterations per `timeUnit` over the following two minutes.
{ target: 100, duration: '2m' },
{ target: 50, duration: '2m' },

// // Continue starting 300 iterations per `timeUnit` for the following two minutes.
{ target: 300, duration: '2m' }
{ target: 150, duration: '2m' }
],
},
constant: {
Expand All @@ -38,7 +38,7 @@ export const options = {
duration: '3m',

// test rate
rate: 300,
rate: 150,

// It should start `rate` iterations per second
timeUnit: '1s',
Expand All @@ -57,7 +57,7 @@ export const options = {
executor: 'ramping-arrival-rate',

// Start iterations per `timeUnit`
startRate: 300,
startRate: 150,

// Start `startRate` iterations per seconds
timeUnit: '1s',
Expand All @@ -72,13 +72,13 @@ export const options = {

stages: [
// Start 300 iterations per `timeUnit` for four minutes.
{ target: 300, duration: '1m' },
{ target: 150, duration: '1m' },

// Linearly ramp-down to starting 100 iterations per `timeUnit` over the following two minutes.
{ target: 100, duration: '2m' },
{ target: 50, duration: '2m' },

// Continue starting 50 iterations per `timeUnit` for the following minute.
{ target: 50, duration: '1m' }
{ target: 25, duration: '1m' }
],
},
},
Expand Down Expand Up @@ -144,14 +144,23 @@ export default function () {
);

var r = http.put(url, payload, params);
var r1 = http.put(url, payload, params);

check(r, {
'status is 200': (r) => r.status === 200,
});

check(r1, {
'status is 200': (r) => r1.status === 200,
});

if (r.status === 429) {
throttling.add(1);
console.log(`Status ${r.status}`);
}
if (r1.status === 429) {
throttling.add(1);
console.log(`Status ${r1.status}`);
}

}

0 comments on commit bca0181

Please sign in to comment.