Сохранять из логов прогона только изменения состояния балансировщика и реплик, сжимать посекундные метрики

This commit is contained in:
2026-11-04 17:24:56 +03:00
parent 940bc6f9f7
commit ecf89efc39
3 changed files with 19 additions and 3 deletions
+9
View File
@@ -38,6 +38,15 @@ host_probe() {
-c 'time -p awk "BEGIN{for(i=0;i<5000000;i++)s+=i}"' 2>&1 | awk '/^real/ { print $2 }'
}
# state_log keeps from `compose logs` (stdin) what explains a run: the
# balancer's server state changes and the replicas' start and stop. An
# overloaded run logs every failed request, gigabytes over a series; those
# lines are only counted.
state_log() {
awk '/is DOWN|is UP|UP\/READY|maintenance|"msg":"(starting|shutdown started|shutdown completed)"/ { print; next }
{ dropped++ } END { printf "# %d other lines dropped\n", dropped }'
}
# sample_docker_stats appends the CPU and memory of every container until killed.
sample_docker_stats() {
while :; do