-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update gatling #3
base: main
Are you sure you want to change the base?
Conversation
String PASSWORD="secret"; | ||
|
||
// How many "actions" a team will take (actions are things like submitting, requesting clarification, viewing a scoreboard) | ||
int NUM_TEAM_ACTIONS = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjust this to make a team "user" last longer/do more things.
int NUM_TEAM_ACTIONS = 5; | ||
|
||
// Maximum amount of time the scenario can run | ||
int MAX_MINUTES = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sets a cap for how long this will run (which also sets how long a spectator will keep refreshing for.
// While we're polling the teampage, lets pretend to do some actions like a real team might | ||
.repeat(NUM_TEAM_ACTIONS, "i").on( | ||
exec( | ||
randomSwitch().on( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the random actions that a team will do, and the probabilities of each one.
) | ||
) | ||
// Sleep anywhere between 5s and 1 minute before doing another action | ||
.pause(5,60) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much time between each team "action". This is in seconds, so teams will take an action between 5 and 60s after their last action.
teamScenario.injectClosed( | ||
incrementConcurrentUsers(10) // Batches of this many users | ||
.times(10) // how many "levels" to test | ||
.eachLevelLasting(60) // hold the number of users for this duration | ||
.separatedByRampsLasting(60) // Take 60s between adding each user | ||
.startingFrom(10) // Start with 10 users | ||
), | ||
// spectatorScenario.injectOpen(atOnceUsers(10)) | ||
spectatorScenario.injectClosed( | ||
incrementConcurrentUsers(10) // Batches of this many spectators | ||
.times(10) // how many "levels" to test | ||
.eachLevelLasting(60) // hold the number of users for this duration | ||
.separatedByRampsLasting(60) // Take 60s between adding each user | ||
.startingFrom(10) // Start with 10 users | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the bit you'll want to adjust to tune how many concurrent users are hammering the system. Probably play with these things until it falls over.
This replaces all the old scala stuff with shiny new java based dsl (it's still a bit weird, but less weird than scala).
See the rungatling script for the required zip you need to download/extract.
See seeding/seed.sh for what you need to do to set up the data to run gatling (basically create a bunch of
gatling0001
/secret
team accounts, and a contest with a hello world problem that they're all a part of)I'll add some inline comments for things you might want to tune when adjusting the scaling.
The scenarios it runs through are:
/public
every 30s forever (to simulate the autorefresh)/team
every 30s (to simulate the autorefresh), then periodically does a random action (submits some code, views the problems page, views the team scoreboard, or submits a clarification request).At the bottom you can tune how many users are injected/how it ramps up/down.