o19s / opensearch-ubi

OpenSearch plugin for User Behavior Insights
Apache License 2.0
6 stars 1 forks source link

Adding basic load test #75

Closed jzonthemtn closed 8 months ago

jzonthemtn commented 8 months ago

This is a basic load test for sending events. To use it:

First start OpenSearch on localhost:9200:

cd load-test
source ./venv/bin/activate
./run.sh

The test will run for 10 seconds. The number of events sent will be shown along with the _count of events in the store:

Type     Name                                                                          # reqs      # fails |    Avg     Min     Max    Med |   req/s  failures/s
--------|----------------------------------------------------------------------------|-------|-------------|-------|-------|-------|-------|--------|-----------
POST     /_plugins/ubi/mystore                                                              8     0(0.00%) |      8       6       9      8 |    0.81        0.00
--------|----------------------------------------------------------------------------|-------|-------------|-------|-------|-------|-------|--------|-----------
         Aggregated                                                                         8     0(0.00%) |      8       6       9      8 |    0.81        0.00

Found 8 indexed

This shows 8 total requests made by locust, and 8 events are in the index. The idea being we can assert that the number of events sent matches the events stored in the index. As we go, we can scale this up to determine if events are getting lost during periods of high usage.

jzonthemtn commented 8 months ago

Could we add the content in the issue to the README? Literally the descirption about how to run it should probably be in the README.md file for now....! This looks cool.

Added description and instructions to the README.md.