github.com/argoproj/argo-events@v1.9.1/test/stress/README.md (about) 1 # Stress Testing 2 3 Argo Events provides a set of simple tools to do stress testing: 4 5 - An [events generator](generator/README.md) for Event Sources 6 - An application to create testing EventSources and Sensors, or hook into your 7 existing ones, grab data and provide reports 8 9 ## Before You Start 10 11 - Set up Prometheus metrics monitoring. 12 13 Follow the [instruction](https://argoproj.github.io/argo-events/metrics/) to 14 set up Prometheus to grab metrics, also make sure the basic Kubernetes metrics 15 like Pod CPU/memory usage are captured. Display the metrics using tools like 16 [Grafana](https://grafana.com/). 17 18 - Create the EventSource and Sensor for testing. 19 20 You can use the tool below to create the EventSource and Sensor, or use your 21 existing ones for testing. If you want to run the testing against a webhook 22 typed EventSource (e.g. `webhook`, `sns`, etc), you need to set up the ingress 23 for it beforehand. 24 25 ```shell 26 # Make sure you have sourced a KUBECONFIG file 27 go run ./test/stress/main.go --help 28 ``` 29 30 ## Steps 31 32 - Use the [Generator](generator/README.md) or any other generators your have to 33 generate messages for your EventSource. 34 35 - Explore the metrics in Grafana, watch the changes of 36 [golden metrics](https://argoproj.github.io/argo-events/metrics/#golden-signals) 37 such as Errors, Latency and Saturation. 38 39 ## About This Tool 40 41 This tool can be used to create a set of EventBus, EventSource and Sensor for 42 testing in your cluster. 43 44 For example, command below creates a `webhook` EventSource and a Sensor with 45 `log` trigger, and it captures the data and provides a simple report afterwards. 46 It will exit in 5 minutes and clean up the created resources. 47 48 ```shell 49 go run ./test/stress/main.go --eb-type jetstream --es-type webhook --trigger-type log --hard-timeout 5m 50 ``` 51 52 The spec of `webhook` EventSource is located in 53 [testdata/eventsources](testdata/eventsources), and the Sensor for `log` trigger 54 is in [testdata/sensors](testdata/sensors), make sure you update the specs with 55 desired CPU/memory you want to use before running the command. 56 57 The report looks like below: 58 59 ```text 60 ++++++++++++++++++++++++ Events Summary +++++++++++++++++++++++ 61 Event Name : test 62 Total processed events : 243 63 Events sent successful : 243 64 Events sent failed : 0 65 First event sent at : 2021-03-19 09:42:03.895959 -0700 PDT m=+101.008343356 66 Last event sent at : 2021-03-19 09:42:08.251331 -0700 PDT m=+105.363714318 67 Total time taken : 4.355370962s 68 -- 69 70 +++++++++++++++++++++++ Actions Summary +++++++++++++++++++++++ 71 Trigger Name : log-trigger 72 Total triggered actions : 243 73 Action triggered successfully : 243 74 Action triggered failed : 0 75 First action triggered at : 2021-03-19 09:42:03.907679 -0700 PDT m=+101.020062977 76 Last action triggered at : 2021-03-19 09:42:08.253928 -0700 PDT m=+105.366311326 77 Total time taken : 4.346248349s 78 -- 79 ``` 80 81 It could also hook into your existing EventSources and Sensors to give a simple 82 report. 83 84 ```shell 85 go run ./test/stress/main.go --eb-type jetstream --es-name my-sqs-es --sensor-name my-sensor --hard-timeout 5m 86 ```