https://github.com/sachin-duhan/gotify-playground
Test bed with Node app using Gotify WS server & load script using vegeta
https://github.com/sachin-duhan/gotify-playground
docker golang gotify nodejs vegeta websocket
Last synced: 2 months ago
JSON representation
Test bed with Node app using Gotify WS server & load script using vegeta
- Host: GitHub
- URL: https://github.com/sachin-duhan/gotify-playground
- Owner: sachin-duhan
- Created: 2025-08-17T22:03:17.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-08-17T22:08:14.000Z (10 months ago)
- Last Synced: 2025-10-23T12:02:57.308Z (8 months ago)
- Topics: docker, golang, gotify, nodejs, vegeta, websocket
- Language: HTML
- Homepage:
- Size: 472 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gotify Load Testing Suite
A comprehensive testing and load testing toolkit for [Gotify](https://gotify.net/) server instances.
## 📋 Overview
This project provides two main components:
- **Gotify Tester** (`main.js`) - Node.js application for functional testing of Gotify API
- **Load Testing Suite** (`load.sh`) - Automated performance testing using Vegeta
## 🚀 Quick Start
### Prerequisites
- Docker & Docker Compose
- Node.js & npm
- Bash shell
### Setup & Run
1. **Start Gotify Server**
```bash
docker-compose up -d
```
Server will be available at `http://localhost:8080`
- Username: `admin`
- Password: `admin`
2. **Install Dependencies**
```bash
npm install axios ws
```
3. **Run Functional Tests**
```bash
node main.js
```
4. **Run Load Tests**
```bash
chmod +x load.sh
./load.sh
```
## 🔧 Components
### Docker Compose Configuration
- **Service**: `gotify/server` image
- **Port**: 8080:80 mapping
- **Volume**: `./gotify_data` for persistent data
- **Default credentials**: admin/admin
### Functional Tester (`main.js`)
Node.js application that performs comprehensive API testing:
**Features:**
- Client token authentication
- Application creation & management
- Message sending with different priorities
- Real-time WebSocket message listening
- Message retrieval and cleanup
**Test Flow:**
1. Obtains client authentication token
2. Creates test application
3. Establishes WebSocket connection
4. Sends test messages (low, normal, high priority)
5. Retrieves all messages
6. Cleans up test data
### Load Testing Suite (`load.sh`)
**Test Scenarios:**
- **Light Load**: 10 req/s for 30s (small messages)
- **Medium Load**: 50 req/s for 60s (medium messages)
- **Heavy Load**: 100 req/s for 30s (small messages)
- **Burst Test**: 200 req/s for 10s (small messages)
- **Large Message Test**: 20 req/s for 30s (large messages)
- **Stress Test**: Maximum rate for 15s (small messages)
**Generated Reports:**
- Text reports with latency statistics
- JSON reports for programmatic analysis
- HTML plots for visual analysis
- Histogram data for response time distribution
- Combined summary report
- HTML index for easy navigation
## 📊 Output Files
Load test results are saved in `vegeta_results/` directory:
- `*_report.txt` - Detailed text reports
- `*_report.json` - JSON formatted results
- `*_plot.html` - Visual performance plots
- `*_histogram.txt` - Response time histograms
- `combined_report_*.txt` - Summary of all tests
- `index_*.html` - Navigation page for all results
## 📝 Customization
### Modify Test Parameters
Edit configuration variables in the scripts:
- `GOTIFY_URL` - Server endpoint
- `USERNAME`/`PASSWORD` - Authentication credentials
- Load test rates and durations in `load.sh`