Automation scripts for Thyme benchmarking and testing.
Automated benchmark execution script that sets up a k3d cluster, runs Thyme for a specified duration, and generates a comprehensive report.
./scripts/run-benchmark.sh [duration_minutes]Parameters:
duration_minutes- How long to run the benchmark (default: 60)
Example:
# Run a 60-minute benchmark (default)
./scripts/run-benchmark.sh
# Run a 10-minute benchmark
./scripts/run-benchmark.sh 10
# Run a 5-minute quick test
./scripts/run-benchmark.sh 5- Prerequisites Check: Verifies k3d, kubectl, and docker are installed
- Cluster Setup: Creates k3d cluster
thyme-benchmarkwith 2 agent nodes - Build & Deploy: Builds Thyme image and deploys full stack
- Monitoring: Monitors pod health every 30 seconds during the test
- Metrics Collection: Queries Prometheus for key performance metrics
- Log Collection: Gathers pod logs from all components
- Report Generation: Creates comprehensive markdown report
Reports are saved to ./local/reports/YYYY-MM-DD-NN/ where:
YYYY-MM-DDis the current dateNNis a sequential run number (01, 02, 03...) for same-day runs
Each report directory contains:
REPORT.md- Main report with summary and cluster infometrics.json- Prometheus query resultsqueries.txt- PromQL queries usedhealth.log- CSV log of pod health during testlogs/- Pod logs directorythyme.lognop-collector.loglgtm.loglog-generator-sample.log
- k3d - For local Kubernetes cluster
- kubectl - For Kubernetes operations
- docker - For container operations
- jq (optional) - For JSON processing of metrics
- curl - For Prometheus queries
The script does NOT automatically delete the cluster. To clean up:
k3d cluster delete thyme-benchmarkThis allows you to:
- Access Grafana after the test completes
- Manually inspect the cluster state
- Run additional queries or tests
Port conflicts: If port-forward fails, check if ports 9090 or 3000 are already in use.
Cluster already exists: Script will automatically delete and recreate the cluster.
Metrics collection fails: Ensure Prometheus is accessible. Try manually:
kubectl port-forward -n lgtm service/lgtm 9090:9090
curl http://localhost:9090/api/v1/query?query=upThis script is designed to be called by the /benchmark Claude skill:
User: "Run a benchmark"
Claude: [Executes ./scripts/run-benchmark.sh 60]
See .claude/skills/benchmark.md for skill documentation.