Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qainsights/neo4j-locust
Locust Library for Neo4j database
https://github.com/qainsights/neo4j-locust
locust locustio neo4j neo4j-database python
Last synced: 5 days ago
JSON representation
Locust Library for Neo4j database
- Host: GitHub
- URL: https://github.com/qainsights/neo4j-locust
- Owner: QAInsights
- Created: 2021-03-14T18:41:58.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-16T00:25:07.000Z (almost 4 years ago)
- Last Synced: 2024-12-13T13:22:36.655Z (2 months ago)
- Topics: locust, locustio, neo4j, neo4j-database, python
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Locust Library for Neo4j database
This library helps you to performance test the neo4j database from Locust.
## Install
`git clone https://github.com/QAInsights/neo4j-locust`
`cd neo4j-locust`
`pip install -r requirements.txt`## Usage
`from neo4j_client import *`
### Boilerplate
```
class Neo4jTasks(SequentialTaskSet):
def on_start(self):
try:
self.client.connect("naveenkumar", "neo4j")
except ConnectionError as exception:
logging.info(f"Caught {exception}")
self.user.environment.runner.quit()@task
def send_query(self):
cypher_query = '''
MATCH (n:Actor) RETURN n LIMIT 25
'''
database = "neo4j"res = self.client.send(cypher_query, database)
def on_stop(self):
self.client.disconnect()class Neo4jCustom(Neo4jUser):
tasks = [Neo4jTasks]
host = "localhost:7687"
wait_time = constant(1)```