Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sequence diagram for database listener interface #35

Merged
merged 5 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ This data is also reported to the console at the end of each test.
## Time Series DB Reporting and Tagging
<a id="db-reporting"></a>

Additional design details about how a database listener works with grasshopper/locust can be
found in the [Database Listener Design Documentation](./docs/database_listener_design_documentation.md).

When you specify a time series database URL param to `launch_test`, such as
`influx_host`, all metrics will be automatically reported to tables within the `locust`
timeseries database via the specified URL. These tables include:
Expand Down
5 changes: 5 additions & 0 deletions docs/database_listener_design_documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Database Listener for Locust/Grasshopper Design Documentation
alteryx-sezell marked this conversation as resolved.
Show resolved Hide resolved

## Sequence Diagram of how listeners are currently working within the framework

![Sequence Diagram](database_listeners_sequence_diagram.svg)
48 changes: 48 additions & 0 deletions docs/database_listeners_sequence_diagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Grasshopper (Locust) Database Listeners

@startuml
actor GrasshopperTest
box "Grasshopper" #LightBlue
boundary LaunchTest
entity Grasshopper
entity GrasshopperListeners
end box
entity LocustDBListener
boundary DbClient
database Database
boundary Locust

GrasshopperTest -> LaunchTest : run test
activate LaunchTest

LaunchTest -> Grasshopper : create new grasshopper object
activate Grasshopper
Grasshopper --> LaunchTest : grasshopper object

LaunchTest -> GrasshopperListeners : create new listeners object
activate GrasshopperListeners

GrasshopperListeners -> LocustDBListener : create new listener object
activate LocustDBListener
LocustDBListener -> DbClient : create new client object
activate DbClient
DbClient -> Database : connect
DbClient --> LocustDBListener : new client object
deactivate DbClient
LocustDBListener ->> Locust : register listeners on locust events
LocustDBListener --> GrasshopperListeners : new listener object
deactivate LocustDBListener

GrasshopperListeners --> LaunchTest : new listeners object
deactivate GrasshopperListeners


deactivate Grasshopper
deactivate LaunchTest

GrasshopperTest -> Locust : send http request (via API library, wich calls the Locust request method)
Locust ->> LocustDBListener : call listener on request event
LocustDBListener ->> DbClient : add metric for the request
DbClient ->> Database : post data point

@enduml
55 changes: 55 additions & 0 deletions docs/database_listeners_sequence_diagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading