chore: add locust files + testing setup

This commit is contained in:
2026-09-19 16:24:19 +02:00
parent b74d20cbe0
commit e8b018ec49
8 changed files with 1256 additions and 14 deletions
+6 -4
View File
@@ -22,7 +22,7 @@ _client = redis.Redis.from_url(settings.PLACE_REDIS_URL)
def _canvas_key(event_path: str) -> str:
return f"place:canvas:{event_path}"
return f"place:{event_path}:canvas"
def read_canvas(event_path: str, width: int, height: int) -> bytes:
@@ -49,9 +49,11 @@ def rebuild_canvas_from_history(event, width: int, height: int) -> int:
"""
grid = bytearray(width * height)
count = 0
placements = PixelPlacement.objects.filter(event=event).order_by(
"placed_at"
).values_list("x", "y", "color_index")
placements = (
PixelPlacement.objects.filter(event=event)
.order_by("placed_at")
.values_list("x", "y", "color_index")
)
for x, y, color_index in placements.iterator():
if x >= width or y >= height:
continue