https://github.com/wasslz/Thingsboard-Load-Test
Python script that's used to do load testing on Thingsboard platform built on thingsboard-python-client-sdk
https://github.com/wasslz/Thingsboard-Load-Test
load-testing mqtt python test-automation thingsboard
Last synced: about 1 month ago
JSON representation
Python script that's used to do load testing on Thingsboard platform built on thingsboard-python-client-sdk
- Host: GitHub
- URL: https://github.com/wasslz/Thingsboard-Load-Test
- Owner: wasslz
- License: apache-2.0
- Created: 2019-09-16T07:05:41.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-02T00:25:14.000Z (almost 4 years ago)
- Last Synced: 2024-08-01T18:37:58.470Z (9 months ago)
- Topics: load-testing, mqtt, python, test-automation, thingsboard
- Language: Python
- Homepage: https://wasslz.com
- Size: 1.65 MB
- Stars: 12
- Watchers: 5
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-thingsboard - Thingsboard-Load-Test - automated load testing tool for Thingsboard (Tools)
README
# Thingsboard Load Test Tool
In this python script we are trying to create an automated load testing tool for Thingsboard, this tools has three main functions:
* Create a specified number of devices using API
* Publish an MQTT using [ThingsBoard client Python SDK](https://github.com/thingsboard/thingsboard-python-client-sdk "ThingsBoard client Python SDK")
* Delete devices using APIWe hope to make this tool to be in the form of Master -> slaves schema, where the master creates devices and distribute the jobs and token to the slaves which may be located on a multi remote mahines.
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
### Prerequisites
What things you need to install the software and how to install them.
The tool was written in Python3, so make sure that you have it install on your system also you need pip3 to install requirements.
```
pip3 install -r requirements.txt
```
Also you need MySQL database to store devices IDs and tokens used by thingsboard, use following query to create the MySQL table```sql
CREATE TABLE devices (devIndex INT , devID VARCHAR(255) , name VARCHAR(255), token VARCHAR(255) );
```
### Configuration
The configuration is in YAML formating, it is very clear and simple```yaml
mysql: #MySQL connections parameters
host: localhost
user: db_user
password: changeme
db: db_name
http:
http_host: https://demo.thingsboard.io #url to API backend of thingsboard
mqtt_node:
mqtt_host: demo.thingsboard.io # mqtt host name
auth_token: "" # Thingsboard authentication token*
devices:
start_index: 0 # the index of the first device to be created
devices_count: 3 # number of devices be created
publish:
delay: 5 # in seconds between every message
messages_count: 3 # number of msgs to be published by each device
```
*For authentication token Please refer to [ThingsBoard API reference](https://thingsboard.io/docs/reference/rest-api/#rest-api-auth "ThingsBoard API reference")
## Usage```
python3 publisher.py -c config.yaml
```## Contributing
The project is still on the PoC phase, the current script is doing the main jobs but it needs too much of working to be perfect, so all contribution are very welcomed.## Roadmap
* create a job manager functions that creates jobs and distribute the tokens over the slaves
* create a communications mechanisism between the slave and the master (socket is sugested)