From ea1a1e591875d40e2df76d415e06d4d31606059b Mon Sep 17 00:00:00 2001 From: Dorey Miller Date: Fri, 21 May 2021 11:59:53 -0700 Subject: [PATCH 01/17] adding loadtesting with loops and subscribe and publish events --- config.yml | 4 +-- config_loop.yml | 77 +++++++++++++++++++++++++++++++++++++++++++++++++ config_pub.yml | 4 +-- functions.js | 0 monitor.html | 4 +-- 5 files changed, 83 insertions(+), 6 deletions(-) create mode 100644 config_loop.yml create mode 100644 functions.js diff --git a/config.yml b/config.yml index 793c51a..c91c95b 100644 --- a/config.yml +++ b/config.yml @@ -1,5 +1,5 @@ config: - target: "http://ekko-ekkos-T56QXUWSORKN-964893551.us-east-2.elb.amazonaws.com" + target: "http://ekko-ekkos-YK9SB7GQBXVU-1280264013.us-east-2.elb.amazonaws.com" phases: - duration: 10 arrivalRate: 1 @@ -8,7 +8,7 @@ config: socketio: transports: ["websocket"] auth: - jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZG1pbiI6ZmFsc2UsImFwcE5hbWUiOiJsb2FkdGVzdCIsImlhdCI6MTYyMTQ4MDE0Mn0.E6zZGs0Xw7s-MhfmFg1F73RHDvbXoZ5E4xoTANASu1s" + jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZG1pbiI6dHJ1ZSwiYXBwTmFtZSI6ImxvYWR0ZXN0IiwiaWF0IjoxNjIxNTU2MTM2fQ.TFcvBGww4qgg04snU59En9pJEESD2otToqkdASn-FZg" scenarios: - name: ekko Test engine: socketio-v3 diff --git a/config_loop.yml b/config_loop.yml new file mode 100644 index 0000000..735f1e8 --- /dev/null +++ b/config_loop.yml @@ -0,0 +1,77 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +config: + target: "http://ekko-ekkos-YK9SB7GQBXVU-1280264013.us-east-2.elb.amazonaws.com/loadtest" + engines: + socketio-v3: {} + socketio: + transports: ["websocket"] + auth: + jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZG1pbiI6dHJ1ZSwiYXBwTmFtZSI6ImxvYWR0ZXN0IiwiaWF0IjoxNjIxNTU2MTM2fQ.TFcvBGww4qgg04snU59En9pJEESD2otToqkdASn-FZg" + uuid: "hi" + phases: + - duration: 10 + arrivalRate: 1 + - duration: 10 + arrivalRate: 5 + variables: + greeting: + ["hello", "goedemorgen", "добрый день", "guten tag", "bonjour", "hola"] + processor: "./functions.js" + +scenarios: + - name: "A user that just lurks" + weight: 75 + engine: socketio-v3 + flow: + - get: + url: "/" + - emit: + [ + "subscribe", {channels: ["greeting"], uuid: "lurker-{{ $randomString() }}"} + ] + - think: 60 + + - name: "A mostly quiet user" + weight: 15 + engine: socketio-v3 + flow: + - get: + url: "/" + - emit: + [ + "subscribe", {channels: ["greeting"], uuid: "quiet-{{ $randomString() }}"} + ] + - think: 5 + - emit: + [ + "publish", {channel: "greeting", message: {text: "{{ greeting }}"}} + ] + - think: 60 + + - name: "A chatty user" + weight: 10 + engine: socketio-v3 + flow: + - get: + url: "/" + - emit: + [ + "subscribe", {channels: ["greeting"], uuid: "chatty-{{ $randomString() }}"} + ] + - think: 5 + - emit: + [ + "publish", {channel: "greeting", message: {text: "{{ greeting }}"}, uuid: "chatty-{{ $randomString() }}"} + ] + - loop: + - function: "setMessage" + - emit: + [ + "publish", {channel: "greeting", message: {text: "{{ message }}"}} + ] + - think: 10 + count: 10 + - think: 60 diff --git a/config_pub.yml b/config_pub.yml index dc892f7..ab0f598 100644 --- a/config_pub.yml +++ b/config_pub.yml @@ -1,5 +1,5 @@ config: - target: "http://ekko-ekkos-T56QXUWSORKN-964893551.us-east-2.elb.amazonaws.com/loadtest" + target: "http://ekko-ekkos-YK9SB7GQBXVU-1280264013.us-east-2.elb.amazonaws.com/loadtest" phases: - duration: 10 arrivalRate: 1 @@ -8,7 +8,7 @@ config: socketio: transports: ["websocket"] auth: - jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZG1pbiI6ZmFsc2UsImFwcE5hbWUiOiJsb2FkdGVzdCIsImlhdCI6MTYyMTQ4MDE0Mn0.E6zZGs0Xw7s-MhfmFg1F73RHDvbXoZ5E4xoTANASu1s" + jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZG1pbiI6dHJ1ZSwiYXBwTmFtZSI6ImxvYWR0ZXN0IiwiaWF0IjoxNjIxNTU2MTM2fQ.TFcvBGww4qgg04snU59En9pJEESD2otToqkdASn-FZg" uuid: "hi" scenarios: - name: ekko Test diff --git a/functions.js b/functions.js new file mode 100644 index 0000000..e69de29 diff --git a/monitor.html b/monitor.html index 7ed54b5..2eb1a12 100644 --- a/monitor.html +++ b/monitor.html @@ -3,8 +3,8 @@