-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add stack files and load test scenario
* The stack is deployed with docker swarm. * The test scenarios are running with k6. * Remove old load script bin/createLoad. * Remove endpoints used exclusively by the old script.
- Loading branch information
Showing
30 changed files
with
737 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import http from 'k6/http'; | ||
|
||
const baseUrl = __ENV.BASE_URL; | ||
const headers = {'Origin': baseUrl}; | ||
const jarPlayerOne = new http.CookieJar(); | ||
const jarPlayerTwo = new http.CookieJar(); | ||
|
||
export default function () { | ||
const gameId = open(jarPlayerOne); | ||
join(jarPlayerTwo, gameId); | ||
move(jarPlayerOne, gameId, 1); | ||
move(jarPlayerTwo, gameId, 2); | ||
move(jarPlayerOne, gameId, 3); | ||
move(jarPlayerTwo, gameId, 4); | ||
move(jarPlayerOne, gameId, 5); | ||
move(jarPlayerTwo, gameId, 6); | ||
move(jarPlayerOne, gameId, 7); | ||
move(jarPlayerTwo, gameId, 1); | ||
move(jarPlayerOne, gameId, 2); | ||
move(jarPlayerTwo, gameId, 3); | ||
move(jarPlayerOne, gameId, 4); | ||
move(jarPlayerTwo, gameId, 5); | ||
move(jarPlayerOne, gameId, 6); | ||
move(jarPlayerTwo, gameId, 7); | ||
move(jarPlayerOne, gameId, 1); | ||
move(jarPlayerTwo, gameId, 2); | ||
move(jarPlayerOne, gameId, 3); | ||
move(jarPlayerTwo, gameId, 4); | ||
move(jarPlayerOne, gameId, 5); | ||
move(jarPlayerTwo, gameId, 6); | ||
move(jarPlayerOne, gameId, 7); | ||
move(jarPlayerTwo, gameId, 1); | ||
} | ||
|
||
function open(jar) { | ||
let url = `${baseUrl}/api/connect-four/games/open`; | ||
return http.post(url, {}, {jar, headers}).json().gameId; | ||
} | ||
|
||
function join(jar, gameId) { | ||
let url = `${baseUrl}/api/connect-four/games/${gameId}/join`; | ||
return http.post(url, {}, {jar, headers}); | ||
} | ||
|
||
function move(jar, gameId, column) { | ||
let url = `${baseUrl}/api/connect-four/games/${gameId}/move`; | ||
return http.post(url, {column}, {jar, headers}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
APP_ENVIRONMENT=prod | ||
APP_KERNEL_SECRET=ThisTokenIsNotSoSecretChangeIt | ||
APP_WAIT_FOR=unix:///var/run/proxysql/proxysql.sock,chat-mysql:3306,connect-four-mysql-1:3306,connect-four-mysql-2:3306,connect-four-mysql-3:3306,connect-four-mysql-4:3306,connect-four-mysql-5:3306,identity-mysql:3306,chat-redis:6379,connect-four-redis:6379,web-interface-redis:6379,rabbitmq:5672,nchan:81 | ||
APP_RABBIT_MQ_DSN=amqp://guest:guest@rabbitmq:5672?heartbeat=60&prefetchCount=30 | ||
|
||
APP_CHAT_DOCTRINE_DBAL_URL=mysqli://root:password@localhost/chat?persistent=1&unix_socket=/var/run/proxysql/proxysql.sock | ||
APP_CHAT_RUN_MIGRATIONS=1 | ||
APP_CHAT_PREDIS_CLIENT_URL=redis://chat-redis:6379?persistent=1 | ||
|
||
APP_CONNECT_FOUR_DOCTRINE_DBAL_URL=mysqli://root:password@localhost/%env(APP_CONNECT_FOUR_DOCTRINE_DBAL_DATABASE)%?persistent=1&unix_socket=/var/run/proxysql/proxysql.sock | ||
APP_CONNECT_FOUR_DOCTRINE_DBAL_DATABASE=connect-four-1 | ||
APP_CONNECT_FOUR_DOCTRINE_DBAL_SHARDS=connect-four-1,connect-four-2,connect-four-3,connect-four-4,connect-four-5 | ||
APP_CONNECT_FOUR_RUN_MIGRATIONS=1 | ||
APP_CONNECT_FOUR_PREDIS_CLIENT_URL=redis://connect-four-redis:6379?persistent=1 | ||
|
||
APP_IDENTITY_DOCTRINE_DBAL_URL=mysqli://root:password@localhost/identity?persistent=1&unix_socket=/var/run/proxysql/proxysql.sock | ||
APP_IDENTITY_RUN_MIGRATIONS=1 | ||
|
||
APP_WEB_INTERFACE_PREDIS_CLIENT_URL=redis://web-interface-redis:6379?persistent=1 | ||
APP_WEB_INTERFACE_NCHAN_BASE_URL=http://nchan:81 | ||
APP_WEB_INTERFACE_PUBLISH_TO_BROWSER_SHARDS=5 | ||
|
||
PHP_FPM_PM=static | ||
PHP_FPM_PM_MAX_CHILDREN=96 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version: '3.4' | ||
|
||
services: | ||
chat-follow-event-store: | ||
image: marein/php-gaming-website:php-fpm | ||
command: bin/console chat:follow-event-store pointer all | ||
env_file: ../app.env | ||
volumes: | ||
- proxysql.sock:/var/run/proxysql | ||
deploy: | ||
placement: | ||
constraints: | ||
- "node.labels.long-running==1" | ||
chat-command: | ||
image: marein/php-gaming-website:php-fpm | ||
command: bin/console gaming:consume-messages chat.command -r 3 | ||
env_file: ../app.env | ||
volumes: | ||
- proxysql.sock:/var/run/proxysql | ||
deploy: | ||
replicas: 5 | ||
placement: | ||
constraints: | ||
- "node.labels.long-running==1" | ||
|
||
volumes: | ||
proxysql.sock: |
Oops, something went wrong.