edamame-load-test / edamame

A distributed load testing framework for real-time collaboration apps (HTTP and WebSockets)
5 stars 1 forks source link

Edamame

Prerequisites

In order to execute a load test with the edamame command line interface or graphical user interface, you will need the following:

Installation

Commands

edamame init

Usage: edamame init --zones <comma_separated_list_of_desired_availability_zones_in_your_preferred_aws_region>
Example: edamame init --zones us-west-2a,us-west-2b,us-west-2d
Outputs:

[09:15:51:909] ℹ Creating Edamame cluster... (this may take up to 20 minutes)
[09:34:27:582] ✔ Successfully created Edamame cluster.
[09:34:27:583] ℹ Configuring EBS credentials...
[09:35:14:030] ✔ Successfully configured EBS credentials.
[09:35:14:030] ℹ Setting up AWS Load Balancer Controller...
[09:36:16:613] ✔ Set up AWS Load Balancer Controller.
[09:36:17:446] ℹ Deploying Grafana, Postgres, & K6 Operator...
[09:36:49:854] ✔ Cluster configured. Welcome to Edamame!

Notes:

edamame run

Usage: edamame run --file {/path/to/test.js} --name "<desired name>" --vus-per-pod <num_vus>
Alternative usage:edamame run -f {/path/to/test.js} -n "<desired name>" -v <num_vus>
Outputs:

[07:24:33:021] ℹ Initializing load test...
[07:24:33:027] ✔ Successfully initialized load test.
[07:24:33:027] ℹ Provisioning load test resources (2 generators)...
[07:25:11:079] ✔ Successfully provisioned load test resources.
[07:25:11:080] ℹ Running load test...
[07:28:12:527] ✔ Load test completed.
[07:28:12:527] ℹ Tearing down load generating resources.
[07:28:48:630] ✔ Successfully removed load generating resources from cluster.

Notes:

edamame stop

Usage: edamame stop
Outputs:

[03:34:20:399] ℹ Stopping current test...
[03:34:53:785] ✔ Stopped current test.

edamame get --all

Usage: edamame get --all
Outputs:

[07:27:37:430] ℹ Retrieving information about historical tests...
[07:27:39:705] ✔ Successfully retrieved historical test data. Test names are listed under (index).
┌─────────────────┬────────────────────────────┬────────────────────────────┬─────────────┐
│     (index)     │         start time         │          end time          │   status    │
├─────────────────┼────────────────────────────┼────────────────────────────┼─────────────┤
│     example     │ '2023-03-20T23:20:03.744Z' │            null            │  'running'  │
│     50K VUs     │ '2023-03-20T22:52:48.864Z' │ '2023-03-20T22:55:04.873Z' │ 'completed' │
└─────────────────┴────────────────────────────┴────────────────────────────┴─────────────┘

Note: The names of tests are shown under the (index) column. To view an individual test only or the contents of a test script, please run edamame get --name "<test name>".

edamame get --name

Usage: edamame get --name "<test name>"
Alternative Usage: edamame get -n "<test name>"
Outputs:

[06:33:08:621] ℹ Retrieving details about the test named: 'example'...
[06:33:09:554] ✔ Successfully retrieved data about the test named: 'example.'
┌─────────┬────────────────────────────┬────────────────────────────┬─────────────┐
│ (index) │         start time         │          end time          │   status    │
├─────────┼────────────────────────────┼────────────────────────────┼─────────────┤
│ example │ '2023-03-20T22:52:48.864Z' │ '2023-03-20T22:55:04.873Z' │ 'completed' │
└─────────┴────────────────────────────┴────────────────────────────┴─────────────┘
                               Test script content:
-----------------------------------------------------------------------------------
"import http from ''k6/http'';
import { check } from ''k6'';

export const options = {
  scenarios: {
    shared_iter_scenario: {
      executor: \"shared-iterations\",
      vus: 10,
      iterations: 100,
      startTime: \"0s\",
    },
    per_vu_scenario: {
      executor: \"per-vu-iterations\",
      vus: 20,
      iterations: 10,
      startTime: \"10s\",
    },
  },
};

