lab2
This commit is contained in:
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
mkdir -p evidence/cache
|
||||
|
||||
{
|
||||
echo "# API cache performance experiment"
|
||||
echo "# generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
||||
env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY -u http_proxy -u https_proxy -u all_proxy \
|
||||
NO_PROXY=localhost,127.0.0.1,::1 no_proxy=localhost,127.0.0.1,::1 \
|
||||
python3 tests/cache_api_performance.py
|
||||
} > evidence/cache/api-performance.txt 2>&1
|
||||
cat evidence/cache/api-performance.txt
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
OUT="$ROOT/evidence/cache"
|
||||
GO="${GO:-go}"
|
||||
|
||||
cd "$ROOT"
|
||||
mkdir -p "$OUT"
|
||||
|
||||
{
|
||||
echo "# Cache consistency evidence (track 1)"
|
||||
echo "# generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
||||
echo "# redis: ${TEST_REDIS_HOST:-localhost}:${TEST_REDIS_PORT:-6379} db=${TEST_REDIS_DB:-1}"
|
||||
echo
|
||||
"$GO" test -tags=integration -count=1 -v -timeout=5m \
|
||||
-run 'TestChatRepositorySuite|TestSessionRepositorySuite' \
|
||||
./internal/storage/redis/...
|
||||
} | tee "$OUT/consistency.txt"
|
||||
|
||||
echo "wrote $OUT/consistency.txt"
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
mkdir -p evidence/cache
|
||||
|
||||
{
|
||||
echo "# Cache latency experiment"
|
||||
echo "# generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
||||
go version
|
||||
uname -sm
|
||||
go test -tags=integration -count=3 -timeout=5m -v \
|
||||
-run '^TestCacheLatencyExperiment$' ./internal/storage/postgres/...
|
||||
} > evidence/cache/latency.txt 2>&1
|
||||
cat evidence/cache/latency.txt
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
mkdir -p evidence/cache
|
||||
|
||||
{
|
||||
echo "# Cache performance experiment"
|
||||
echo "# generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
||||
go version
|
||||
uname -sm
|
||||
go test -tags=integration -count=3 -timeout=5m -v \
|
||||
-run '^TestCachePerformanceExperiment$' ./internal/storage/postgres/...
|
||||
} > evidence/cache/performance.txt 2>&1
|
||||
cat evidence/cache/performance.txt
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
COMPOSE_BIN=${COMPOSE_BIN:-docker-compose}
|
||||
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
"$COMPOSE_BIN" -f docker-compose.local.yaml restart postgres redis
|
||||
"$COMPOSE_BIN" -f docker-compose.local.yaml up -d --wait postgres redis
|
||||
"$COMPOSE_BIN" -f docker-compose.local.yaml up -d --force-recreate api
|
||||
Reference in New Issue
Block a user