This guide walks you through installing k6, running performance tests, sending results to InfluxDB, and visualizing your metrics in Grafana.
On Linux/macOS:
sudo gpg -k
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/k6-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69
echo "deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6.list
sudo apt-get update
sudo apt-get install k6Setup InfluxDB via Docker:
docker run -d \
-p 8086:8086 \
-e INFLUXDB_DB=k6 \
--name influxdb \
influxdb:1.8- Port 8086 is InfluxDB’s default API port.
- INFLUXDB_DB=k6 creates a database named
k6.
Setup Grafana via Docker:
docker run -d -p 5000:3000 --name=grafana grafana/grafana- Grafana will be available at http://localhost:5000.
Run your test using any of the scripts from the repository and send results to InfluxDB:
k6 run --out influxdb=http://localhost:8086/k6 <script_file>- Open Grafana at http://localhost:5000.
- Log in (
admin/adminby default). - Go to Settings → Data Sources → Add data source.
- Select InfluxDB.
- Set:
- URL:
http://host.docker.internal:8086 - Database:
k6 - User/Password: leave blank
- URL:
Click Save & Test.
- In Grafana, go to Dashboards → Import.
- Paste the JSON object from the
primary-dashboard.jsonfile of the repository - Click Load.
- Select your InfluxDB data source and import.
- Run more k6 tests; Grafana will auto-update.
- You can customize panels, add new queries, or create your own dashboards.
This repository includes comprehensive Python-based analysis tools to evaluate the success rates of onchain synchronization for the audit trail service.
- Confirmation Source Success:
confirmation_source != "pending_source" - Transaction Confirmation Trace Success:
transaction_confirmation_trace IS NOT NULL
python3 analysis/compare_success_rates.py --input transactions.csv --outdir reportsThe analysis generates:
- 4 High-Quality Visualizations (PNG, 300 DPI)
- Success Rate Comparison
- Sync Duration Analysis
- Transaction Trace Analysis
- Advanced Performance Metrics
- 4 CSV Reports with detailed metrics
- 1 JSON Report with complete results
- Comprehensive Analysis Report (Markdown)
- Overall success rates (confirmation source vs transaction trace)
- Sync duration statistics and distributions
- Service-level trace analysis
- Time-based performance patterns
- Source-specific success rates