export default function () {
  const result = http.get(''https://test-api.k6.io/public/crocodiles/'');
  check(result, {
    ''http response status code is 200'': result.status === 200,
  });
}

"

Note: Please specify the test name in double quotes when executing this command if the test name includes spaces. For example, if the test name is example test, then this command would be executed as: edamame get -n "example test". If your test name is one word or is hyphenated, then you can exclude the quotes.

edamame delete

Usage: edamame delete "<test name>"
Outputs:

[07:59:41:686] ℹ Deleting the test named: 'example'...
[07:59:42:850] ✔ Deleted the test named: 'example'

Note: If your test name is one word and doesn't contain spaces, then you don't need to include quotes when executing this command. The example output above resulted from executing edamame delete example. If your test name contains spaces, like example test, then you would execute this command using quotes like the following: edamame delete "example test".

edamame update

Usage: edamame update --current "<current test name>" --new "<new proposed name>"
Alternative usage: edamame update -c "<current test name>" -n "<new proposed name>"
Outputs:

[08:07:46:290] ℹ Updating test name from 'example test' to '50k VU test'...
[08:07:51:044] ✔ Successfully updated test's name to: '50k VU test'

Note: If either your current or proposed test name is one word and doesn't contain spaces, then you don't need to include quotes around that name when executing this command.

edamame grafana --start

Usage: edamame grafana --start
Outputs:

[07:31:01:842] ℹ Configuring local access to grafana dashboard...
[07:31:34:711] ✔ Please find your Grafana dashboard at: http://localhost:3000

edamame grafana --stop

Usage: edamame grafana --stop
Outputs:

[12:07:38:477] ℹ Stopping grafana
[12:07:38:774] ✔ Grafana dashboard has been removed

edamame dashboard --start

Usage: edamame dashboard --start
Outputs:

[12:00:32:022] ℹ Configuring local access to grafana dashboard...
[12:01:02:671] ✔ Please find your Grafana dashboard at: http://localhost:3000
[12:00:32:022] ℹ Initializing your dashboard
[12:01:02:671] ℹ Installed packages for your backend
[12:00:32:022] ℹ Installed packages for your frontend
[12:00:32:022] ℹ Generated frontend build
[12:01:02:671] ✔ Your dashboard is now running at http://localhost:3001

edamame dashboard --stop

Usage: edamame dashboard --stop
Outputs:

[02:17:24:140] ℹ Stopping dashboard
[02:17:24:520] ✔ Dashboard has been removed

edamame archive

Usage: edamame archive --all
Alternative Usage: edamame archive --name testName --storage desiredStorageClass
Outputs:

$ edamame archive --name "100K VUs"

[04:08:56:294] ℹ Starting archive process...
[04:08:56:297] ℹ No S3 storage class has been specified, so the default STANDARD S3 storage class will be used.
[04:08:56:544] ℹ Creating load test AWS S3 Bucket located in: aws-region=us-west-2
 if it doesn't exist yet...
[04:09:01:715] ℹ AWS S3 Bucket is ready for uploads.
[04:09:03:366] ℹ Successfully archived 100K VUs.
[04:09:03:366] ✔ Archive process complete.

$ edamame archive --all --storage INTELLIGENT_TIERING

[01:57:28:276] ℹ Starting archive process...
[01:57:28:538] ℹ Creating load test AWS S3 Bucket located in: aws-region=us-west-2
 if it doesn't exist yet...
[01:57:30:170] ℹ AWS S3 Bucket is ready for uploads.
[01:57:33:187] ℹ Successfully archived 45f4d3e5-5c52-4f3e-88e2-17a085b1c80f.
[01:57:34:728] ℹ Archive for 100k VUs already exists. Skipping to next step.
[01:57:34:728] ✔ Archive process complete.

edamame delete-from-archive

Usage: edamame delete-from-archive --all
Alternative Usage: edamame delete-from-archive --name "100K VUs"
Outputs:

[04:17:18:812] ℹ Starting archival deletion process...
[04:17:21:787] ✔ Successfully deleted 100K VUs from your Edamame load test AWS S3 Bucket.

edamame archive-contents

Usage: edamame archive-contents
Outputs:

[11:59:14:955] ℹ Loading AWS S3 Bucket archive details...
[11:59:17:351] ✔ Your Edamame load test AWS S3 Bucket contains the following load test S3 objects:
 > 100kVUs.tar.gz
 > 120kVUs.tar.gz

edamame import-from-archive

Usage: edamame import-from-archive --all
Alternative Usage: edamame import-from-archive --name testName
Outputs:

$ edamame import-from-archive --name "100K VUs"

[02:29:28:602] ℹ Starting process to import AWS S3 archived data into Postgres database...
[02:29:31:507] ℹ Successfully imported the test 100kVUs from your AWS S3 Bucket.
[02:29:31:554] ✔ Completed importing data from AWS S3.

edamame restore

Usage: edamame restore --name testName --days 10
Outputs:

[02:25:18:043] ℹ Starting restoration of AWS S3 object...
[02:25:19:060] ✔ AWS S3 restoration process is in progress. Once it's complete you can import data associated with testName into your current Edamame EKS cluster or move the S3 object elsewhere.

edamame teardown

Usage: edamame teardown
Outputs:

[07:58:47:060] ℹ Tearing Down Edamame Cluster...
[08:10:11:675] ✔ Deleted Edamame Cluster

Notes: