Skip to content

Commit

Permalink
sequence diagram for database listener interface (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
alteryx-sezell authored Feb 28, 2024
1 parent e6054d5 commit a0e1d90
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 0 deletions.
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

## 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.

0 comments on commit a0e1d90

Please sign in to comment.