Bring the application, own tests, Dockerfile, toolchain, compose stack,
HAProxy, k6, RustFS and RabbitMQ configuration, migrations, hooks,
scenario scripts and the CI job from the lab 5 solution commit 64d5c67,
keep the lab 5 Makefile targets on top of the unchanged skeleton
targets, and append the lab 5 solution variables to the skeleton
.env.example. The package and the application follow the contract
version 1.6.0, and the image, the throwaway test containers and the
broker vhost description are tagged lab6 so they do not collide with a
lab 5 stand on the same host.
This is the starting point of the lab 6 cycle: lint, own tests and the
offline skeleton check pass before any lab 6 change.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
25 lines
1.6 KiB
Bash
Executable File
25 lines
1.6 KiB
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
cd "$(dirname "$0")/.."
|
|
cli() { docker compose exec -T valkey sh -c "REDISCLI_AUTH=\"\$(sed -n 's/^requirepass //p' /run/secrets/valkey.conf)\" valkey-cli $1"; }
|
|
psql() { docker compose exec -T postgres psql -U messenger -d messenger -tA -c "$1"; }
|
|
echo "date: $(date -u +%FT%TZ) commit: $(git rev-parse --short HEAD)"
|
|
echo "\$ valkey-cli config get appendonly appendfsync maxmemory maxmemory-policy"
|
|
cli "config get appendonly" ; cli "config get appendfsync"; cli "config get maxmemory"; cli "config get maxmemory-policy"
|
|
echo "\$ valkey-cli info persistence | grep aof_enabled,aof_last_write_status"
|
|
cli "info persistence" | grep -E '^aof_enabled|^aof_last_write_status'
|
|
echo "\$ valkey-cli dbsize; info stats | grep keyspace"
|
|
cli dbsize
|
|
cli "info stats" | grep -E '^keyspace_(hits|misses)'
|
|
key=$(cli "--scan --pattern session:* --count 1000" | head -1)
|
|
hash=${key#session:}
|
|
echo "\$ сравнение срока ключа кэша и срока сессии для одного ключа (значение и токен не печатаются)"
|
|
echo "valkey pexpiretime, ms: $(cli "pexpiretime $key")"
|
|
echo "postgres expires_at, ms: $(psql "SELECT (extract(epoch FROM expires_at) * 1000)::bigint FROM sessions WHERE token_hash = decode('$hash', 'hex')")"
|
|
echo "\$ количество отметок отзыва и закэшированных сессий"
|
|
revoked=0; cached=0
|
|
for k in $(cli "--scan --pattern session:* --count 1000"); do
|
|
if [ "$(cli "get $k")" = "-" ]; then revoked=$((revoked + 1)); else cached=$((cached + 1)); fi
|
|
done
|
|
echo "tombstones: $revoked, cached sessions: $cached"
|