-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (49 loc) · 1.42 KB
/
Makefile
File metadata and controls
59 lines (49 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.PHONY: help up down logs ps benchmark clean reset
# Default target
help:
@echo "ORM Benchmarks - Available commands:"
@echo ""
@echo " make up - Start PostgreSQL container"
@echo " make down - Stop PostgreSQL container"
@echo " make logs - View PostgreSQL logs"
@echo " make ps - Show container status"
@echo " make benchmark - Run the ORM benchmarks"
@echo " make clean - Stop container and remove volume"
@echo " make reset - Clean and restart fresh"
@echo ""
# Start PostgreSQL container
up:
@echo "Starting PostgreSQL..."
docker compose up -d
@echo "Waiting for PostgreSQL to be ready..."
@until docker compose exec -T postgres pg_isready -U postgres -d orm_benchmark > /dev/null 2>&1; do \
sleep 1; \
done
@echo "PostgreSQL is ready!"
# Stop PostgreSQL container
down:
@echo "Stopping PostgreSQL..."
docker compose down
# View logs
logs:
docker compose logs -f postgres
# Show container status
ps:
docker compose ps
# Run benchmarks
benchmark: up
@echo "Running ORM benchmarks..."
uv run python main.py
# Run benchmarks with custom iterations
benchmark-quick:
uv run python main.py --iterations 20 --warmup 5
benchmark-full:
uv run python main.py --iterations 500 --warmup 50
# Stop and remove volume (clean slate)
clean:
@echo "Cleaning up..."
docker compose down -v
@echo "Cleanup complete!"
# Reset - clean and start fresh
reset: clean up
@echo "Reset complete!"