diff --git a/.env.example b/.env.example index f9bb758..e758968 100644 --- a/.env.example +++ b/.env.example @@ -17,6 +17,9 @@ CACHE_TTL_SECONDS=30 CACHE_MODE=protected CACHE_LOCK_TTL_MS=1000 CACHE_MISS_DELAY_MS=0 +# Бюджет проверки зависимостей в /health/ready: LB пробует ту же ручку +# (timeout check 500 ms), поэтому проба обязана уложиться заметно раньше. +HEALTH_TIMEOUT_MS=400 # Токен доступа к /internal/metrics; сгенерируйте свой. METRICS_TOKEN=change-me # Дрейн перед выходом по SIGTERM: реплика перестаёт проходить пробу LB, diff --git a/Makefile b/Makefile index afe55a6..55427ff 100644 --- a/Makefile +++ b/Makefile @@ -10,12 +10,12 @@ FAILOVER_RUNS ?= 3 RATE ?= 200 TRACK1_ARGS ?= -.PHONY: help check validate test load test-persistence test-failover test-dependencies lab3-before-image \ +.PHONY: help check test-analytics validate test load test-persistence test-failover test-dependencies lab3-before-image \ stand-up stand-down stand-status stand-replica wait-ready quiesce-up quiesce-down \ test-e2e test-failover-all rolling-update track1 evidence help: - @echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes; test-dependencies: stops/restarts Redis and PostgreSQL" + @echo "check: offline structure; test-analytics: offline analytics regression (no stand); validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes; test-dependencies: stops/restarts Redis and PostgreSQL" @echo "stand-up/stand-down/stand-status: HAProxy + API x API_REPLICAS over shared PostgreSQL and Redis" @echo "stand-replica: restore one missing API replica; wait-ready: wait for /health/ready" @echo "quiesce-up/quiesce-down: stop and restore unrelated background containers of the host" @@ -25,6 +25,11 @@ help: check: $(PYTHON) scripts/check_contract.py +# Регрессия аналитики трека 1: успешный RPS отделён от частоты ответов, рост +# сравнивается только внутри одного темпа. Оффлайн: сырые сводки — фикстуры. +test-analytics: + $(PYTHON) -m unittest discover -s tests -p 'test_*.py' -v + validate: $(PYTHON) scripts/validate_openapi.py diff --git a/app/README.md b/app/README.md index e5a4d5d..e43553f 100644 --- a/app/README.md +++ b/app/README.md @@ -28,7 +28,7 @@ src/ cache/ версионированный кэш истории + lock на страницу idempotency/ журнал Idempotency-Key (claim/read/store/forget/GC) metrics/ /internal/metrics и /internal/metrics/reset - health/ liveness/readiness с проверкой зависимостей + /internal/lb-check + health/ liveness/readiness с проверкой зависимостей (readiness — проба LB) common/ http/ cursor (формат+календарь), page (конверт {items,next_cursor}), request-id errors/ exception filter и тип тела ошибки ApiErrorBody @@ -102,6 +102,7 @@ npm run start:dev # или npm run start:prod после | `DATABASE_CONNECTION_TIMEOUT_MS` | `5000` | таймаут установки соединения | | `DATABASE_STATEMENT_TIMEOUT_MS` | `5000` | таймаут SQL-запроса | | `SESSION_TTL_SECONDS` | `3600` | TTL сессии (минимум 2) | +| `HEALTH_TIMEOUT_MS` | `400` | бюджет проверки PostgreSQL/Redis внутри `/health/ready`; меньше `timeout check` HAProxy (500 ms) и `DATABASE_STATEMENT_TIMEOUT_MS` | | `CACHE_TTL_SECONDS` | `30` | TTL страницы истории в Redis | | `CACHE_MODE` | `protected` | `protected` (lock на страницу) или `naive` (только для эксперимента) | | `CACHE_LOCK_TTL_MS` | `1000` | TTL lock-а страницы | @@ -121,9 +122,8 @@ npm run start:dev # или npm run start:prod после | Метод и путь | Аутентификация | Назначение | |---|---|---| -| `GET /health/live` | нет | процесс жив | -| `GET /health/ready` | нет | готовность: PostgreSQL и Redis доступны, иначе `503` | -| `GET /internal/lb-check` | нет | проба балансировщика: только флаг дрейна, без обращения к БД/Redis | +| `GET /health/live` | нет | процесс жив; не обращается к зависимостям, поэтому отвечает `200` и при их отказе | +| `GET /health/ready` | нет | готовность реплики: флаг дреина + PostgreSQL и Redis (бюджет `HEALTH_TIMEOUT_MS`), иначе `503`; эту же ручку пробует HAProxy | | `POST /api/v1/users` | нет | регистрация с паролем (Argon2id) | | `POST /api/v1/auth/sessions` | `Basic` | вход, выдаёт opaque Bearer-токен | | `DELETE /api/v1/auth/sessions/current` | `Bearer` | отзыв текущей сессии, `204` | @@ -191,12 +191,30 @@ make test-dependencies Он включён по флагу `E2E_DEPENDENCY_FAULTS=1` (им же управляет цель Makefile), потому что требует прав на управление Docker Compose-проектом; остальные переменные — `E2E_COMPOSE_DIR`, `E2E_COMPOSE_ENV_FILE`, `E2E_REDIS_SERVICE`, -`E2E_POSTGRES_SERVICE`. Проверяется для Redis и PostgreSQL: `/health/live` -остаётся `200`, `/health/ready` и бизнес-запросы возвращают `503 unavailable` -с `request_id` из `X-Request-Id` и без деталей драйвера, запрос без сессии — -по-прежнему `401`, а после старта зависимости живы прежняя сессия, -подтверждённое сообщение и новая запись. Каждый запрос к остановленной БД ждёт -`DATABASE_CONNECTION_TIMEOUT_MS`, поэтому набор идёт около 40 секунд. +`E2E_POSTGRES_SERVICE`, `E2E_API_SERVICE`, `E2E_LB_STATS_URL`, +`E2E_POSTGRES_USER`, `E2E_POSTGRES_DB`, `E2E_PG_HBA_PATH`. + +Проверяются три топологии отказа: + +1. **Отказ Redis** (общая зависимость): `/health/live` реплики остаётся `200`, + `/health/ready` и бизнес-запросы — `503 unavailable` с `request_id` из + `X-Request-Id` и без деталей драйвера, запрос без сессии — по-прежнему `401`. + Неготовыми становятся все реплики, HAProxy исключает их из ротации и + отвечает собственным `503`; после старта Redis сессия и подтверждённое + сообщение живы. +2. **Отказ PostgreSQL** (общая зависимость): то же плюс проверка, что после + возврата зависимости данные на месте и новая запись проходит. +3. **Отказ PostgreSQL у одной реплики** (локальный путь к БД): для адреса + выбранной реплики временно ставится `reject`-строка в `pg_hba.conf` (первое + совпадение) и обрываются её соединения. Выбранная реплика отвечает `503` и её + слот уходит в `DOWN`, здоровая продолжает `200`/`UP` и обслуживает все чтения + через LB; `pg_hba.conf` восстанавливается в `finally`, после чего реплика + возвращается в ротацию и снова получает запросы. + +Реплики API портов не публикуют, поэтому отдельная реплика опрашивается изнутри +своего контейнера (loopback), а состояние слотов — из `stats;csv` HAProxy +(`127.0.0.1:8404`). Каждый запрос к остановленной БД ждёт +`DATABASE_CONNECTION_TIMEOUT_MS`, поэтому набор идёт около минуты. ## Реплики, балансировка и остановка реплики @@ -224,10 +242,16 @@ scripts/start-replica.sh # вернуть остано пулов раньше `beforeApplicationShutdown`), реплика какое-то время остаётся в ротации уже без ресурсов — это и было причиной явной последовательности в `src/main.ts`. -- `/internal/lb-check` намеренно не проверяет БД и Redis: отказ общей - зависимости нельзя исправить выводом реплик из ротации, иначе LB ответит - клиенту своей HTML-страницей вместо ограниченного `503 unavailable`. - `/health/ready` остаётся операторским сигналом и healthcheck'ом контейнера. +- **Проба LB — тот же `/health/ready`**, что и healthcheck контейнера: реплика, + потерявшая обязательную зависимость (свой путь к PostgreSQL или Redis), + выходит из ротации, и трафик уходит на здоровые реплики. Проба с зависимостями + ограничена `HEALTH_TIMEOUT_MS=400` на реплику (per-query `query_timeout` для + `SELECT 1` и `AbortSignal.timeout` для `PING`), поэтому она укладывается в + `timeout check 500ms` HAProxy. Когда недоступна общая для всех зависимость, + неготовыми становятся все реплики, и клиент получает `503` от самого LB: это + честный ответ «готовых узлов нет» вместо маскировки отказа. +- `/health/live` зависимостей не касается: он отвечает `200`, пока жив процесс, + и по нему проверяют, что реплика не упала (в том числе при отказе PG/Redis). ## Идемпотентность отправки сообщения diff --git a/app/src/config/app-config.schema.ts b/app/src/config/app-config.schema.ts index 2b44233..2a686f5 100644 --- a/app/src/config/app-config.schema.ts +++ b/app/src/config/app-config.schema.ts @@ -48,6 +48,9 @@ export const appConfigSchema = z undefined, 5000, ), + // Бюджет зависимостей в /health/ready: LB проверяет ту же ручку, поэтому + // проба готовности обязана уложиться в timeout check HAProxy (500 ms). + HEALTH_TIMEOUT_MS: numeric('HEALTH_TIMEOUT_MS', 1, undefined, 400), CACHE_TTL_SECONDS: numeric('CACHE_TTL_SECONDS', 1, undefined, 30), CACHE_MODE: z.enum(['protected', 'naive']).default('protected'), CACHE_LOCK_TTL_MS: numeric('CACHE_LOCK_TTL_MS', 1, undefined, 1000), diff --git a/app/src/database/database.client.ts b/app/src/database/database.client.ts index 98a1c88..34413d9 100644 --- a/app/src/database/database.client.ts +++ b/app/src/database/database.client.ts @@ -7,6 +7,7 @@ import type { AppConfig } from '../config/app-config.schema.js'; @Injectable() export class DatabaseClient implements OnModuleDestroy { readonly pool: pg.Pool; + private readonly healthPool: pg.Pool; private readonly logger = new Logger(DatabaseClient.name); constructor( @@ -29,6 +30,19 @@ export class DatabaseClient implements OnModuleDestroy { this.metrics.increment('database.pool_error'); this.logger.warn(`PostgreSQL pool error: ${error.message}`); }); + // Проба готовности не должна стоять в очереди за бизнес-запросами: занятый + // общий пул — это перегрузка, а не потеря зависимости. + this.healthPool = new pg.Pool({ + connectionString: this.config.getOrThrow('DATABASE_URL'), + max: 1, + idleTimeoutMillis: 0, + connectionTimeoutMillis: this.config.getOrThrow('HEALTH_TIMEOUT_MS'), + query_timeout: this.config.getOrThrow('HEALTH_TIMEOUT_MS'), + }); + this.healthPool.on('error', (error: Error) => { + this.metrics.increment('database.health_pool_error'); + this.logger.warn(`PostgreSQL health connection error: ${error.message}`); + }); } query( @@ -41,7 +55,8 @@ export class DatabaseClient implements OnModuleDestroy { } async health(): Promise { - await this.query('health.database', 'SELECT 1'); + this.metrics.increment('health.database'); + await this.healthPool.query('SELECT 1'); } async withTransaction( @@ -70,6 +85,6 @@ export class DatabaseClient implements OnModuleDestroy { } async onModuleDestroy(): Promise { - await this.pool.end(); + await Promise.all([this.pool.end(), this.healthPool.end()]); } } diff --git a/app/src/health/health.module.ts b/app/src/health/health.module.ts index e5b0ac3..f5bbe7a 100644 --- a/app/src/health/health.module.ts +++ b/app/src/health/health.module.ts @@ -1,13 +1,12 @@ import { Module } from '@nestjs/common'; import { HealthController } from './health.controller.js'; -import { LbCheckController } from './lb-check.controller.js'; import { HealthService } from './health.service.js'; import { DatabaseModule } from '../database/database.module.js'; import { RedisModule } from '../redis/redis.module.js'; @Module({ imports: [DatabaseModule, RedisModule], - controllers: [HealthController, LbCheckController], + controllers: [HealthController], providers: [HealthService], }) export class HealthModule {} diff --git a/app/src/health/health.service.spec.ts b/app/src/health/health.service.spec.ts index 05ae6b9..91f3e43 100644 --- a/app/src/health/health.service.spec.ts +++ b/app/src/health/health.service.spec.ts @@ -9,6 +9,7 @@ describe('HealthService', () => { const service = new HealthService( database as never, redis as never, + { getOrThrow: () => 50 } as never, ); expect(service.getLiveness()).toEqual({ status: 'ok' }); await expect(service.getReadiness()).resolves.toEqual({ status: 'ok' }); @@ -22,6 +23,22 @@ describe('HealthService', () => { const service = new HealthService( database as never, redis as never, + { getOrThrow: () => 50 } as never, + ); + await expect(service.getReadiness()).rejects.toBeInstanceOf( + ServiceUnavailableException, + ); + }); + + it('rejects readiness when Redis alone is unavailable', async () => { + const database = { health: vi.fn().mockResolvedValue(undefined) }; + const redis = { + health: vi.fn().mockRejectedValue(new Error('down')), + }; + const service = new HealthService( + database as never, + redis as never, + { getOrThrow: () => 50 } as never, ); await expect(service.getReadiness()).rejects.toBeInstanceOf( ServiceUnavailableException, @@ -32,6 +49,7 @@ describe('HealthService', () => { const service = new HealthService( { health: vi.fn() } as never, { health: vi.fn() } as never, + { getOrThrow: () => 50 } as never, ); service.setDraining(); expect(service.getLiveness()).toEqual({ status: 'ok' }); @@ -40,13 +58,34 @@ describe('HealthService', () => { ); }); - it('keeps the load-balancer check positive while a dependency is down', async () => { + it('answers not-ready during drain without probing dependencies', async () => { + const database = { health: vi.fn().mockResolvedValue(undefined) }; + const redis = { health: vi.fn().mockResolvedValue(undefined) }; const service = new HealthService( - { health: vi.fn().mockRejectedValue(new Error('down')) } as never, - { health: vi.fn().mockRejectedValue(new Error('down')) } as never, + database as never, + redis as never, + { getOrThrow: () => 50 } as never, ); - expect(service.getLbCheck()).toEqual({ status: 'ok' }); service.setDraining(); - expect(() => service.getLbCheck()).toThrow('Draining'); + await expect(service.getReadiness()).rejects.toThrow( + 'Service is shutting down', + ); + // Дрейн обязан отвечать сразу: проба LB не должна ждать зависимости, + // когда реплика уже выходит из ротации. + expect(database.health).not.toHaveBeenCalled(); + expect(redis.health).not.toHaveBeenCalled(); + }); + + it('fails readiness within the budget when a dependency hangs', async () => { + const database = { health: vi.fn(() => new Promise(() => {})) }; + const redis = { health: vi.fn().mockResolvedValue(undefined) }; + const service = new HealthService( + database as never, + redis as never, + { getOrThrow: () => 20 } as never, + ); + await expect(service.getReadiness()).rejects.toBeInstanceOf( + ServiceUnavailableException, + ); }); }); diff --git a/app/src/health/health.service.ts b/app/src/health/health.service.ts index 785f208..b2e5640 100644 --- a/app/src/health/health.service.ts +++ b/app/src/health/health.service.ts @@ -6,6 +6,8 @@ import { } from '@nestjs/common'; import { DatabaseClient } from '../database/database.client.js'; import { RedisClient } from '../redis/redis.client.js'; +import { ConfigService } from '@nestjs/config'; +import type { AppConfig } from '../config/app-config.schema.js'; @Injectable() export class HealthService { @@ -13,34 +15,41 @@ export class HealthService { constructor( private readonly database: DatabaseClient, private readonly redis: RedisClient, + private readonly config: ConfigService, ) {} getLiveness() { return { status: 'ok' as const }; } - // Load-balancer probe, deliberately independent of PostgreSQL and Redis: a - // shared dependency outage cannot be fixed by removing replicas from - // rotation, and draining every backend would answer clients with the LB's - // own HTML error page instead of the bounded API 503. /health/ready stays - // the operator-facing readiness signal. - getLbCheck() { - if (!this.ready) - throw new ServiceUnavailableException('Draining'); - return { status: 'ok' as const }; - } async getReadiness() { if (!this.ready) throw new ServiceUnavailableException('Service is shutting down'); + const dependencies = Promise.all([ + this.database.health(), + this.redis.health(), + ]); + // Поздний отказ после дедлайна не должен стать unhandled rejection. + dependencies.catch(() => undefined); + let timer: NodeJS.Timeout | undefined; + const deadline = new Promise((_, reject) => { + timer = setTimeout( + () => reject(new Error('readiness budget exceeded')), + this.config.getOrThrow('HEALTH_TIMEOUT_MS'), + ); + }); try { - await Promise.all([this.database.health(), this.redis.health()]); + await Promise.race([dependencies, deadline]); } catch { throw new ServiceUnavailableException('Dependencies unavailable'); + } finally { + clearTimeout(timer); } return { status: 'ok' as const }; } - // Called on SIGTERM before the drain delay: the replica turns not-ready for - // both the LB probe and the operator probe while it finishes in-flight - // requests. The delay itself lives in main.ts, because Nest destroys - // providers (closing the pools) before this class could serve anyone. + // Called on SIGTERM before the drain delay: the replica turns not-ready while + // it finishes in-flight requests, so the load balancer stops probing it + // successfully and removes it from rotation. The delay itself lives in + // main.ts, because Nest destroys providers (closing the pools) before this + // class could serve anyone. setDraining() { this.ready = false; } diff --git a/app/src/health/lb-check.controller.ts b/app/src/health/lb-check.controller.ts deleted file mode 100644 index 6ec3c4d..0000000 --- a/app/src/health/lb-check.controller.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Controller, Get } from '@nestjs/common'; -import { HealthService } from './health.service.js'; - -// The load balancer probes this route instead of /health/ready so that a shared -// database outage cannot drain the whole fleet; see HealthService.getLbCheck. -@Controller('internal') -export class LbCheckController { - constructor(private readonly health: HealthService) {} - - @Get('lb-check') - check() { - return this.health.getLbCheck(); - } -} diff --git a/app/src/redis/redis.client.ts b/app/src/redis/redis.client.ts index 911d3d3..220a6fb 100644 --- a/app/src/redis/redis.client.ts +++ b/app/src/redis/redis.client.ts @@ -1,4 +1,9 @@ -import { Injectable, Logger, OnModuleDestroy, OnModuleInit } from '@nestjs/common'; +import { + Injectable, + Logger, + OnModuleDestroy, + OnModuleInit, +} from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { createClient, type RedisClientType } from 'redis'; import type { AppConfig } from '../config/app-config.schema.js'; @@ -43,7 +48,13 @@ export class RedisClient implements OnModuleInit, OnModuleDestroy { async health(): Promise { this.metrics.increment('redis.ping'); - await this.client.ping(); + // AbortSignal.timeout ограничивает именно пробу: обычные GET/SET остаются + // без командного таймаута, а замороженный Redis проваливает готовность + // в бюджет, который короче timeout check балансировщика. + const timeout = AbortSignal.timeout( + this.config.getOrThrow('HEALTH_TIMEOUT_MS'), + ); + await this.client.withAbortSignal(timeout).ping(); } async get(key: string): Promise { diff --git a/app/test/dependency-failures.e2e-spec.ts b/app/test/dependency-failures.e2e-spec.ts index 4a62913..8632c06 100644 --- a/app/test/dependency-failures.e2e-spec.ts +++ b/app/test/dependency-failures.e2e-spec.ts @@ -11,10 +11,20 @@ import type { Page } from '../src/common/http/page.js'; import type { Message } from '../src/messages/message.js'; import type { User } from '../src/users/user.js'; -// Automated counterpart of the manual Redis/PostgreSQL outage checks: the suite -// stops a dependency of the Compose stand, asserts a bounded 503 (never a 500, -// never a trusted anonymous request, never a leaked driver error) and then -// restarts it to prove recovery without data loss. +// Automated counterpart of the manual Redis/PostgreSQL outage checks. Four +// topologies, because the load balancer probes /health/ready (the same route as +// the container healthcheck): +// 1. Redis outage — shared dependency: every replica turns not-ready, HAProxy +// removes all backends and answers 503 itself, while the replica's own +// readiness stays a bounded API 503 with request_id. +// 2. PostgreSQL outage — same shared-dependency topology, confirmed data and +// the session survive the restart. +// 3. Per-replica PostgreSQL fault — only the selected replica loses its own +// path to the database (temporary pg_hba reject entry for its address plus +// connection termination): that slot leaves rotation, the healthy replica +// keeps serving, and the fault is always undone. +// 4. Pool saturation — a busy shared pool is overload, not a lost dependency: +// the replicas stay in rotation because the probe uses its own connection. // // It is opt-in because it needs control over the Docker Compose project: // make test-dependencies @@ -30,22 +40,52 @@ const composeDir = const composeEnvFile = process.env.E2E_COMPOSE_ENV_FILE ?? '.env'; const redisService = process.env.E2E_REDIS_SERVICE ?? 'redis'; const postgresService = process.env.E2E_POSTGRES_SERVICE ?? 'postgres'; +const apiService = process.env.E2E_API_SERVICE ?? 'api'; +const lbStatsUrl = + process.env.E2E_LB_STATS_URL ?? 'http://127.0.0.1:8404/stats;csv'; +// PostgreSQL superuser of the stand (compose.yaml, .env); psql runs over the +// container's local socket, so no password is needed here. +const postgresUser = process.env.E2E_POSTGRES_USER ?? 'messenger'; +const postgresDatabase = process.env.E2E_POSTGRES_DB ?? 'messenger'; +const pgHbaPath = + process.env.E2E_PG_HBA_PATH ?? '/var/lib/postgresql/data/pg_hba.conf'; +const pgHbaBackup = `${pgHbaPath}.lab3-partial-fault.bak`; const password = 'outage-check:пароль🔐'; const runId = randomUUID().replaceAll('-', '').slice(0, 12); // A request that reaches a stopped database waits for the pool connection // timeout, so every outage step costs up to DATABASE_CONNECTION_TIMEOUT_MS. const outagedRequestBudgetMs = 180_000; +const slotBudgetMs = 20_000; +// Rotation is checked with HTTP reads through the LB, not with check counters. +const readyReads = 16; +const saturatingWrites = 60; // больше, чем replicas × DATABASE_POOL_MAX (2 × 10) const execFileAsync = promisify(execFile); type Result = { body: T; text: string; response: Response }; +type ReplicaProbe = { + instanceId: string | null; + requestId: string | null; + status: number; + text: string; +}; +type LbSlot = { addr: string; check: string; name: string; status: string }; -async function compose(...args: string[]): Promise { - await execFileAsync( +async function compose(...args: string[]): Promise { + const result = await execFileAsync( 'docker', ['compose', '--env-file', composeEnvFile, ...args], { cwd: composeDir, timeout: 120_000 }, ); + return result.stdout.trim(); +} + +async function docker(...args: string[]): Promise { + const result = await execFileAsync('docker', args, { + cwd: composeDir, + timeout: 60_000, + }); + return result.stdout.trim(); } async function request( @@ -54,7 +94,15 @@ async function request( ): Promise> { const response = await fetch(`${baseUrl}${path}`, init); const text = await response.text(); - return { body: (text ? JSON.parse(text) : undefined) as T, text, response }; + // With every backend out of rotation the answer is the LB's own HTML 503, + // so a body is not guaranteed to be JSON (it always is for API answers). + let body: T | undefined; + try { + body = text ? (JSON.parse(text) as T) : undefined; + } catch { + body = undefined; + } + return { body: body as T, text, response }; } function json( @@ -109,26 +157,290 @@ async function waitForReadiness( } } -function expectBoundedOutage(result: Result): void { - expect(result.response.status).toBe(503); - expect(result.body.error.code).toBe('unavailable'); - expect(result.body.error.message).toBe('Service unavailable'); - expect(result.body.error.request_id).toBe( - result.response.headers.get('x-request-id'), - ); +async function waitFor( + condition: () => Promise, + describe: () => Promise, + timeoutMs: number, +): Promise { + const deadline = Date.now() + timeoutMs; + for (;;) { + if (await condition()) return; + if (Date.now() > deadline) + throw new Error( + `condition not reached within ${timeoutMs}ms: ${await describe()}`, + ); + await sleep(250); + } +} + +// Contract of the bounded unavailable error, checked both on the API replica +// (JSON body with request_id) and through the load balancer. +function expectBoundedError( + status: number, + text: string, + requestId: string | null, +): void { + expect(status).toBe(503); + const body = JSON.parse(text) as ApiErrorBody; + expect(body.error.code).toBe('unavailable'); + expect(body.error.message).toBe('Service unavailable'); + expect(body.error.request_id).toBe(requestId); // A bounded error must not leak driver details, SQL text or a stack trace. - expect(result.text).not.toMatch( + expect(text).not.toMatch( /ECONNREFUSED|ECONNRESET|Connection terminated|pg\.|node_modules|at .*\(.+:\d+:\d+\)/u, ); } +function expectBoundedOutage(result: Result): void { + expectBoundedError( + result.response.status, + result.text, + result.response.headers.get('x-request-id'), + ); +} + +// With every backend out of rotation the last hop is the load balancer itself: +// it answers with its own 503 page, so there is no API error body and no +// X-Instance-Id — the request never reached a replica. +function expectLbOutage(result: Result): void { + expect(result.response.status).toBe(503); + expect(result.response.headers.get('x-instance-id')).toBeNull(); +} + +// What a client sees while a shared dependency is down: either the bounded 503 +// of a replica that is still in rotation (identified by X-Instance-Id), or the +// LB's own 503 once every replica has left rotation. Never a success. +function expectUnavailableThroughLb(result: Result): void { + expect(result.response.status).toBe(503); + if (result.response.headers.get('x-instance-id') === null) return; + expectBoundedOutage(result); +} + async function historyOf( chatId: string, token: string, ): Promise>> { - return request>(`/api/v1/chats/${chatId}/messages?limit=100`, { - headers: bearer(token), - }); + return request>( + `/api/v1/chats/${chatId}/messages?limit=100`, + { + headers: bearer(token), + }, + ); +} + +async function apiContainers(): Promise { + const stdout = await compose('ps', '-q', apiService); + return stdout + .split('\n') + .map((line) => line.trim()) + .filter((line) => line.length > 0) + .sort(); +} + +async function containerIp(container: string): Promise { + return docker( + 'inspect', + '-f', + '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}', + container, + ); +} + +// The replicas publish no ports, so a single replica is probed from inside its +// own network namespace (loopback). +const probeScript = ` +const params = JSON.parse(process.env.LAB3_PROBE); +const port = process.env.APP_PORT || 8080; +const response = await fetch('http://127.0.0.1:' + port + params.path, { + method: params.method || 'GET', + headers: params.headers || {}, + body: params.body, +}); +const text = await response.text(); +console.log(JSON.stringify({ + status: response.status, + text, + instanceId: response.headers.get('x-instance-id'), + requestId: response.headers.get('x-request-id'), +})); +`; + +type ProbeInit = { + body?: string; + headers?: Record; + method?: string; +}; + +async function probeReplica( + container: string, + path: string, + init: ProbeInit = {}, +): Promise { + const stdout = await docker( + 'exec', + '-e', + `LAB3_PROBE=${JSON.stringify({ path, ...init })}`, + container, + 'node', + '--input-type=module', + '-e', + probeScript, + ); + return JSON.parse(stdout) as ReplicaProbe; +} + +async function waitForReplicaReadiness( + container: string, + expected: number, + timeoutMs: number, +): Promise { + let last = 'no probe'; + await waitFor( + async () => { + try { + const probe = await probeReplica(container, '/health/ready'); + last = `${probe.status} ${probe.text}`; + return probe.status === expected; + } catch (error) { + last = error instanceof Error ? error.message : 'probe failed'; + return false; + } + }, + async () => last, + timeoutMs, + ); +} + +function parseCsvLine(line: string): string[] { + const values: string[] = []; + let current = ''; + let quoted = false; + for (const character of line) { + if (character === '"') quoted = !quoted; + else if (character === ',' && !quoted) { + values.push(current); + current = ''; + } else current += character; + } + values.push(current.replace(/\r$/u, '')); + return values; +} + +// Resolved backend slots of the api backend: the unused slots of the +// server-template have no address and are ignored. +async function lbSlots(): Promise { + const response = await fetch(lbStatsUrl); + const lines = (await response.text()).trim().split('\n'); + const header = parseCsvLine(lines[0].replace(/^#\s*/u, '')).map((name) => + name.trim(), + ); + const column = (name: string): number => header.indexOf(name); + return lines + .slice(1) + .map(parseCsvLine) + .filter( + (columns) => + columns[column('pxname')] === 'api' && + /^api\d+$/u.test(columns[column('svname')] ?? '') && + (columns[column('addr')] ?? '').length > 0, + ) + .map((columns) => ({ + addr: columns[column('addr')], + check: columns[column('check_status')], + name: columns[column('svname')], + status: columns[column('status')], + })); +} + +async function waitForSlot( + predicate: (slots: LbSlot[]) => boolean, + describe: string, + timeoutMs = slotBudgetMs, +): Promise { + let last = 'no stats'; + await waitFor( + async () => { + try { + const slots = await lbSlots(); + last = slots + .map( + (slot) => + `${slot.name}@${slot.addr} ${slot.status}/${slot.check}`, + ) + .join(', '); + return slots.length > 0 && predicate(slots); + } catch (error) { + last = error instanceof Error ? error.message : 'stats failed'; + return false; + } + }, + async () => `${describe} (last: ${last})`, + timeoutMs, + ); + return lbSlots(); +} + +function upSlots(slots: LbSlot[]): LbSlot[] { + return slots.filter((slot) => slot.status === 'UP'); +} + +async function psql(query: string): Promise { + return dockerExecService( + postgresService, + 'psql', + '-U', + postgresUser, + '-d', + postgresDatabase, + '-tA', + '-c', + query, + ); +} + +// docker exec needs a container, while the suite is configured with Compose +// service names, so the container of the service is resolved first. +async function dockerExecService( + service: string, + ...args: string[] +): Promise { + const container = (await compose('ps', '-q', service)) + .split('\n')[0] + ?.trim(); + if (!container) throw new Error(`no container for service ${service}`); + return docker('exec', container, ...args); +} + +// Takes away the replica's own path to PostgreSQL without touching the shared +// database: a reject entry for the replica's address becomes the first matching +// line of pg_hba.conf, so its new connections fail while the server stays up +// for everyone else. The file is rewritten through the existing inode (`cat > +// file`) to preserve the owner and mode the server needs to reload it. +async function applyReplicaDatabaseReject(address: string): Promise { + const script = [ + `test -f ${pgHbaBackup} || cat ${pgHbaPath} > ${pgHbaBackup}`, + `printf 'host all all ${address}/32 reject\\n' > /tmp/lab3-pg-hba`, + `cat ${pgHbaPath} >> /tmp/lab3-pg-hba`, + `cat /tmp/lab3-pg-hba > ${pgHbaPath}`, + 'rm -f /tmp/lab3-pg-hba', + ].join('; '); + await dockerExecService(postgresService, 'sh', '-c', script); + await psql('select pg_reload_conf()'); + await psql( + `select count(pg_terminate_backend(pid)) from pg_stat_activity where client_addr = '${address}'`, + ); +} + +// Idempotent restore: also runs from afterAll, so an assertion that failed +// mid-fault cannot leave the stand rejecting one replica. +async function restoreDatabaseAccess(): Promise { + await dockerExecService( + postgresService, + 'sh', + '-c', + `if [ -f ${pgHbaBackup} ]; then cat ${pgHbaBackup} > ${pgHbaPath}; rm -f ${pgHbaBackup}; fi`, + ); + await psql('select pg_reload_conf()'); } describe.skipIf(!enabled)('dependency outages', () => { @@ -136,6 +448,7 @@ describe.skipIf(!enabled)('dependency outages', () => { let token: string; let chat: Chat; let message: Message; + let replicas: string[]; beforeAll(async () => { await compose('up', '-d'); @@ -171,49 +484,129 @@ describe.skipIf(!enabled)('dependency outages', () => { ); expect(sent.response.status).toBe(201); message = sent.body; + replicas = await apiContainers(); + // Partial removal from rotation needs a healthy peer to compare with. + expect(replicas.length).toBeGreaterThanOrEqual(2); + await waitForSlot( + (slots) => upSlots(slots).length === replicas.length, + 'not every replica is UP', + 30_000, + ); }, outagedRequestBudgetMs); afterAll(async () => { - // Always restore the stand, even when an assertion failed mid-outage. + // Always restore the stand, even when an assertion failed mid-outage: + // first the services (pg_hba is only reachable in a running container), + // then the temporary per-replica rule, then rotation. await compose('start', redisService); await compose('start', postgresService); await waitForReadiness(200); + await restoreDatabaseAccess(); + const expected = (await apiContainers()).length; + await waitForSlot( + (slots) => upSlots(slots).length === expected, + 'backends did not return to rotation', + 30_000, + ); }, outagedRequestBudgetMs); + it( + 'keeps every replica in rotation while the database pool is saturated', + async () => { + // A row lock on the chat parks every write in the shared pool; the + // readiness probe uses its own connection and must keep answering. + const lock = psql( + `begin; select id from chats where id = '${chat.id}' for update; select pg_sleep(4); commit;`, + ); + await sleep(300); + const statuses = new Set(); + let sampling = true; + const sampler = (async () => { + while (sampling) { + for (const slot of await lbSlots()) statuses.add(slot.status); + await sleep(200); + } + })(); + const writes = await Promise.all( + Array.from({ length: saturatingWrites }, () => + request( + `/api/v1/chats/${chat.id}/messages`, + json({ text: 'saturation' }, messageHeaders(token)), + ), + ), + ); + await lock; + await sleep(1000); + sampling = false; + await sampler; + expect([...statuses]).toEqual(['UP']); + expect( + writes + .map((write) => write.response.status) + .filter((status) => status !== 201), + ).toEqual([]); + }, + outagedRequestBudgetMs, + ); + it( 'serves bounded 503 for the Redis outage and recovers the session', async () => { await compose('stop', redisService); + const replica = replicas[0]; - const live = await request('/health/live'); - expect(live.response.status).toBe(200); - await waitForReadiness(503); + // The replica itself stays bounded: liveness is unaffected, readiness + // and business requests report the missing dependency with an API + // error body. + expect((await probeReplica(replica, '/health/live')).status).toBe( + 200, + ); + await waitForReplicaReadiness(replica, 503, 30_000); + const readiness = await probeReplica(replica, '/health/ready'); + expectBoundedError( + readiness.status, + readiness.text, + readiness.requestId, + ); - expectBoundedOutage(await request('/health/ready')); + const me = await probeReplica(replica, '/api/v1/users/me', { + headers: bearer(token), + }); + expectBoundedError(me.status, me.text, me.requestId); - expectBoundedOutage( + // A request without a session must stay unauthorized during an outage: + // the outage may not turn an anonymous caller into a trusted one. + const anonymous = await probeReplica(replica, '/api/v1/chats', { + headers: { 'x-user-id': user.id }, + }); + expect(anonymous.status).toBe(401); + expect( + (JSON.parse(anonymous.text) as ApiErrorBody).error.code, + ).toBe('unauthorized'); + + // The shared dependency is missing for every replica: a client keeps + // getting 503 (from a replica first, then from the LB itself), and + // once all backends have left rotation the answer is the LB's own. + expectUnavailableThroughLb( await request('/api/v1/users/me', { headers: bearer(token), }), ); - - expectBoundedOutage( - await request('/api/v1/auth/sessions', { - method: 'POST', - headers: { authorization: basic(user.username, password) }, - }), + await waitForSlot( + (slots) => upSlots(slots).length === 0, + 'not every slot left rotation', + ); + expectLbOutage( + await request('/api/v1/users/me', { headers: bearer(token) }), ); - - // A request without a session must stay unauthorized during an outage: - // the outage may not turn an anonymous caller into a trusted one. - const anonymous = await request('/api/v1/chats', { - headers: { 'x-user-id': user.id }, - }); - expect(anonymous.response.status).toBe(401); - expect(anonymous.body.error.code).toBe('unauthorized'); await compose('start', redisService); await waitForReadiness(200); + await waitForSlot( + (slots) => upSlots(slots).length === replicas.length, + 'backends did not return to rotation', + 30_000, + ); // Sessions live in Redis with persistence, so the old token still works. const recovered = await request('/api/v1/users/me', { @@ -235,46 +628,75 @@ describe.skipIf(!enabled)('dependency outages', () => { 'serves bounded 503 for the PostgreSQL outage and keeps confirmed data', async () => { await compose('stop', postgresService); + const replica = replicas[0]; - const live = await request('/health/live'); - expect(live.response.status).toBe(200); - await waitForReadiness(503); + expect((await probeReplica(replica, '/health/live')).status).toBe( + 200, + ); + await waitForReplicaReadiness(replica, 503, 30_000); + const readiness = await probeReplica(replica, '/health/ready'); + expectBoundedError( + readiness.status, + readiness.text, + readiness.requestId, + ); - expectBoundedOutage(await request('/health/ready')); + // Redis still answers, so these requests reach the database layer and + // must fail with the bounded 503, not an unhandled 500. + const me = await probeReplica(replica, '/api/v1/users/me', { + headers: bearer(token), + }); + expectBoundedError(me.status, me.text, me.requestId); - // Redis still answers, so these requests reach the database layer. - expectBoundedOutage( + const chats = await probeReplica(replica, '/api/v1/chats', { + headers: bearer(token), + }); + expectBoundedError(chats.status, chats.text, chats.requestId); + + const history = await probeReplica( + replica, + `/api/v1/chats/${chat.id}/messages?limit=100`, + { headers: bearer(token) }, + ); + expectBoundedError(history.status, history.text, history.requestId); + + const registration = await probeReplica(replica, '/api/v1/users', { + method: 'POST', + headers: { 'content-type': 'application/json' }, + body: JSON.stringify({ + username: `outage_${runId}_late`, + display_name: 'Отказ зависимости', + password, + }), + }); + expectBoundedError( + registration.status, + registration.text, + registration.requestId, + ); + + // Every replica loses the shared database; a client keeps getting 503, + // first from a replica and then from the LB itself. + expectUnavailableThroughLb( await request('/api/v1/users/me', { headers: bearer(token), }), ); - - expectBoundedOutage( - await request('/api/v1/chats', { - headers: bearer(token), - }), + await waitForSlot( + (slots) => upSlots(slots).length === 0, + 'not every slot left rotation', ); - - expectBoundedOutage( - await request( - `/api/v1/chats/${chat.id}/messages?limit=100`, - { headers: bearer(token) }, - ), - ); - - expectBoundedOutage( - await request( - '/api/v1/users', - json({ - username: `outage_${runId}_late`, - display_name: 'Отказ зависимости', - password, - }), - ), + expectLbOutage( + await request('/api/v1/users/me', { headers: bearer(token) }), ); await compose('start', postgresService); await waitForReadiness(200); + await waitForSlot( + (slots) => upSlots(slots).length === replicas.length, + 'backends did not return to rotation', + 30_000, + ); const recovered = await request('/api/v1/users/me', { headers: bearer(token), @@ -282,9 +704,9 @@ describe.skipIf(!enabled)('dependency outages', () => { expect(recovered.response.status).toBe(200); expect(recovered.body.id).toBe(user.id); - const history = await historyOf(chat.id, token); - expect(history.response.status).toBe(200); - expect(history.body.items.map((item) => item.id)).toContain( + const after = await historyOf(chat.id, token); + expect(after.response.status).toBe(200); + expect(after.body.items.map((item) => item.id)).toContain( message.id, ); @@ -296,4 +718,96 @@ describe.skipIf(!enabled)('dependency outages', () => { }, outagedRequestBudgetMs, ); + + it( + 'excludes only the replica that lost its own database path', + async () => { + const selected = replicas[0]; + const healthy = replicas[1]; + const selectedIp = await containerIp(selected); + const selectedAddress = `${selectedIp}:8080`; + const selectedInstance = ( + await probeReplica(selected, '/health/live') + ).instanceId; + expect(selectedInstance).not.toBeNull(); + const healthyInstance = ( + await probeReplica(healthy, '/health/live') + ).instanceId; + + try { + await applyReplicaDatabaseReject(selectedIp); + const faultAt = Date.now(); + + // The selected replica reports the loss, the healthy one does not. + await waitForReplicaReadiness(selected, 503, 30_000); + expect( + (await probeReplica(healthy, '/health/ready')).status, + ).toBe(200); + + // Only the affected slot leaves rotation. While `fall 2` counts the + // failed checks the slot passes through "UP 1/2 (L7STS)", so the + // wait is for DOWN itself, not for "no longer plain UP". + const slots = await waitForSlot( + (candidates) => + upSlots(candidates).length === replicas.length - 1 && + candidates.some( + (slot) => + slot.addr === selectedAddress && + slot.status === 'DOWN', + ), + `selected slot ${selectedAddress} did not go down`, + 30_000, + ); + // inter 500 ms × fall 2 + timeout check 500 ms + polling step 250 ms. + expect(Date.now() - faultAt).toBeLessThan(3_000); + expect( + slots.find((slot) => slot.addr === selectedAddress)?.status, + ).toBe('DOWN'); + + // Traffic through the LB stays on the healthy replica: no errors + // and no request served by the replica that lost its database. + const served = new Set(); + for (let index = 0; index < readyReads; index += 1) { + const read = await historyOf(chat.id, token); + expect(read.response.status).toBe(200); + served.add( + read.response.headers.get('x-instance-id') ?? 'unknown', + ); + } + expect(served.has(selectedInstance as string)).toBe(false); + expect(served.has(healthyInstance as string)).toBe(true); + } finally { + await restoreDatabaseAccess(); + } + + // The restored replica answers again and returns to rotation. + await waitForReplicaReadiness(selected, 200, 30_000); + await waitForSlot( + (slots) => + upSlots(slots).length === replicas.length && + slots.some( + (slot) => + slot.addr === selectedAddress && + slot.status === 'UP', + ), + 'restored replica did not return to rotation', + 30_000, + ); + + let servedAgain = false; + for ( + let index = 0; + index < readyReads * 2 && !servedAgain; + index += 1 + ) { + const read = await historyOf(chat.id, token); + expect(read.response.status).toBe(200); + servedAgain = + read.response.headers.get('x-instance-id') === + selectedInstance; + } + expect(servedAgain).toBe(true); + }, + outagedRequestBudgetMs, + ); }); diff --git a/compose.yaml b/compose.yaml index 8c87a6f..3ecab72 100644 --- a/compose.yaml +++ b/compose.yaml @@ -113,6 +113,8 @@ services: CACHE_MODE: ${CACHE_MODE:-protected} CACHE_MISS_DELAY_MS: ${CACHE_MISS_DELAY_MS:-0} SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600} + # Бюджет пробы готовности; LB проверяет ту же ручку с timeout check 500 ms. + HEALTH_TIMEOUT_MS: ${HEALTH_TIMEOUT_MS:-400} # Дрейн длиннее обнаружения отказа LB (500 ms x fall 2 ≈ 1 s). DRAIN_DELAY_MS: ${DRAIN_DELAY_MS:-3000} deploy: diff --git a/evidence/track1/graphs/ab-comparison.png b/evidence/track1/graphs/ab-comparison.png index b5a45e1..2de83e0 100644 Binary files a/evidence/track1/graphs/ab-comparison.png and b/evidence/track1/graphs/ab-comparison.png differ diff --git a/evidence/track1/graphs/container-cpu-block_n4-pg3_rep1.png b/evidence/track1/graphs/container-cpu-block_n4-pg3_rep1.png deleted file mode 100644 index 7f1534e..0000000 Binary files a/evidence/track1/graphs/container-cpu-block_n4-pg3_rep1.png and /dev/null differ diff --git a/evidence/track1/graphs/container-cpu-block_n4-pool20_rep1.png b/evidence/track1/graphs/container-cpu-block_n4-pool20_rep1.png deleted file mode 100644 index 108f7b5..0000000 Binary files a/evidence/track1/graphs/container-cpu-block_n4-pool20_rep1.png and /dev/null differ diff --git a/evidence/track1/graphs/container-cpu-growth_api-total-6-900.png b/evidence/track1/graphs/container-cpu-growth_api-total-6-900.png deleted file mode 100644 index c2619b0..0000000 Binary files a/evidence/track1/graphs/container-cpu-growth_api-total-6-900.png and /dev/null differ diff --git a/evidence/track1/graphs/container-cpu-growth_api-total-6.png b/evidence/track1/graphs/container-cpu-growth_api-total-6.png deleted file mode 100644 index 54f02b8..0000000 Binary files a/evidence/track1/graphs/container-cpu-growth_api-total-6.png and /dev/null differ diff --git a/evidence/track1/graphs/container-cpu-growth_api6-pg3-900.png b/evidence/track1/graphs/container-cpu-growth_api6-pg3-900.png deleted file mode 100644 index acb5ba4..0000000 Binary files a/evidence/track1/graphs/container-cpu-growth_api6-pg3-900.png and /dev/null differ diff --git a/evidence/track1/graphs/container-cpu-growth_pg-3.0-900.png b/evidence/track1/graphs/container-cpu-growth_pg-3.0-900.png deleted file mode 100644 index 7288d85..0000000 Binary files a/evidence/track1/graphs/container-cpu-growth_pg-3.0-900.png and /dev/null differ diff --git a/evidence/track1/graphs/container-cpu-growth_pg-3.0.png b/evidence/track1/graphs/container-cpu-growth_pg-3.0.png deleted file mode 100644 index 27d79f3..0000000 Binary files a/evidence/track1/graphs/container-cpu-growth_pg-3.0.png and /dev/null differ diff --git a/evidence/track1/graphs/container-cpu-growth_pool-20-900.png b/evidence/track1/graphs/container-cpu-growth_pool-20-900.png deleted file mode 100644 index 8d0b998..0000000 Binary files a/evidence/track1/graphs/container-cpu-growth_pool-20-900.png and /dev/null differ diff --git a/evidence/track1/graphs/container-cpu-growth_pool-20.png b/evidence/track1/graphs/container-cpu-growth_pool-20.png deleted file mode 100644 index bd2c2dd..0000000 Binary files a/evidence/track1/graphs/container-cpu-growth_pool-20.png and /dev/null differ diff --git a/evidence/track1/graphs/container-cpu-growth_pool-5-900.png b/evidence/track1/graphs/container-cpu-growth_pool-5-900.png deleted file mode 100644 index 7fd8a9a..0000000 Binary files a/evidence/track1/graphs/container-cpu-growth_pool-5-900.png and /dev/null differ diff --git a/evidence/track1/graphs/container-cpu-growth_pool-5.png b/evidence/track1/graphs/container-cpu-growth_pool-5.png deleted file mode 100644 index 48c3b0f..0000000 Binary files a/evidence/track1/graphs/container-cpu-growth_pool-5.png and /dev/null differ diff --git a/evidence/track1/graphs/container-cpu-p-a_n1-vu900.png b/evidence/track1/graphs/container-cpu-p-a_n1-vu900.png deleted file mode 100644 index 6be9691..0000000 Binary files a/evidence/track1/graphs/container-cpu-p-a_n1-vu900.png and /dev/null differ diff --git a/evidence/track1/graphs/container-cpu-p-a_n4-vu900.png b/evidence/track1/graphs/container-cpu-p-a_n4-vu900.png deleted file mode 100644 index a0425b9..0000000 Binary files a/evidence/track1/graphs/container-cpu-p-a_n4-vu900.png and /dev/null differ diff --git a/evidence/track1/graphs/container-cpu-p-c_lb1.0.png b/evidence/track1/graphs/container-cpu-p-c_lb1.0.png deleted file mode 100644 index 28afe52..0000000 Binary files a/evidence/track1/graphs/container-cpu-p-c_lb1.0.png and /dev/null differ diff --git a/evidence/track1/graphs/container-cpu-smoke-p-a.png b/evidence/track1/graphs/container-cpu-smoke-p-a.png deleted file mode 100644 index 091a9f9..0000000 Binary files a/evidence/track1/graphs/container-cpu-smoke-p-a.png and /dev/null differ diff --git a/evidence/track1/graphs/container-cpu-why_n4-lb025_rep1.png b/evidence/track1/graphs/container-cpu-why_n4-lb025_rep1.png deleted file mode 100644 index 1f5c696..0000000 Binary files a/evidence/track1/graphs/container-cpu-why_n4-lb025_rep1.png and /dev/null differ diff --git a/evidence/track1/graphs/growth.png b/evidence/track1/graphs/growth.png index d02b361..ab3f003 100644 Binary files a/evidence/track1/graphs/growth.png and b/evidence/track1/graphs/growth.png differ diff --git a/evidence/track1/graphs/latency-errors.png b/evidence/track1/graphs/latency-errors.png index e31e128..14b0ccd 100644 Binary files a/evidence/track1/graphs/latency-errors.png and b/evidence/track1/graphs/latency-errors.png differ diff --git a/evidence/track1/graphs/steady-throughput.png b/evidence/track1/graphs/steady-throughput.png index b003c5e..cfb0875 100644 Binary files a/evidence/track1/graphs/steady-throughput.png and b/evidence/track1/graphs/steady-throughput.png differ diff --git a/evidence/track1/graphs/throughput.png b/evidence/track1/graphs/throughput.png index db63af0..eddc663 100644 Binary files a/evidence/track1/graphs/throughput.png and b/evidence/track1/graphs/throughput.png differ diff --git a/evidence/track1/raw/ab#A#rep1.k6.json b/evidence/track1/raw/ab#A#rep1.k6.json index 400671d..1fa4686 100644 --- a/evidence/track1/raw/ab#A#rep1.k6.json +++ b/evidence/track1/raw/ab#A#rep1.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 50, + "attempted_rps": 50.0, "avg": 6.24, "duration_s": 15, "failed": 0, @@ -30,10 +30,11 @@ "p99": 11.89, "rate": 50, "requests": 750, + "successful_rps": 50.0, "vus_active": 1 }, { - "achieved_rps": 100, + "attempted_rps": 100.0, "avg": 6.8, "duration_s": 15, "failed": 0, @@ -43,10 +44,11 @@ "p99": 46, "rate": 100, "requests": 1500, + "successful_rps": 100.0, "vus_active": 1 }, { - "achieved_rps": 150.07, + "attempted_rps": 150.07, "avg": 6.12, "duration_s": 15, "failed": 0, @@ -56,10 +58,11 @@ "p99": 16.54, "rate": 150, "requests": 2251, + "successful_rps": 150.07, "vus_active": 3 }, { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 6.43, "duration_s": 15, "failed": 0, @@ -69,10 +72,11 @@ "p99": 30.66, "rate": 200, "requests": 3001, + "successful_rps": 200.07, "vus_active": 2 }, { - "achieved_rps": 250.07, + "attempted_rps": 250.07, "avg": 7.19, "duration_s": 15, "failed": 0, @@ -82,10 +86,11 @@ "p99": 46.41, "rate": 250, "requests": 3751, + "successful_rps": 250.07, "vus_active": 4 }, { - "achieved_rps": 257.8, + "attempted_rps": 257.8, "avg": 1278.09, "duration_s": 15, "failed": 0, @@ -95,10 +100,11 @@ "p99": 5873.71, "rate": 300, "requests": 3867, + "successful_rps": 257.8, "vus_active": 1032 }, { - "achieved_rps": 188.33, + "attempted_rps": 188.33, "avg": 6457.66, "duration_s": 15, "failed": 914, @@ -108,10 +114,11 @@ "p99": 11675, "rate": 350, "requests": 2825, + "successful_rps": 127.4, "vus_active": 1201 }, { - "achieved_rps": 171.73, + "attempted_rps": 171.73, "avg": 6828.33, "duration_s": 15, "failed": 978, @@ -121,6 +128,7 @@ "p99": 11434.26, "rate": 400, "requests": 2576, + "successful_rps": 106.53, "vus_active": 1 } ], diff --git a/evidence/track1/raw/ab#A#rep2.k6.json b/evidence/track1/raw/ab#A#rep2.k6.json index 7a8fce3..45d9d60 100644 --- a/evidence/track1/raw/ab#A#rep2.k6.json +++ b/evidence/track1/raw/ab#A#rep2.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 50, + "attempted_rps": 50.0, "avg": 6.08, "duration_s": 15, "failed": 0, @@ -30,10 +30,11 @@ "p99": 10.81, "rate": 50, "requests": 750, + "successful_rps": 50.0, "vus_active": 1 }, { - "achieved_rps": 100.07, + "attempted_rps": 100.07, "avg": 5.67, "duration_s": 15, "failed": 0, @@ -43,10 +44,11 @@ "p99": 11.35, "rate": 100, "requests": 1501, + "successful_rps": 100.07, "vus_active": 3 }, { - "achieved_rps": 150.07, + "attempted_rps": 150.07, "avg": 6.16, "duration_s": 15, "failed": 0, @@ -56,10 +58,11 @@ "p99": 25.17, "rate": 150, "requests": 2251, + "successful_rps": 150.07, "vus_active": 3 }, { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 6.28, "duration_s": 15, "failed": 0, @@ -69,10 +72,11 @@ "p99": 16.19, "rate": 200, "requests": 3001, + "successful_rps": 200.07, "vus_active": 4 }, { - "achieved_rps": 250.07, + "attempted_rps": 250.07, "avg": 6.93, "duration_s": 15, "failed": 0, @@ -82,10 +86,11 @@ "p99": 44.47, "rate": 250, "requests": 3751, + "successful_rps": 250.07, "vus_active": 5 }, { - "achieved_rps": 261.87, + "attempted_rps": 261.87, "avg": 753.22, "duration_s": 15, "failed": 0, @@ -95,10 +100,11 @@ "p99": 3753.44, "rate": 300, "requests": 3928, + "successful_rps": 261.87, "vus_active": 646 }, { - "achieved_rps": 210.07, + "attempted_rps": 210.07, "avg": 5512.59, "duration_s": 15, "failed": 420, @@ -108,10 +114,11 @@ "p99": 9141.24, "rate": 350, "requests": 3151, + "successful_rps": 182.07, "vus_active": 1195 }, { - "achieved_rps": 167.07, + "attempted_rps": 167.07, "avg": 6915.62, "duration_s": 15, "failed": 972, @@ -121,6 +128,7 @@ "p99": 11711.95, "rate": 400, "requests": 2506, + "successful_rps": 102.27, "vus_active": 1 } ], diff --git a/evidence/track1/raw/ab#A#rep3.k6.json b/evidence/track1/raw/ab#A#rep3.k6.json index bb64b5c..0daf547 100644 --- a/evidence/track1/raw/ab#A#rep3.k6.json +++ b/evidence/track1/raw/ab#A#rep3.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 50.07, + "attempted_rps": 50.07, "avg": 6.51, "duration_s": 15, "failed": 0, @@ -30,10 +30,11 @@ "p99": 11.89, "rate": 50, "requests": 751, + "successful_rps": 50.07, "vus_active": 2 }, { - "achieved_rps": 100.07, + "attempted_rps": 100.07, "avg": 5.4, "duration_s": 15, "failed": 0, @@ -43,10 +44,11 @@ "p99": 10.79, "rate": 100, "requests": 1501, + "successful_rps": 100.07, "vus_active": 2 }, { - "achieved_rps": 150.07, + "attempted_rps": 150.07, "avg": 5.46, "duration_s": 15, "failed": 0, @@ -56,10 +58,11 @@ "p99": 14.74, "rate": 150, "requests": 2251, + "successful_rps": 150.07, "vus_active": 3 }, { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 12.43, "duration_s": 15, "failed": 0, @@ -69,10 +72,11 @@ "p99": 241.67, "rate": 200, "requests": 3001, + "successful_rps": 200.07, "vus_active": 4 }, { - "achieved_rps": 250.07, + "attempted_rps": 250.07, "avg": 8.42, "duration_s": 15, "failed": 0, @@ -82,10 +86,11 @@ "p99": 72.08, "rate": 250, "requests": 3751, + "successful_rps": 250.07, "vus_active": 4 }, { - "achieved_rps": 243.87, + "attempted_rps": 243.87, "avg": 2197.03, "duration_s": 15, "failed": 0, @@ -95,10 +100,11 @@ "p99": 7868.46, "rate": 300, "requests": 3658, + "successful_rps": 243.87, "vus_active": 1200 }, { - "achieved_rps": 187.93, + "attempted_rps": 187.93, "avg": 6785.89, "duration_s": 15, "failed": 1337, @@ -108,10 +114,11 @@ "p99": 12482.46, "rate": 350, "requests": 2819, + "successful_rps": 98.8, "vus_active": 1201 }, { - "achieved_rps": 226.73, + "attempted_rps": 226.73, "avg": 5291.43, "duration_s": 15, "failed": 1535, @@ -121,6 +128,7 @@ "p99": 9621.22, "rate": 400, "requests": 3401, + "successful_rps": 124.4, "vus_active": 1 } ], diff --git a/evidence/track1/raw/ab#B#rep1.k6.json b/evidence/track1/raw/ab#B#rep1.k6.json index 2164ab1..ebb559a 100644 --- a/evidence/track1/raw/ab#B#rep1.k6.json +++ b/evidence/track1/raw/ab#B#rep1.k6.json @@ -19,7 +19,7 @@ ], "steps": [ { - "achieved_rps": 50.07, + "attempted_rps": 50.07, "avg": 5.2, "duration_s": 15, "failed": 0, @@ -29,10 +29,11 @@ "p99": 9.29, "rate": 50, "requests": 751, + "successful_rps": 50.07, "vus_active": 2 }, { - "achieved_rps": 100, + "attempted_rps": 100.0, "avg": 4.86, "duration_s": 15, "failed": 0, @@ -42,10 +43,11 @@ "p99": 12.95, "rate": 100, "requests": 1500, + "successful_rps": 100.0, "vus_active": 1 }, { - "achieved_rps": 150, + "attempted_rps": 150.0, "avg": 4.82, "duration_s": 15, "failed": 0, @@ -55,10 +57,11 @@ "p99": 19.55, "rate": 150, "requests": 2250, + "successful_rps": 150.0, "vus_active": 1 }, { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 4.83, "duration_s": 15, "failed": 0, @@ -68,10 +71,11 @@ "p99": 20.47, "rate": 200, "requests": 3001, + "successful_rps": 200.07, "vus_active": 3 }, { - "achieved_rps": 250, + "attempted_rps": 250.0, "avg": 5.66, "duration_s": 15, "failed": 0, @@ -81,10 +85,11 @@ "p99": 50.6, "rate": 250, "requests": 3750, + "successful_rps": 250.0, "vus_active": 2 }, { - "achieved_rps": 300.07, + "attempted_rps": 300.07, "avg": 7.89, "duration_s": 15, "failed": 0, @@ -94,10 +99,11 @@ "p99": 109.61, "rate": 300, "requests": 4501, + "successful_rps": 300.07, "vus_active": 4 }, { - "achieved_rps": 348.13, + "attempted_rps": 348.13, "avg": 12.74, "duration_s": 15, "failed": 0, @@ -107,10 +113,11 @@ "p99": 270.31, "rate": 350, "requests": 5222, + "successful_rps": 348.13, "vus_active": 3 }, { - "achieved_rps": 400.07, + "attempted_rps": 400.07, "avg": 8.11, "duration_s": 15, "failed": 0, @@ -120,6 +127,7 @@ "p99": 91.04, "rate": 400, "requests": 6001, + "successful_rps": 400.07, "vus_active": 1 } ], diff --git a/evidence/track1/raw/ab#B#rep2.k6.json b/evidence/track1/raw/ab#B#rep2.k6.json index 460bebd..884c525 100644 --- a/evidence/track1/raw/ab#B#rep2.k6.json +++ b/evidence/track1/raw/ab#B#rep2.k6.json @@ -19,7 +19,7 @@ ], "steps": [ { - "achieved_rps": 50, + "attempted_rps": 50.0, "avg": 4.62, "duration_s": 15, "failed": 0, @@ -29,10 +29,11 @@ "p99": 7.39, "rate": 50, "requests": 750, + "successful_rps": 50.0, "vus_active": 1 }, { - "achieved_rps": 100, + "attempted_rps": 100.0, "avg": 4.42, "duration_s": 15, "failed": 0, @@ -42,10 +43,11 @@ "p99": 6.83, "rate": 100, "requests": 1500, + "successful_rps": 100.0, "vus_active": 1 }, { - "achieved_rps": 150.07, + "attempted_rps": 150.07, "avg": 4.67, "duration_s": 15, "failed": 0, @@ -55,10 +57,11 @@ "p99": 13.1, "rate": 150, "requests": 2251, + "successful_rps": 150.07, "vus_active": 2 }, { - "achieved_rps": 200, + "attempted_rps": 200.0, "avg": 5.31, "duration_s": 15, "failed": 0, @@ -68,10 +71,11 @@ "p99": 25.51, "rate": 200, "requests": 3000, + "successful_rps": 200.0, "vus_active": 1 }, { - "achieved_rps": 250.07, + "attempted_rps": 250.07, "avg": 5.18, "duration_s": 15, "failed": 0, @@ -81,10 +85,11 @@ "p99": 19.08, "rate": 250, "requests": 3751, + "successful_rps": 250.07, "vus_active": 4 }, { - "achieved_rps": 300.07, + "attempted_rps": 300.07, "avg": 4.9, "duration_s": 15, "failed": 0, @@ -94,10 +99,11 @@ "p99": 21.47, "rate": 300, "requests": 4501, + "successful_rps": 300.07, "vus_active": 4 }, { - "achieved_rps": 348.6, + "attempted_rps": 348.6, "avg": 22.03, "duration_s": 15, "failed": 0, @@ -107,10 +113,11 @@ "p99": 329.83, "rate": 350, "requests": 5229, + "successful_rps": 348.6, "vus_active": 3 }, { - "achieved_rps": 400.07, + "attempted_rps": 400.07, "avg": 7.25, "duration_s": 15, "failed": 0, @@ -120,6 +127,7 @@ "p99": 73.99, "rate": 400, "requests": 6001, + "successful_rps": 400.07, "vus_active": 1 } ], diff --git a/evidence/track1/raw/ab#B#rep3.k6.json b/evidence/track1/raw/ab#B#rep3.k6.json index 831048b..2fdd56c 100644 --- a/evidence/track1/raw/ab#B#rep3.k6.json +++ b/evidence/track1/raw/ab#B#rep3.k6.json @@ -19,7 +19,7 @@ ], "steps": [ { - "achieved_rps": 50.07, + "attempted_rps": 50.07, "avg": 5.35, "duration_s": 15, "failed": 0, @@ -29,10 +29,11 @@ "p99": 8.85, "rate": 50, "requests": 751, + "successful_rps": 50.07, "vus_active": 2 }, { - "achieved_rps": 100.07, + "attempted_rps": 100.07, "avg": 4.52, "duration_s": 15, "failed": 0, @@ -42,10 +43,11 @@ "p99": 7.86, "rate": 100, "requests": 1501, + "successful_rps": 100.07, "vus_active": 2 }, { - "achieved_rps": 150.07, + "attempted_rps": 150.07, "avg": 4.29, "duration_s": 15, "failed": 0, @@ -55,10 +57,11 @@ "p99": 8.75, "rate": 150, "requests": 2251, + "successful_rps": 150.07, "vus_active": 2 }, { - "achieved_rps": 198.93, + "attempted_rps": 198.93, "avg": 16.7, "duration_s": 15, "failed": 0, @@ -68,10 +71,11 @@ "p99": 435.11, "rate": 200, "requests": 2984, + "successful_rps": 198.93, "vus_active": 2 }, { - "achieved_rps": 250.07, + "attempted_rps": 250.07, "avg": 8.19, "duration_s": 15, "failed": 0, @@ -81,10 +85,11 @@ "p99": 114.79, "rate": 250, "requests": 3751, + "successful_rps": 250.07, "vus_active": 9 }, { - "achieved_rps": 300.07, + "attempted_rps": 300.07, "avg": 5.68, "duration_s": 15, "failed": 0, @@ -94,10 +99,11 @@ "p99": 43.48, "rate": 300, "requests": 4501, + "successful_rps": 300.07, "vus_active": 3 }, { - "achieved_rps": 350.07, + "attempted_rps": 350.07, "avg": 5.46, "duration_s": 15, "failed": 0, @@ -107,10 +113,11 @@ "p99": 35.7, "rate": 350, "requests": 5251, + "successful_rps": 350.07, "vus_active": 4 }, { - "achieved_rps": 399.93, + "attempted_rps": 399.93, "avg": 13.8, "duration_s": 15, "failed": 0, @@ -120,6 +127,7 @@ "p99": 173.89, "rate": 400, "requests": 5999, + "successful_rps": 399.93, "vus_active": 1 } ], diff --git a/evidence/track1/raw/abdiag#A#rep1.k6.json b/evidence/track1/raw/abdiag#A#rep1.k6.json index 2724a39..df06626 100644 --- a/evidence/track1/raw/abdiag#A#rep1.k6.json +++ b/evidence/track1/raw/abdiag#A#rep1.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 50.07, + "attempted_rps": 50.07, "avg": 6.23, "duration_s": 15, "failed": 0, @@ -36,10 +36,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 50.07, "vus_active": 0 }, { - "achieved_rps": 100.07, + "attempted_rps": 100.07, "avg": 7.76, "duration_s": 15, "failed": 0, @@ -55,10 +56,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 100.07, "vus_active": 0 }, { - "achieved_rps": 150.07, + "attempted_rps": 150.07, "avg": 11.07, "duration_s": 15, "failed": 0, @@ -74,10 +76,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 150.07, "vus_active": 0 }, { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 5.99, "duration_s": 15, "failed": 0, @@ -93,10 +96,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 200.07, "vus_active": 0 }, { - "achieved_rps": 250, + "attempted_rps": 250.0, "avg": 6.94, "duration_s": 15, "failed": 0, @@ -112,10 +116,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 250.0, "vus_active": 0 }, { - "achieved_rps": 231.47, + "attempted_rps": 231.47, "avg": 2611.89, "duration_s": 15, "failed": 0, @@ -131,10 +136,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 231.47, "vus_active": 0 }, { - "achieved_rps": 108.73, + "attempted_rps": 108.73, "avg": 9466.18, "duration_s": 15, "failed": 356, @@ -150,10 +156,11 @@ "other": 0, "server_5xx": 356 }, + "successful_rps": 85.0, "vus_active": 918 }, { - "achieved_rps": 131.87, + "attempted_rps": 131.87, "avg": 7990.69, "duration_s": 15, "failed": 1125, @@ -169,6 +176,7 @@ "other": 0, "server_5xx": 1125 }, + "successful_rps": 56.87, "vus_active": 335 } ], diff --git a/evidence/track1/raw/abdiag#A#rep2.k6.json b/evidence/track1/raw/abdiag#A#rep2.k6.json index b07ced3..ff0770e 100644 --- a/evidence/track1/raw/abdiag#A#rep2.k6.json +++ b/evidence/track1/raw/abdiag#A#rep2.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 50.07, + "attempted_rps": 50.07, "avg": 6.02, "duration_s": 15, "failed": 0, @@ -36,10 +36,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 50.07, "vus_active": 0 }, { - "achieved_rps": 100.07, + "attempted_rps": 100.07, "avg": 5.64, "duration_s": 15, "failed": 0, @@ -55,10 +56,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 100.07, "vus_active": 0 }, { - "achieved_rps": 150.07, + "attempted_rps": 150.07, "avg": 6.93, "duration_s": 15, "failed": 0, @@ -74,10 +76,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 150.07, "vus_active": 0 }, { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 5.75, "duration_s": 15, "failed": 0, @@ -93,10 +96,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 200.07, "vus_active": 0 }, { - "achieved_rps": 249.2, + "attempted_rps": 249.2, "avg": 16.31, "duration_s": 15, "failed": 0, @@ -112,10 +116,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 249.2, "vus_active": 0 }, { - "achieved_rps": 228.27, + "attempted_rps": 228.27, "avg": 2772.29, "duration_s": 15, "failed": 0, @@ -131,10 +136,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 228.27, "vus_active": 0 }, { - "achieved_rps": 107.4, + "attempted_rps": 107.4, "avg": 9791.12, "duration_s": 15, "failed": 211, @@ -150,10 +156,11 @@ "other": 0, "server_5xx": 211 }, + "successful_rps": 93.33, "vus_active": 933 }, { - "achieved_rps": 148.47, + "attempted_rps": 148.47, "avg": 6814.84, "duration_s": 15, "failed": 721, @@ -169,6 +176,7 @@ "other": 0, "server_5xx": 721 }, + "successful_rps": 100.4, "vus_active": 177 } ], diff --git a/evidence/track1/raw/abdiag#A#rep3.k6.json b/evidence/track1/raw/abdiag#A#rep3.k6.json index 1f2eff5..3b64029 100644 --- a/evidence/track1/raw/abdiag#A#rep3.k6.json +++ b/evidence/track1/raw/abdiag#A#rep3.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 50.07, + "attempted_rps": 50.07, "avg": 5.7, "duration_s": 15, "failed": 0, @@ -36,10 +36,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 50.07, "vus_active": 0 }, { - "achieved_rps": 100.07, + "attempted_rps": 100.07, "avg": 5.14, "duration_s": 15, "failed": 0, @@ -55,10 +56,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 100.07, "vus_active": 0 }, { - "achieved_rps": 150.07, + "attempted_rps": 150.07, "avg": 4.84, "duration_s": 15, "failed": 0, @@ -74,10 +76,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 150.07, "vus_active": 0 }, { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 4.98, "duration_s": 15, "failed": 0, @@ -93,10 +96,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 200.07, "vus_active": 0 }, { - "achieved_rps": 250.07, + "attempted_rps": 250.07, "avg": 5.48, "duration_s": 15, "failed": 0, @@ -112,10 +116,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 250.07, "vus_active": 0 }, { - "achieved_rps": 244.73, + "attempted_rps": 244.73, "avg": 1856.08, "duration_s": 15, "failed": 4, @@ -131,10 +136,11 @@ "other": 0, "server_5xx": 4 }, + "successful_rps": 244.47, "vus_active": 912 }, { - "achieved_rps": 108.53, + "attempted_rps": 108.53, "avg": 9229.15, "duration_s": 15, "failed": 327, @@ -150,10 +156,11 @@ "other": 0, "server_5xx": 327 }, + "successful_rps": 86.73, "vus_active": 935 }, { - "achieved_rps": 132.73, + "attempted_rps": 132.73, "avg": 7901.66, "duration_s": 15, "failed": 967, @@ -169,6 +176,7 @@ "other": 0, "server_5xx": 967 }, + "successful_rps": 68.27, "vus_active": 429 } ], diff --git a/evidence/track1/raw/abdiag#B#rep1.k6.json b/evidence/track1/raw/abdiag#B#rep1.k6.json index fca1093..3d6f48b 100644 --- a/evidence/track1/raw/abdiag#B#rep1.k6.json +++ b/evidence/track1/raw/abdiag#B#rep1.k6.json @@ -19,7 +19,7 @@ ], "steps": [ { - "achieved_rps": 50.07, + "attempted_rps": 50.07, "avg": 5.08, "duration_s": 15, "failed": 0, @@ -35,10 +35,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 50.07, "vus_active": 0 }, { - "achieved_rps": 100.07, + "attempted_rps": 100.07, "avg": 5.39, "duration_s": 15, "failed": 0, @@ -54,10 +55,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 100.07, "vus_active": 0 }, { - "achieved_rps": 150.07, + "attempted_rps": 150.07, "avg": 4.07, "duration_s": 15, "failed": 0, @@ -73,10 +75,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 150.07, "vus_active": 0 }, { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 5.23, "duration_s": 15, "failed": 0, @@ -92,10 +95,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 200.07, "vus_active": 0 }, { - "achieved_rps": 250.07, + "attempted_rps": 250.07, "avg": 4.49, "duration_s": 15, "failed": 0, @@ -111,10 +115,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 250.07, "vus_active": 0 }, { - "achieved_rps": 300.07, + "attempted_rps": 300.07, "avg": 5.29, "duration_s": 15, "failed": 0, @@ -130,10 +135,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 300.07, "vus_active": 0 }, { - "achieved_rps": 348.67, + "attempted_rps": 348.67, "avg": 10.71, "duration_s": 15, "failed": 0, @@ -149,10 +155,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 348.67, "vus_active": 0 }, { - "achieved_rps": 397.6, + "attempted_rps": 397.6, "avg": 19.37, "duration_s": 15, "failed": 0, @@ -168,6 +175,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 397.6, "vus_active": 0 } ], diff --git a/evidence/track1/raw/abdiag#B#rep2.k6.json b/evidence/track1/raw/abdiag#B#rep2.k6.json index 5ef0c34..da905e5 100644 --- a/evidence/track1/raw/abdiag#B#rep2.k6.json +++ b/evidence/track1/raw/abdiag#B#rep2.k6.json @@ -19,7 +19,7 @@ ], "steps": [ { - "achieved_rps": 50.07, + "attempted_rps": 50.07, "avg": 4.62, "duration_s": 15, "failed": 0, @@ -35,10 +35,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 50.07, "vus_active": 0 }, { - "achieved_rps": 100.07, + "attempted_rps": 100.07, "avg": 4.2, "duration_s": 15, "failed": 0, @@ -54,10 +55,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 100.07, "vus_active": 0 }, { - "achieved_rps": 150.07, + "attempted_rps": 150.07, "avg": 4.27, "duration_s": 15, "failed": 0, @@ -73,10 +75,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 150.07, "vus_active": 0 }, { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 4.43, "duration_s": 15, "failed": 0, @@ -92,10 +95,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 200.07, "vus_active": 0 }, { - "achieved_rps": 250.07, + "attempted_rps": 250.07, "avg": 5.29, "duration_s": 15, "failed": 0, @@ -111,10 +115,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 250.07, "vus_active": 0 }, { - "achieved_rps": 299.4, + "attempted_rps": 299.4, "avg": 11.82, "duration_s": 15, "failed": 0, @@ -130,10 +135,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 299.4, "vus_active": 0 }, { - "achieved_rps": 350.07, + "attempted_rps": 350.07, "avg": 5.09, "duration_s": 15, "failed": 0, @@ -149,10 +155,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 350.07, "vus_active": 0 }, { - "achieved_rps": 400.07, + "attempted_rps": 400.07, "avg": 5.64, "duration_s": 15, "failed": 0, @@ -168,6 +175,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 400.07, "vus_active": 0 } ], diff --git a/evidence/track1/raw/abdiag#B#rep3.k6.json b/evidence/track1/raw/abdiag#B#rep3.k6.json index dc3682c..d374e24 100644 --- a/evidence/track1/raw/abdiag#B#rep3.k6.json +++ b/evidence/track1/raw/abdiag#B#rep3.k6.json @@ -19,7 +19,7 @@ ], "steps": [ { - "achieved_rps": 50.07, + "attempted_rps": 50.07, "avg": 4.83, "duration_s": 15, "failed": 0, @@ -35,10 +35,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 50.07, "vus_active": 0 }, { - "achieved_rps": 100.07, + "attempted_rps": 100.07, "avg": 4.74, "duration_s": 15, "failed": 0, @@ -54,10 +55,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 100.07, "vus_active": 0 }, { - "achieved_rps": 150.07, + "attempted_rps": 150.07, "avg": 4.36, "duration_s": 15, "failed": 0, @@ -73,10 +75,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 150.07, "vus_active": 0 }, { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 4.17, "duration_s": 15, "failed": 0, @@ -92,10 +95,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 200.07, "vus_active": 0 }, { - "achieved_rps": 250.07, + "attempted_rps": 250.07, "avg": 4.61, "duration_s": 15, "failed": 0, @@ -111,10 +115,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 250.07, "vus_active": 0 }, { - "achieved_rps": 300, + "attempted_rps": 300.0, "avg": 5.21, "duration_s": 15, "failed": 0, @@ -130,10 +135,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 300.0, "vus_active": 0 }, { - "achieved_rps": 349.8, + "attempted_rps": 349.8, "avg": 10.05, "duration_s": 15, "failed": 0, @@ -149,10 +155,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 349.8, "vus_active": 0 }, { - "achieved_rps": 398.67, + "attempted_rps": 398.67, "avg": 13.43, "duration_s": 15, "failed": 0, @@ -168,6 +175,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 398.67, "vus_active": 0 } ], diff --git a/evidence/track1/raw/block#n1#rep1.k6.json b/evidence/track1/raw/block#n1#rep1.k6.json index 97abd09..601af05 100644 --- a/evidence/track1/raw/block#n1#rep1.k6.json +++ b/evidence/track1/raw/block#n1#rep1.k6.json @@ -19,7 +19,7 @@ ], "steps": [ { - "achieved_rps": 889.85, + "attempted_rps": 889.85, "avg": 56.47, "duration_s": 60, "failed": 0, @@ -35,6 +35,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 889.85, "vus_active": 0 } ], diff --git a/evidence/track1/raw/block#n1#rep2.k6.json b/evidence/track1/raw/block#n1#rep2.k6.json index cb0f95f..3c30ef1 100644 --- a/evidence/track1/raw/block#n1#rep2.k6.json +++ b/evidence/track1/raw/block#n1#rep2.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 862.98, + "attempted_rps": 862.98, "avg": 477.87, "duration_s": 60, "failed": 0, @@ -36,6 +36,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 862.98, "vus_active": 0 } ], diff --git a/evidence/track1/raw/block#n4#rep1.k6.json b/evidence/track1/raw/block#n4#rep1.k6.json index 21ae1a8..5b31ef1 100644 --- a/evidence/track1/raw/block#n4#rep1.k6.json +++ b/evidence/track1/raw/block#n4#rep1.k6.json @@ -19,7 +19,7 @@ ], "steps": [ { - "achieved_rps": 893.92, + "attempted_rps": 893.92, "avg": 76.95, "duration_s": 60, "failed": 0, @@ -35,6 +35,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 893.92, "vus_active": 0 } ], diff --git a/evidence/track1/raw/block#n4#rep2.k6.json b/evidence/track1/raw/block#n4#rep2.k6.json index ff6103a..a60562b 100644 --- a/evidence/track1/raw/block#n4#rep2.k6.json +++ b/evidence/track1/raw/block#n4#rep2.k6.json @@ -19,7 +19,7 @@ ], "steps": [ { - "achieved_rps": 892, + "attempted_rps": 892.0, "avg": 158.25, "duration_s": 60, "failed": 0, @@ -35,6 +35,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 892.0, "vus_active": 0 } ], diff --git a/evidence/track1/raw/block#n4-api6#rep1.k6.json b/evidence/track1/raw/block#n4-api6#rep1.k6.json index be390ba..4d92746 100644 --- a/evidence/track1/raw/block#n4-api6#rep1.k6.json +++ b/evidence/track1/raw/block#n4-api6#rep1.k6.json @@ -19,7 +19,7 @@ ], "steps": [ { - "achieved_rps": 886.72, + "attempted_rps": 886.72, "avg": 216.06, "duration_s": 60, "failed": 0, @@ -35,6 +35,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 886.72, "vus_active": 0 } ], diff --git a/evidence/track1/raw/block#n4-api6#rep2.k6.json b/evidence/track1/raw/block#n4-api6#rep2.k6.json index a885945..56b9ded 100644 --- a/evidence/track1/raw/block#n4-api6#rep2.k6.json +++ b/evidence/track1/raw/block#n4-api6#rep2.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 853.1, + "attempted_rps": 853.1, "avg": 606.8, "duration_s": 60, "failed": 0, @@ -36,6 +36,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 853.1, "vus_active": 0 } ], diff --git a/evidence/track1/raw/failover#3adeb4c637a0.k6.json b/evidence/track1/raw/failover#3adeb4c637a0.k6.json index 145ccd1..dc7e20f 100644 --- a/evidence/track1/raw/failover#3adeb4c637a0.k6.json +++ b/evidence/track1/raw/failover#3adeb4c637a0.k6.json @@ -14,7 +14,7 @@ "profile": "spread", "steps": [ { - "achieved_rps": 200.02, + "attempted_rps": 200.02, "avg": 4, "duration_s": 58, "failed": 0, @@ -24,6 +24,7 @@ "p99": 8.95, "rate": 200, "requests": 11601, + "successful_rps": 200.02, "vus_active": 1 } ], diff --git a/evidence/track1/raw/failover#3ae9682cb023.k6.json b/evidence/track1/raw/failover#3ae9682cb023.k6.json index d53e887..34b5070 100644 --- a/evidence/track1/raw/failover#3ae9682cb023.k6.json +++ b/evidence/track1/raw/failover#3ae9682cb023.k6.json @@ -14,7 +14,7 @@ "profile": "spread", "steps": [ { - "achieved_rps": 200.02, + "attempted_rps": 200.02, "avg": 3.85, "duration_s": 58, "failed": 0, @@ -30,6 +30,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 200.02, "vus_active": 0 } ], diff --git a/evidence/track1/raw/failover#438cdb0e0de6.k6.json b/evidence/track1/raw/failover#438cdb0e0de6.k6.json index eb97f26..9a69d53 100644 --- a/evidence/track1/raw/failover#438cdb0e0de6.k6.json +++ b/evidence/track1/raw/failover#438cdb0e0de6.k6.json @@ -14,7 +14,7 @@ "profile": "spread", "steps": [ { - "achieved_rps": 200.02, + "attempted_rps": 200.02, "avg": 5.57, "duration_s": 58, "failed": 0, @@ -24,6 +24,7 @@ "p99": 24.44, "rate": 200, "requests": 11601, + "successful_rps": 200.02, "vus_active": 1 } ], diff --git a/evidence/track1/raw/failover#63edcffba23f.k6.json b/evidence/track1/raw/failover#63edcffba23f.k6.json index 2caacaf..f312cba 100644 --- a/evidence/track1/raw/failover#63edcffba23f.k6.json +++ b/evidence/track1/raw/failover#63edcffba23f.k6.json @@ -14,7 +14,7 @@ "profile": "spread", "steps": [ { - "achieved_rps": 200.02, + "attempted_rps": 200.02, "avg": 4.67, "duration_s": 58, "failed": 0, @@ -24,6 +24,7 @@ "p99": 10.34, "rate": 200, "requests": 11601, + "successful_rps": 200.02, "vus_active": 1 } ], diff --git a/evidence/track1/raw/failover#93d6ac125b68.k6.json b/evidence/track1/raw/failover#93d6ac125b68.k6.json index 1ae2883..9618fff 100644 --- a/evidence/track1/raw/failover#93d6ac125b68.k6.json +++ b/evidence/track1/raw/failover#93d6ac125b68.k6.json @@ -14,7 +14,7 @@ "profile": "spread", "steps": [ { - "achieved_rps": 200.02, + "attempted_rps": 200.02, "avg": 8.08, "duration_s": 58, "failed": 0, @@ -30,6 +30,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 200.02, "vus_active": 0 } ], diff --git a/evidence/track1/raw/failover#e4b62a206858.k6.json b/evidence/track1/raw/failover#e4b62a206858.k6.json index 0ad1ef3..f65cfc4 100644 --- a/evidence/track1/raw/failover#e4b62a206858.k6.json +++ b/evidence/track1/raw/failover#e4b62a206858.k6.json @@ -14,7 +14,7 @@ "profile": "spread", "steps": [ { - "achieved_rps": 200.02, + "attempted_rps": 200.02, "avg": 3.8, "duration_s": 58, "failed": 0, @@ -24,6 +24,7 @@ "p99": 7.83, "rate": 200, "requests": 11601, + "successful_rps": 200.02, "vus_active": 1 } ], diff --git a/evidence/track1/raw/growth#api-total-6-900.k6.json b/evidence/track1/raw/growth#api-total-6-900.k6.json deleted file mode 100644 index 2dd92a1..0000000 --- a/evidence/track1/raw/growth#api-total-6-900.k6.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "base_url": "http://haproxy:8080", - "checks": { - "fails": 0, - "passes": 0 - }, - "dropped_iterations": 913, - "exit_code": 0, - "http_req_duration_p95": 604.64, - "http_reqs": 53119, - "iterations": 53089, - "kind": "steady", - "label": "growth#api-total-6-900", - "mode": "write", - "profile": "spread", - "seed_messages_per_chat": 0, - "stderr_tail": [ - "Container mtusi-lab3-loadgen-run-2c232a831987 Creating ", - " Container mtusi-lab3-loadgen-run-2c232a831987 Created" - ], - "steps": [ - { - "achieved_rps": 884.82, - "avg": 105.87, - "duration_s": 60, - "failed": 0, - "max": 1028.21, - "p50": 6.63, - "p95": 604.71, - "p99": 778.37, - "rate": 900, - "requests": 53089, - "status": { - "client_4xx": 0, - "ok": 53089, - "other": 0, - "server_5xx": 0 - }, - "vus_active": 615 - } - ], - "vus_configured": { - "max": 900, - "preAllocated": 60 - }, - "vus_max": 616 -} diff --git a/evidence/track1/raw/growth#api-total-6-900.manifest.json b/evidence/track1/raw/growth#api-total-6-900.manifest.json deleted file mode 100644 index f402c60..0000000 --- a/evidence/track1/raw/growth#api-total-6-900.manifest.json +++ /dev/null @@ -1,177 +0,0 @@ -{ - "commit": "6cced49486011d9a8fe15628944e331edb700bcd", - "dataset": { - "chat_members": 6273, - "chats": 2123, - "idempotency_keys": 3438382, - "messages": 3438382, - "users": 365 - }, - "finished_at": "2026-10-16T12:54:22Z", - "generator": { - "cpus": "1.5", - "max_vus": "900", - "memory": "1024m", - "pre_vus": "60" - }, - "host": { - "background": { - "load_average": [ - 12.8, - 10.35, - 9.91 - ], - "mem_available_mib": 6603, - "mem_total_mib": 15771, - "quiesced": true - }, - "cpus": 8 - }, - "kind": "steady", - "label": "growth#api-total-6-900", - "mode": "write", - "observed_stand": { - "api": [ - { - "container": "a8108803534a", - "cpus": 1.5, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-3", - "pool_max": 10 - }, - { - "container": "6160d09b9510", - "cpus": 1.5, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-6", - "pool_max": 10 - }, - { - "container": "25561c10c440", - "cpus": 1.5, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-5", - "pool_max": 10 - }, - { - "container": "8659b0db1891", - "cpus": 1.5, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-4", - "pool_max": 10 - } - ], - "haproxy": [ - { - "container": "ec593c7cf5e2", - "cpus": 0.25, - "image_id": "sha256:254e6370f01cd654e0744edf607c67f33777c1b6a9dc0d4b28bcba7171460122", - "memory_bytes": 134217728, - "name": "mtusi-lab3-haproxy-1" - } - ], - "postgres": [ - { - "container": "7f02978f8ed1", - "cpus": 1.5, - "image_id": "sha256:5660c2cbfea50c7a9127d17dc4e48543eedd3d7a41a595a2dfa572471e37e64c", - "memory_bytes": 536870912, - "name": "mtusi-lab3-postgres-1" - } - ], - "redis": [ - { - "container": "cca316e66b57", - "cpus": 0.25, - "image_id": "sha256:02419de7eddf55aa5bcf49efb74e88fa8d931b4d77c07eff8a6b2144472b6952", - "memory_bytes": 134217728, - "name": "mtusi-lab3-redis-1" - } - ] - }, - "phases": {}, - "profile": "spread", - "quiesce": { - "started_at": "2026-10-16T12:30:13Z", - "stopped": [ - "lampa", - "caddy", - "redis", - "sql-lab-db-1", - "redis-lab-redis-1" - ] - }, - "replicas": { - "25561c10c440": { - "container": "25561c10c440", - "cpus": 1.5, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-5", - "started_at": "2026-10-16T12:52:42.178202775Z" - }, - "6160d09b9510": { - "container": "6160d09b9510", - "cpus": 1.5, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-6", - "started_at": "2026-10-16T12:52:42.059806514Z" - }, - "8659b0db1891": { - "container": "8659b0db1891", - "cpus": 1.5, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-4", - "started_at": "2026-10-16T12:52:42.316245054Z" - }, - "a8108803534a": { - "container": "a8108803534a", - "cpus": 1.5, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-3", - "started_at": "2026-10-16T12:52:41.94020557Z" - } - }, - "sample_count": 1535, - "sampler_errors": [], - "stand": { - "API_CPUS_PER_REPLICA": "1.5", - "API_IMAGE": "mtusi-messenger:lab3", - "API_MEMORY_PER_REPLICA": "384m", - "API_REPLICAS": "4", - "API_TOTAL_CPUS": "6.0", - "API_TOTAL_MEMORY_MB": "1536", - "BUILD_ID": "base", - "DATABASE_POOL_MAX": "10", - "LB_CPUS": "0.25", - "LB_MEMORY": "128m", - "LOADGEN_CPUS": "1.5", - "LOADGEN_MEMORY": "1024m", - "PG_CPUS": "1.5", - "PG_MEMORY": "512m", - "REDIS_CPUS": "0.25", - "REDIS_MEMORY": "128m" - }, - "started_at": "2026-10-16T12:53:20Z", - "step_seconds": 60, - "steps": [ - 900 - ], - "versions": { - "haproxy": "haproxy:3.2-alpine", - "haproxy_runtime": "HAProxy version 3.2.26-3e0f11a 2026/10/14 - https://haproxy.org/", - "k6": "k6 v0.54.0 (commit/baba871c8a, go1.23.1, linux/amd64)", - "node_host": "v25.7.0", - "postgres": "postgres:16.4-alpine", - "postgres_runtime": "postgres (PostgreSQL) 16.4", - "redis": "redis:7.4.2-alpine", - "redis_runtime": "Redis server v=7.4.2 sha=00000000:0 malloc=jemalloc-5.3.0 bits=64 build=9d14eaf5f599583e" - } -} diff --git a/evidence/track1/raw/growth#api-total-6-900.samples.jsonl.gz b/evidence/track1/raw/growth#api-total-6-900.samples.jsonl.gz deleted file mode 100644 index 34c7b49..0000000 Binary files a/evidence/track1/raw/growth#api-total-6-900.samples.jsonl.gz and /dev/null differ diff --git a/evidence/track1/raw/growth#api-total-6.k6.json b/evidence/track1/raw/growth#api-total-6.k6.json deleted file mode 100644 index 3fa19a4..0000000 --- a/evidence/track1/raw/growth#api-total-6.k6.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "base_url": "http://haproxy:8080", - "checks": { - "fails": 0, - "passes": 0 - }, - "dropped_iterations": 63, - "exit_code": 0, - "http_req_duration_p95": 8.77, - "http_reqs": 33568, - "iterations": 33538, - "kind": "steady", - "label": "growth#api-total-6", - "mode": "write", - "profile": "spread", - "stderr_tail": [ - "Container mtusi-lab3-loadgen-run-6718f9012a82 Creating ", - " Container mtusi-lab3-loadgen-run-6718f9012a82 Created" - ], - "steps": [ - { - "achieved_rps": 558.97, - "avg": 5.7, - "duration_s": 60, - "failed": 0, - "max": 355.27, - "p50": 3.75, - "p95": 8.75, - "p99": 45.01, - "rate": 560, - "requests": 33538, - "status": { - "client_4xx": 0, - "ok": 33538, - "other": 0, - "server_5xx": 0 - }, - "vus_active": 0 - } - ], - "vus_configured": { - "max": 200, - "preAllocated": 60 - }, - "vus_max": 118 -} diff --git a/evidence/track1/raw/growth#api-total-6.manifest.json b/evidence/track1/raw/growth#api-total-6.manifest.json deleted file mode 100644 index 45e957d..0000000 --- a/evidence/track1/raw/growth#api-total-6.manifest.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "commit": "e38795d0a39c20960049f84bf6b301832804964d", - "dataset": { - "chat_members": 1602, - "chats": 541, - "idempotency_keys": 935512, - "messages": 935512, - "users": 90 - }, - "finished_at": "2026-10-15T22:45:07Z", - "generator": { - "cpus": "1.5", - "max_vus": "200", - "memory": "256m", - "pre_vus": "60" - }, - "host": { - "background": { - "load_average": [ - 7.37, - 9.56, - 8.94 - ], - "mem_available_mib": 4604, - "mem_total_mib": 15771, - "quiesced": false - }, - "cpus": 8 - }, - "kind": "steady", - "label": "growth#api-total-6", - "mode": "write", - "phases": {}, - "profile": "spread", - "quiesce": null, - "replicas": { - "218dda61d170": { - "container": "218dda61d170", - "cpus": 1.5, - "image_id": "sha256:2ff9aa617ac17b3454a138b81320470fbed2a70ce9ea0d9fb9914b2ffb5461ab", - "memory_mb": 384, - "name": "mtusi-lab3-api-1", - "started_at": "2026-10-15T22:43:26.55538141Z" - }, - "a7fcfba3f468": { - "container": "a7fcfba3f468", - "cpus": 1.5, - "image_id": "sha256:2ff9aa617ac17b3454a138b81320470fbed2a70ce9ea0d9fb9914b2ffb5461ab", - "memory_mb": 384, - "name": "mtusi-lab3-api-2", - "started_at": "2026-10-15T22:43:26.336824177Z" - }, - "c0731a92aad6": { - "container": "c0731a92aad6", - "cpus": 1.5, - "image_id": "sha256:2ff9aa617ac17b3454a138b81320470fbed2a70ce9ea0d9fb9914b2ffb5461ab", - "memory_mb": 384, - "name": "mtusi-lab3-api-4", - "started_at": "2026-10-15T22:43:26.883999047Z" - }, - "d743189956e4": { - "container": "d743189956e4", - "cpus": 1.5, - "image_id": "sha256:2ff9aa617ac17b3454a138b81320470fbed2a70ce9ea0d9fb9914b2ffb5461ab", - "memory_mb": 384, - "name": "mtusi-lab3-api-3", - "started_at": "2026-10-15T22:43:26.719194441Z" - } - }, - "sample_count": 1634, - "sampler_errors": [], - "stand": { - "API_CPUS_PER_REPLICA": "1.5", - "API_IMAGE": "mtusi-messenger:lab3", - "API_MEMORY_PER_REPLICA": "384m", - "API_REPLICAS": "4", - "API_TOTAL_CPUS": "6.0", - "API_TOTAL_MEMORY_MB": "1536", - "BUILD_ID": "base", - "DATABASE_POOL_MAX": "10", - "LB_CPUS": "0.25", - "LB_MEMORY": "128m", - "LOADGEN_CPUS": "1.5", - "LOADGEN_MEMORY": "256m", - "PG_CPUS": "1.5", - "PG_MEMORY": "512m", - "REDIS_CPUS": "0.25", - "REDIS_MEMORY": "128m" - }, - "started_at": "2026-10-15T22:44:05Z", - "step_seconds": 60, - "steps": [ - 560 - ], - "versions": { - "haproxy": "haproxy:3.2-alpine", - "haproxy_runtime": "HAProxy version 3.2.26-3e0f11a 2026/10/14 - https://haproxy.org/", - "k6": "k6 v0.54.0 (commit/baba871c8a, go1.23.1, linux/amd64)", - "node_host": "v25.7.0", - "postgres": "postgres:16.4-alpine", - "postgres_runtime": "postgres (PostgreSQL) 16.4", - "redis": "redis:7.4.2-alpine", - "redis_runtime": "Redis server v=7.4.2 sha=00000000:0 malloc=jemalloc-5.3.0 bits=64 build=9d14eaf5f599583e" - } -} diff --git a/evidence/track1/raw/growth#api-total-6.samples.jsonl.gz b/evidence/track1/raw/growth#api-total-6.samples.jsonl.gz deleted file mode 100644 index 36b2f5e..0000000 Binary files a/evidence/track1/raw/growth#api-total-6.samples.jsonl.gz and /dev/null differ diff --git a/evidence/track1/raw/growth#api6-pg3-900.k6.json b/evidence/track1/raw/growth#api6-pg3-900.k6.json deleted file mode 100644 index c10f1a5..0000000 --- a/evidence/track1/raw/growth#api6-pg3-900.k6.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "base_url": "http://haproxy:8080", - "checks": { - "fails": 0, - "passes": 0 - }, - "dropped_iterations": 107, - "exit_code": 0, - "http_req_duration_p95": 20.38, - "http_reqs": 53924, - "iterations": 53894, - "kind": "steady", - "label": "growth#api6-pg3-900", - "mode": "write", - "profile": "spread", - "seed_messages_per_chat": 0, - "stderr_tail": [ - "Container mtusi-lab3-loadgen-run-cc022370b727 Creating ", - " Container mtusi-lab3-loadgen-run-cc022370b727 Created" - ], - "steps": [ - { - "achieved_rps": 898.23, - "avg": 8.25, - "duration_s": 60, - "failed": 0, - "max": 351.62, - "p50": 5.07, - "p95": 20.37, - "p99": 66.45, - "rate": 900, - "requests": 53894, - "status": { - "client_4xx": 0, - "ok": 53894, - "other": 0, - "server_5xx": 0 - }, - "vus_active": 105 - } - ], - "vus_configured": { - "max": 900, - "preAllocated": 60 - }, - "vus_max": 106 -} diff --git a/evidence/track1/raw/growth#api6-pg3-900.manifest.json b/evidence/track1/raw/growth#api6-pg3-900.manifest.json deleted file mode 100644 index a453ccb..0000000 --- a/evidence/track1/raw/growth#api6-pg3-900.manifest.json +++ /dev/null @@ -1,177 +0,0 @@ -{ - "commit": "6cced49486011d9a8fe15628944e331edb700bcd", - "dataset": { - "chat_members": 6417, - "chats": 2171, - "idempotency_keys": 3519108, - "messages": 3519108, - "users": 371 - }, - "finished_at": "2026-10-16T12:56:19Z", - "generator": { - "cpus": "2.0", - "max_vus": "900", - "memory": "1024m", - "pre_vus": "60" - }, - "host": { - "background": { - "load_average": [ - 13.44, - 11.14, - 10.23 - ], - "mem_available_mib": 6546, - "mem_total_mib": 15771, - "quiesced": true - }, - "cpus": 8 - }, - "kind": "steady", - "label": "growth#api6-pg3-900", - "mode": "write", - "observed_stand": { - "api": [ - { - "container": "d206ccc1c81e", - "cpus": 1.5, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-4", - "pool_max": 20 - }, - { - "container": "9a9ee612a332", - "cpus": 1.5, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-3", - "pool_max": 20 - }, - { - "container": "ca9bab0424ee", - "cpus": 1.5, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-5", - "pool_max": 20 - }, - { - "container": "a60d478514bb", - "cpus": 1.5, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-6", - "pool_max": 20 - } - ], - "haproxy": [ - { - "container": "ec593c7cf5e2", - "cpus": 0.25, - "image_id": "sha256:254e6370f01cd654e0744edf607c67f33777c1b6a9dc0d4b28bcba7171460122", - "memory_bytes": 134217728, - "name": "mtusi-lab3-haproxy-1" - } - ], - "postgres": [ - { - "container": "5ec44cf9fd94", - "cpus": 3.0, - "image_id": "sha256:5660c2cbfea50c7a9127d17dc4e48543eedd3d7a41a595a2dfa572471e37e64c", - "memory_bytes": 536870912, - "name": "mtusi-lab3-postgres-1" - } - ], - "redis": [ - { - "container": "cca316e66b57", - "cpus": 0.25, - "image_id": "sha256:02419de7eddf55aa5bcf49efb74e88fa8d931b4d77c07eff8a6b2144472b6952", - "memory_bytes": 134217728, - "name": "mtusi-lab3-redis-1" - } - ] - }, - "phases": {}, - "profile": "spread", - "quiesce": { - "started_at": "2026-10-16T12:30:13Z", - "stopped": [ - "lampa", - "caddy", - "redis", - "sql-lab-db-1", - "redis-lab-redis-1" - ] - }, - "replicas": { - "9a9ee612a332": { - "container": "9a9ee612a332", - "cpus": 1.5, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-3", - "started_at": "2026-10-16T12:54:39.570706901Z" - }, - "a60d478514bb": { - "container": "a60d478514bb", - "cpus": 1.5, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-6", - "started_at": "2026-10-16T12:54:39.835430797Z" - }, - "ca9bab0424ee": { - "container": "ca9bab0424ee", - "cpus": 1.5, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-5", - "started_at": "2026-10-16T12:54:39.699156477Z" - }, - "d206ccc1c81e": { - "container": "d206ccc1c81e", - "cpus": 1.5, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-4", - "started_at": "2026-10-16T12:54:39.439965143Z" - } - }, - "sample_count": 1518, - "sampler_errors": [], - "stand": { - "API_CPUS_PER_REPLICA": "1.5", - "API_IMAGE": "mtusi-messenger:lab3", - "API_MEMORY_PER_REPLICA": "384m", - "API_REPLICAS": "4", - "API_TOTAL_CPUS": "6.0", - "API_TOTAL_MEMORY_MB": "1536", - "BUILD_ID": "base", - "DATABASE_POOL_MAX": "20", - "LB_CPUS": "0.25", - "LB_MEMORY": "128m", - "LOADGEN_CPUS": "2.0", - "LOADGEN_MEMORY": "1024m", - "PG_CPUS": "3.0", - "PG_MEMORY": "512m", - "REDIS_CPUS": "0.25", - "REDIS_MEMORY": "128m" - }, - "started_at": "2026-10-16T12:55:17Z", - "step_seconds": 60, - "steps": [ - 900 - ], - "versions": { - "haproxy": "haproxy:3.2-alpine", - "haproxy_runtime": "HAProxy version 3.2.26-3e0f11a 2026/10/14 - https://haproxy.org/", - "k6": "k6 v0.54.0 (commit/baba871c8a, go1.23.1, linux/amd64)", - "node_host": "v25.7.0", - "postgres": "postgres:16.4-alpine", - "postgres_runtime": "postgres (PostgreSQL) 16.4", - "redis": "redis:7.4.2-alpine", - "redis_runtime": "Redis server v=7.4.2 sha=00000000:0 malloc=jemalloc-5.3.0 bits=64 build=9d14eaf5f599583e" - } -} diff --git a/evidence/track1/raw/growth#api6-pg3-900.samples.jsonl.gz b/evidence/track1/raw/growth#api6-pg3-900.samples.jsonl.gz deleted file mode 100644 index 10fcbae..0000000 Binary files a/evidence/track1/raw/growth#api6-pg3-900.samples.jsonl.gz and /dev/null differ diff --git a/evidence/track1/raw/growth#pg-3.0-900.k6.json b/evidence/track1/raw/growth#pg-3.0-900.k6.json deleted file mode 100644 index fcfcb8c..0000000 --- a/evidence/track1/raw/growth#pg-3.0-900.k6.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "base_url": "http://haproxy:8080", - "checks": { - "fails": 0, - "passes": 0 - }, - "dropped_iterations": 180, - "exit_code": 0, - "http_req_duration_p95": 32.75, - "http_reqs": 53851, - "iterations": 53821, - "kind": "steady", - "label": "growth#pg-3.0-900", - "mode": "write", - "profile": "spread", - "seed_messages_per_chat": 0, - "stderr_tail": [ - "Container mtusi-lab3-loadgen-run-6a07bbf325d9 Creating ", - " Container mtusi-lab3-loadgen-run-6a07bbf325d9 Created" - ], - "steps": [ - { - "achieved_rps": 897.02, - "avg": 9.13, - "duration_s": 60, - "failed": 0, - "max": 305.79, - "p50": 4.1, - "p95": 32.62, - "p99": 108.14, - "rate": 900, - "requests": 53821, - "status": { - "client_4xx": 0, - "ok": 53821, - "other": 0, - "server_5xx": 0 - }, - "vus_active": 172 - } - ], - "vus_configured": { - "max": 200, - "preAllocated": 60 - }, - "vus_max": 172 -} diff --git a/evidence/track1/raw/growth#pg-3.0-900.manifest.json b/evidence/track1/raw/growth#pg-3.0-900.manifest.json deleted file mode 100644 index aab57ac..0000000 --- a/evidence/track1/raw/growth#pg-3.0-900.manifest.json +++ /dev/null @@ -1,177 +0,0 @@ -{ - "commit": "6cced49486011d9a8fe15628944e331edb700bcd", - "dataset": { - "chat_members": 5409, - "chats": 1835, - "idempotency_keys": 2968817, - "messages": 2968817, - "users": 329 - }, - "finished_at": "2026-10-16T12:40:23Z", - "generator": { - "cpus": "1.5", - "max_vus": "200", - "memory": "1024m", - "pre_vus": "60" - }, - "host": { - "background": { - "load_average": [ - 8.35, - 12.69, - 9.63 - ], - "mem_available_mib": 6602, - "mem_total_mib": 15771, - "quiesced": true - }, - "cpus": 8 - }, - "kind": "steady", - "label": "growth#pg-3.0-900", - "mode": "write", - "observed_stand": { - "api": [ - { - "container": "f11273ba48cf", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-4", - "pool_max": 10 - }, - { - "container": "c04d8925c4b8", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-6", - "pool_max": 10 - }, - { - "container": "2f0d94f0536e", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-3", - "pool_max": 10 - }, - { - "container": "3a5792cd5ea2", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-5", - "pool_max": 10 - } - ], - "haproxy": [ - { - "container": "ec593c7cf5e2", - "cpus": 0.25, - "image_id": "sha256:254e6370f01cd654e0744edf607c67f33777c1b6a9dc0d4b28bcba7171460122", - "memory_bytes": 134217728, - "name": "mtusi-lab3-haproxy-1" - } - ], - "postgres": [ - { - "container": "5269a2ff16d5", - "cpus": 3.0, - "image_id": "sha256:5660c2cbfea50c7a9127d17dc4e48543eedd3d7a41a595a2dfa572471e37e64c", - "memory_bytes": 536870912, - "name": "mtusi-lab3-postgres-1" - } - ], - "redis": [ - { - "container": "cca316e66b57", - "cpus": 0.25, - "image_id": "sha256:02419de7eddf55aa5bcf49efb74e88fa8d931b4d77c07eff8a6b2144472b6952", - "memory_bytes": 134217728, - "name": "mtusi-lab3-redis-1" - } - ] - }, - "phases": {}, - "profile": "spread", - "quiesce": { - "started_at": "2026-10-16T12:30:13Z", - "stopped": [ - "lampa", - "caddy", - "redis", - "sql-lab-db-1", - "redis-lab-redis-1" - ] - }, - "replicas": { - "2f0d94f0536e": { - "container": "2f0d94f0536e", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-3", - "started_at": "2026-10-16T12:38:39.42683346Z" - }, - "3a5792cd5ea2": { - "container": "3a5792cd5ea2", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-5", - "started_at": "2026-10-16T12:38:39.556615337Z" - }, - "c04d8925c4b8": { - "container": "c04d8925c4b8", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-6", - "started_at": "2026-10-16T12:38:39.310049685Z" - }, - "f11273ba48cf": { - "container": "f11273ba48cf", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-4", - "started_at": "2026-10-16T12:38:39.179034243Z" - } - }, - "sample_count": 1565, - "sampler_errors": [], - "stand": { - "API_CPUS_PER_REPLICA": "0.75", - "API_IMAGE": "mtusi-messenger:lab3", - "API_MEMORY_PER_REPLICA": "384m", - "API_REPLICAS": "4", - "API_TOTAL_CPUS": "3.0", - "API_TOTAL_MEMORY_MB": "1536", - "BUILD_ID": "base", - "DATABASE_POOL_MAX": "10", - "LB_CPUS": "0.25", - "LB_MEMORY": "128m", - "LOADGEN_CPUS": "1.5", - "LOADGEN_MEMORY": "1024m", - "PG_CPUS": "3.0", - "PG_MEMORY": "512m", - "REDIS_CPUS": "0.25", - "REDIS_MEMORY": "128m" - }, - "started_at": "2026-10-16T12:39:19Z", - "step_seconds": 60, - "steps": [ - 900 - ], - "versions": { - "haproxy": "haproxy:3.2-alpine", - "haproxy_runtime": "HAProxy version 3.2.26-3e0f11a 2026/10/14 - https://haproxy.org/", - "k6": "k6 v0.54.0 (commit/baba871c8a, go1.23.1, linux/amd64)", - "node_host": "v25.7.0", - "postgres": "postgres:16.4-alpine", - "postgres_runtime": "postgres (PostgreSQL) 16.4", - "redis": "redis:7.4.2-alpine", - "redis_runtime": "Redis server v=7.4.2 sha=00000000:0 malloc=jemalloc-5.3.0 bits=64 build=9d14eaf5f599583e" - } -} diff --git a/evidence/track1/raw/growth#pg-3.0-900.samples.jsonl.gz b/evidence/track1/raw/growth#pg-3.0-900.samples.jsonl.gz deleted file mode 100644 index cb68d1d..0000000 Binary files a/evidence/track1/raw/growth#pg-3.0-900.samples.jsonl.gz and /dev/null differ diff --git a/evidence/track1/raw/growth#pool-20-900.k6.json b/evidence/track1/raw/growth#pool-20-900.k6.json deleted file mode 100644 index 9498717..0000000 --- a/evidence/track1/raw/growth#pool-20-900.k6.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "base_url": "http://haproxy:8080", - "checks": { - "fails": 0, - "passes": 0 - }, - "dropped_iterations": 1150, - "exit_code": 0, - "http_req_duration_p95": 271.82, - "http_reqs": 52881, - "iterations": 52851, - "kind": "steady", - "label": "growth#pool-20-900", - "mode": "write", - "profile": "spread", - "seed_messages_per_chat": 0, - "stderr_tail": [ - "Container mtusi-lab3-loadgen-run-bce7a15e75c7 Creating ", - " Container mtusi-lab3-loadgen-run-bce7a15e75c7 Created ", - "time=\"2026-10-16T12:43:25Z\" level=warning msg=\"Insufficient VUs, reached 200 active VUs and cannot initialize more\" executor=constant-arrival-rate scenario=steady" - ], - "steps": [ - { - "achieved_rps": 880.85, - "avg": 77.09, - "duration_s": 60, - "failed": 0, - "max": 947.92, - "p50": 11.14, - "p95": 271.81, - "p99": 372.92, - "rate": 900, - "requests": 52851, - "status": { - "client_4xx": 0, - "ok": 52851, - "other": 0, - "server_5xx": 0 - }, - "vus_active": 200 - } - ], - "vus_configured": { - "max": 200, - "preAllocated": 60 - }, - "vus_max": 200 -} diff --git a/evidence/track1/raw/growth#pool-20-900.manifest.json b/evidence/track1/raw/growth#pool-20-900.manifest.json deleted file mode 100644 index 1e7622f..0000000 --- a/evidence/track1/raw/growth#pool-20-900.manifest.json +++ /dev/null @@ -1,177 +0,0 @@ -{ - "commit": "6cced49486011d9a8fe15628944e331edb700bcd", - "dataset": { - "chat_members": 5697, - "chats": 1931, - "idempotency_keys": 3127409, - "messages": 3127409, - "users": 341 - }, - "finished_at": "2026-10-16T12:44:10Z", - "generator": { - "cpus": "1.5", - "max_vus": "200", - "memory": "1024m", - "pre_vus": "60" - }, - "host": { - "background": { - "load_average": [ - 9.05, - 10.89, - 9.58 - ], - "mem_available_mib": 6572, - "mem_total_mib": 15771, - "quiesced": true - }, - "cpus": 8 - }, - "kind": "steady", - "label": "growth#pool-20-900", - "mode": "write", - "observed_stand": { - "api": [ - { - "container": "f651a21f7401", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-5", - "pool_max": 20 - }, - { - "container": "de94f12154f1", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-4", - "pool_max": 20 - }, - { - "container": "43f462e66e7c", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-3", - "pool_max": 20 - }, - { - "container": "43d3938a2362", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-6", - "pool_max": 20 - } - ], - "haproxy": [ - { - "container": "ec593c7cf5e2", - "cpus": 0.25, - "image_id": "sha256:254e6370f01cd654e0744edf607c67f33777c1b6a9dc0d4b28bcba7171460122", - "memory_bytes": 134217728, - "name": "mtusi-lab3-haproxy-1" - } - ], - "postgres": [ - { - "container": "7f02978f8ed1", - "cpus": 1.5, - "image_id": "sha256:5660c2cbfea50c7a9127d17dc4e48543eedd3d7a41a595a2dfa572471e37e64c", - "memory_bytes": 536870912, - "name": "mtusi-lab3-postgres-1" - } - ], - "redis": [ - { - "container": "cca316e66b57", - "cpus": 0.25, - "image_id": "sha256:02419de7eddf55aa5bcf49efb74e88fa8d931b4d77c07eff8a6b2144472b6952", - "memory_bytes": 134217728, - "name": "mtusi-lab3-redis-1" - } - ] - }, - "phases": {}, - "profile": "spread", - "quiesce": { - "started_at": "2026-10-16T12:30:13Z", - "stopped": [ - "lampa", - "caddy", - "redis", - "sql-lab-db-1", - "redis-lab-redis-1" - ] - }, - "replicas": { - "43d3938a2362": { - "container": "43d3938a2362", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-6", - "started_at": "2026-10-16T12:42:28.445358641Z" - }, - "43f462e66e7c": { - "container": "43f462e66e7c", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-3", - "started_at": "2026-10-16T12:42:28.159483468Z" - }, - "de94f12154f1": { - "container": "de94f12154f1", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-4", - "started_at": "2026-10-16T12:42:27.903400572Z" - }, - "f651a21f7401": { - "container": "f651a21f7401", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-5", - "started_at": "2026-10-16T12:42:27.619831463Z" - } - }, - "sample_count": 1552, - "sampler_errors": [], - "stand": { - "API_CPUS_PER_REPLICA": "0.75", - "API_IMAGE": "mtusi-messenger:lab3", - "API_MEMORY_PER_REPLICA": "384m", - "API_REPLICAS": "4", - "API_TOTAL_CPUS": "3.0", - "API_TOTAL_MEMORY_MB": "1536", - "BUILD_ID": "base", - "DATABASE_POOL_MAX": "20", - "LB_CPUS": "0.25", - "LB_MEMORY": "128m", - "LOADGEN_CPUS": "1.5", - "LOADGEN_MEMORY": "1024m", - "PG_CPUS": "1.5", - "PG_MEMORY": "512m", - "REDIS_CPUS": "0.25", - "REDIS_MEMORY": "128m" - }, - "started_at": "2026-10-16T12:43:07Z", - "step_seconds": 60, - "steps": [ - 900 - ], - "versions": { - "haproxy": "haproxy:3.2-alpine", - "haproxy_runtime": "HAProxy version 3.2.26-3e0f11a 2026/10/14 - https://haproxy.org/", - "k6": "k6 v0.54.0 (commit/baba871c8a, go1.23.1, linux/amd64)", - "node_host": "v25.7.0", - "postgres": "postgres:16.4-alpine", - "postgres_runtime": "postgres (PostgreSQL) 16.4", - "redis": "redis:7.4.2-alpine", - "redis_runtime": "Redis server v=7.4.2 sha=00000000:0 malloc=jemalloc-5.3.0 bits=64 build=9d14eaf5f599583e" - } -} diff --git a/evidence/track1/raw/growth#pool-20-900.samples.jsonl.gz b/evidence/track1/raw/growth#pool-20-900.samples.jsonl.gz deleted file mode 100644 index f6b09de..0000000 Binary files a/evidence/track1/raw/growth#pool-20-900.samples.jsonl.gz and /dev/null differ diff --git a/evidence/track1/raw/growth#pool-5-900.k6.json b/evidence/track1/raw/growth#pool-5-900.k6.json deleted file mode 100644 index 023e959..0000000 --- a/evidence/track1/raw/growth#pool-5-900.k6.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "base_url": "http://haproxy:8080", - "checks": { - "fails": 0, - "passes": 0 - }, - "dropped_iterations": 203, - "exit_code": 0, - "http_req_duration_p95": 56.19, - "http_reqs": 53828, - "iterations": 53798, - "kind": "steady", - "label": "growth#pool-5-900", - "mode": "write", - "profile": "spread", - "seed_messages_per_chat": 0, - "stderr_tail": [ - "Container mtusi-lab3-loadgen-run-51fbb7bbdd96 Creating ", - " Container mtusi-lab3-loadgen-run-51fbb7bbdd96 Created" - ], - "steps": [ - { - "achieved_rps": 896.63, - "avg": 13.18, - "duration_s": 60, - "failed": 0, - "max": 295.43, - "p50": 4.33, - "p95": 56.14, - "p99": 170.79, - "rate": 900, - "requests": 53798, - "status": { - "client_4xx": 0, - "ok": 53798, - "other": 0, - "server_5xx": 0 - }, - "vus_active": 168 - } - ], - "vus_configured": { - "max": 200, - "preAllocated": 60 - }, - "vus_max": 169 -} diff --git a/evidence/track1/raw/growth#pool-5-900.manifest.json b/evidence/track1/raw/growth#pool-5-900.manifest.json deleted file mode 100644 index b7e81aa..0000000 --- a/evidence/track1/raw/growth#pool-5-900.manifest.json +++ /dev/null @@ -1,177 +0,0 @@ -{ - "commit": "6cced49486011d9a8fe15628944e331edb700bcd", - "dataset": { - "chat_members": 5553, - "chats": 1883, - "idempotency_keys": 3049486, - "messages": 3049486, - "users": 335 - }, - "finished_at": "2026-10-16T12:42:19Z", - "generator": { - "cpus": "1.5", - "max_vus": "200", - "memory": "1024m", - "pre_vus": "60" - }, - "host": { - "background": { - "load_average": [ - 11.2, - 12.15, - 9.78 - ], - "mem_available_mib": 6436, - "mem_total_mib": 15771, - "quiesced": true - }, - "cpus": 8 - }, - "kind": "steady", - "label": "growth#pool-5-900", - "mode": "write", - "observed_stand": { - "api": [ - { - "container": "a45dab185109", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-3", - "pool_max": 5 - }, - { - "container": "25e3c2a588ae", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-6", - "pool_max": 5 - }, - { - "container": "e1f2193d60be", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-4", - "pool_max": 5 - }, - { - "container": "ff0ebd6f5ca9", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_bytes": 402653184, - "name": "mtusi-lab3-api-5", - "pool_max": 5 - } - ], - "haproxy": [ - { - "container": "ec593c7cf5e2", - "cpus": 0.25, - "image_id": "sha256:254e6370f01cd654e0744edf607c67f33777c1b6a9dc0d4b28bcba7171460122", - "memory_bytes": 134217728, - "name": "mtusi-lab3-haproxy-1" - } - ], - "postgres": [ - { - "container": "7f02978f8ed1", - "cpus": 1.5, - "image_id": "sha256:5660c2cbfea50c7a9127d17dc4e48543eedd3d7a41a595a2dfa572471e37e64c", - "memory_bytes": 536870912, - "name": "mtusi-lab3-postgres-1" - } - ], - "redis": [ - { - "container": "cca316e66b57", - "cpus": 0.25, - "image_id": "sha256:02419de7eddf55aa5bcf49efb74e88fa8d931b4d77c07eff8a6b2144472b6952", - "memory_bytes": 134217728, - "name": "mtusi-lab3-redis-1" - } - ] - }, - "phases": {}, - "profile": "spread", - "quiesce": { - "started_at": "2026-10-16T12:30:13Z", - "stopped": [ - "lampa", - "caddy", - "redis", - "sql-lab-db-1", - "redis-lab-redis-1" - ] - }, - "replicas": { - "25e3c2a588ae": { - "container": "25e3c2a588ae", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-6", - "started_at": "2026-10-16T12:40:36.914696604Z" - }, - "a45dab185109": { - "container": "a45dab185109", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-3", - "started_at": "2026-10-16T12:40:36.778369649Z" - }, - "e1f2193d60be": { - "container": "e1f2193d60be", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-4", - "started_at": "2026-10-16T12:40:37.0370632Z" - }, - "ff0ebd6f5ca9": { - "container": "ff0ebd6f5ca9", - "cpus": 0.75, - "image_id": "sha256:67a35fda7a0e9d590be17530c20a027c18ab2629de237b45efb413bb53774f12", - "memory_mb": 384, - "name": "mtusi-lab3-api-5", - "started_at": "2026-10-16T12:40:37.161652017Z" - } - }, - "sample_count": 1553, - "sampler_errors": [], - "stand": { - "API_CPUS_PER_REPLICA": "0.75", - "API_IMAGE": "mtusi-messenger:lab3", - "API_MEMORY_PER_REPLICA": "384m", - "API_REPLICAS": "4", - "API_TOTAL_CPUS": "3.0", - "API_TOTAL_MEMORY_MB": "1536", - "BUILD_ID": "base", - "DATABASE_POOL_MAX": "5", - "LB_CPUS": "0.25", - "LB_MEMORY": "128m", - "LOADGEN_CPUS": "1.5", - "LOADGEN_MEMORY": "1024m", - "PG_CPUS": "1.5", - "PG_MEMORY": "512m", - "REDIS_CPUS": "0.25", - "REDIS_MEMORY": "128m" - }, - "started_at": "2026-10-16T12:41:16Z", - "step_seconds": 60, - "steps": [ - 900 - ], - "versions": { - "haproxy": "haproxy:3.2-alpine", - "haproxy_runtime": "HAProxy version 3.2.26-3e0f11a 2026/10/14 - https://haproxy.org/", - "k6": "k6 v0.54.0 (commit/baba871c8a, go1.23.1, linux/amd64)", - "node_host": "v25.7.0", - "postgres": "postgres:16.4-alpine", - "postgres_runtime": "postgres (PostgreSQL) 16.4", - "redis": "redis:7.4.2-alpine", - "redis_runtime": "Redis server v=7.4.2 sha=00000000:0 malloc=jemalloc-5.3.0 bits=64 build=9d14eaf5f599583e" - } -} diff --git a/evidence/track1/raw/growth#pool-5-900.samples.jsonl.gz b/evidence/track1/raw/growth#pool-5-900.samples.jsonl.gz deleted file mode 100644 index 93af1d0..0000000 Binary files a/evidence/track1/raw/growth#pool-5-900.samples.jsonl.gz and /dev/null differ diff --git a/evidence/track1/raw/knee#n1.k6.json b/evidence/track1/raw/knee#n1.k6.json index 92bcb16..16b2e92 100644 --- a/evidence/track1/raw/knee#n1.k6.json +++ b/evidence/track1/raw/knee#n1.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 890.33, + "attempted_rps": 890.33, "avg": 15.73, "duration_s": 15, "failed": 0, @@ -36,10 +36,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 890.33, "vus_active": 0 }, { - "achieved_rps": 1105.93, + "attempted_rps": 1105.93, "avg": 193.89, "duration_s": 15, "failed": 0, @@ -55,10 +56,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 1105.93, "vus_active": 0 }, { - "achieved_rps": 1036.27, + "attempted_rps": 1036.27, "avg": 676.54, "duration_s": 15, "failed": 0, @@ -74,10 +76,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 1036.27, "vus_active": 0 }, { - "achieved_rps": 1004.13, + "attempted_rps": 1004.13, "avg": 816.47, "duration_s": 15, "failed": 0, @@ -93,10 +96,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 1004.13, "vus_active": 0 }, { - "achieved_rps": 990.87, + "attempted_rps": 990.87, "avg": 824.78, "duration_s": 15, "failed": 0, @@ -112,6 +116,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 990.87, "vus_active": 0 } ], diff --git a/evidence/track1/raw/knee#n4.k6.json b/evidence/track1/raw/knee#n4.k6.json index 286798f..5ee3ae1 100644 --- a/evidence/track1/raw/knee#n4.k6.json +++ b/evidence/track1/raw/knee#n4.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 886.6, + "attempted_rps": 886.6, "avg": 30.59, "duration_s": 15, "failed": 0, @@ -36,10 +36,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 886.6, "vus_active": 0 }, { - "achieved_rps": 1054.8, + "attempted_rps": 1054.8, "avg": 475.54, "duration_s": 15, "failed": 0, @@ -55,10 +56,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 1054.8, "vus_active": 0 }, { - "achieved_rps": 903.4, + "attempted_rps": 903.4, "avg": 877.93, "duration_s": 15, "failed": 0, @@ -74,10 +76,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 903.4, "vus_active": 0 }, { - "achieved_rps": 929.27, + "attempted_rps": 929.27, "avg": 861.89, "duration_s": 15, "failed": 0, @@ -93,10 +96,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 929.27, "vus_active": 0 }, { - "achieved_rps": 965.2, + "attempted_rps": 965.2, "avg": 910.61, "duration_s": 15, "failed": 0, @@ -112,6 +116,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 965.2, "vus_active": 0 } ], diff --git a/evidence/track1/raw/p-a#n1#rep1.k6.json b/evidence/track1/raw/p-a#n1#rep1.k6.json index 9f804a1..ac4ff34 100644 --- a/evidence/track1/raw/p-a#n1#rep1.k6.json +++ b/evidence/track1/raw/p-a#n1#rep1.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 100.07, + "attempted_rps": 100.07, "avg": 5.73, "duration_s": 15, "failed": 0, @@ -30,10 +30,11 @@ "p99": 19.63, "rate": 100, "requests": 1501, + "successful_rps": 100.07, "vus_active": 2 }, { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 3.81, "duration_s": 15, "failed": 0, @@ -43,10 +44,11 @@ "p99": 7.68, "rate": 200, "requests": 3001, + "successful_rps": 200.07, "vus_active": 3 }, { - "achieved_rps": 300, + "attempted_rps": 300.0, "avg": 5.27, "duration_s": 15, "failed": 0, @@ -56,10 +58,11 @@ "p99": 22.24, "rate": 300, "requests": 4500, + "successful_rps": 300.0, "vus_active": 3 }, { - "achieved_rps": 400.07, + "attempted_rps": 400.07, "avg": 5.55, "duration_s": 15, "failed": 0, @@ -69,10 +72,11 @@ "p99": 16.77, "rate": 400, "requests": 6001, + "successful_rps": 400.07, "vus_active": 6 }, { - "achieved_rps": 550.07, + "attempted_rps": 550.07, "avg": 6.04, "duration_s": 15, "failed": 0, @@ -82,10 +86,11 @@ "p99": 63.57, "rate": 550, "requests": 8251, + "successful_rps": 550.07, "vus_active": 5 }, { - "achieved_rps": 700.07, + "attempted_rps": 700.07, "avg": 6.78, "duration_s": 15, "failed": 0, @@ -95,10 +100,11 @@ "p99": 57.57, "rate": 700, "requests": 10501, + "successful_rps": 700.07, "vus_active": 33 }, { - "achieved_rps": 754.4, + "attempted_rps": 754.4, "avg": 221.38, "duration_s": 15, "failed": 0, @@ -108,10 +114,11 @@ "p99": 584.98, "rate": 900, "requests": 11316, + "successful_rps": 754.4, "vus_active": 129 }, { - "achieved_rps": 761.07, + "attempted_rps": 761.07, "avg": 251.55, "duration_s": 15, "failed": 0, @@ -121,6 +128,7 @@ "p99": 424.35, "rate": 1100, "requests": 11416, + "successful_rps": 761.07, "vus_active": 1 } ], diff --git a/evidence/track1/raw/p-a#n1#rep2.k6.json b/evidence/track1/raw/p-a#n1#rep2.k6.json index ee71733..16c14a3 100644 --- a/evidence/track1/raw/p-a#n1#rep2.k6.json +++ b/evidence/track1/raw/p-a#n1#rep2.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 100.07, + "attempted_rps": 100.07, "avg": 6.2, "duration_s": 15, "failed": 0, @@ -30,10 +30,11 @@ "p99": 19.21, "rate": 100, "requests": 1501, + "successful_rps": 100.07, "vus_active": 2 }, { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 3.8, "duration_s": 15, "failed": 0, @@ -43,10 +44,11 @@ "p99": 5.72, "rate": 200, "requests": 3001, + "successful_rps": 200.07, "vus_active": 3 }, { - "achieved_rps": 300.07, + "attempted_rps": 300.07, "avg": 4.27, "duration_s": 15, "failed": 0, @@ -56,10 +58,11 @@ "p99": 9.57, "rate": 300, "requests": 4501, + "successful_rps": 300.07, "vus_active": 3 }, { - "achieved_rps": 400.07, + "attempted_rps": 400.07, "avg": 5.67, "duration_s": 15, "failed": 0, @@ -69,10 +72,11 @@ "p99": 17.33, "rate": 400, "requests": 6001, + "successful_rps": 400.07, "vus_active": 5 }, { - "achieved_rps": 550.07, + "attempted_rps": 550.07, "avg": 4.94, "duration_s": 15, "failed": 0, @@ -82,10 +86,11 @@ "p99": 17.15, "rate": 550, "requests": 8251, + "successful_rps": 550.07, "vus_active": 6 }, { - "achieved_rps": 700.07, + "attempted_rps": 700.07, "avg": 9.05, "duration_s": 15, "failed": 0, @@ -95,10 +100,11 @@ "p99": 61.29, "rate": 700, "requests": 10501, + "successful_rps": 700.07, "vus_active": 5 }, { - "achieved_rps": 807, + "attempted_rps": 807.0, "avg": 193.64, "duration_s": 15, "failed": 0, @@ -108,10 +114,11 @@ "p99": 417.64, "rate": 900, "requests": 12105, + "successful_rps": 807.0, "vus_active": 114 }, { - "achieved_rps": 680.2, + "attempted_rps": 680.2, "avg": 278.96, "duration_s": 15, "failed": 0, @@ -121,6 +128,7 @@ "p99": 684.08, "rate": 1100, "requests": 10203, + "successful_rps": 680.2, "vus_active": 1 } ], diff --git a/evidence/track1/raw/p-a#n2#rep1.k6.json b/evidence/track1/raw/p-a#n2#rep1.k6.json index 30e6429..9ca5299 100644 --- a/evidence/track1/raw/p-a#n2#rep1.k6.json +++ b/evidence/track1/raw/p-a#n2#rep1.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 100, + "attempted_rps": 100.0, "avg": 5.11, "duration_s": 15, "failed": 0, @@ -30,10 +30,11 @@ "p99": 9.31, "rate": 100, "requests": 1500, + "successful_rps": 100.0, "vus_active": 1 }, { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 5.35, "duration_s": 15, "failed": 0, @@ -43,10 +44,11 @@ "p99": 11.42, "rate": 200, "requests": 3001, + "successful_rps": 200.07, "vus_active": 5 }, { - "achieved_rps": 300.2, + "attempted_rps": 300.2, "avg": 6.05, "duration_s": 15, "failed": 0, @@ -56,10 +58,11 @@ "p99": 17.34, "rate": 300, "requests": 4503, + "successful_rps": 300.2, "vus_active": 6 }, { - "achieved_rps": 400.07, + "attempted_rps": 400.07, "avg": 5.08, "duration_s": 15, "failed": 0, @@ -69,10 +72,11 @@ "p99": 11.77, "rate": 400, "requests": 6001, + "successful_rps": 400.07, "vus_active": 6 }, { - "achieved_rps": 550, + "attempted_rps": 550.0, "avg": 5.96, "duration_s": 15, "failed": 0, @@ -82,10 +86,11 @@ "p99": 55.36, "rate": 550, "requests": 8250, + "successful_rps": 550.0, "vus_active": 4 }, { - "achieved_rps": 699.53, + "attempted_rps": 699.53, "avg": 8.42, "duration_s": 15, "failed": 0, @@ -95,10 +100,11 @@ "p99": 70.27, "rate": 700, "requests": 10493, + "successful_rps": 699.53, "vus_active": 12 }, { - "achieved_rps": 650.2, + "attempted_rps": 650.2, "avg": 274.61, "duration_s": 15, "failed": 0, @@ -108,10 +114,11 @@ "p99": 517.25, "rate": 900, "requests": 9753, + "successful_rps": 650.2, "vus_active": 134 }, { - "achieved_rps": 532.2, + "attempted_rps": 532.2, "avg": 364.6, "duration_s": 15, "failed": 0, @@ -121,6 +128,7 @@ "p99": 775.78, "rate": 1100, "requests": 7983, + "successful_rps": 532.2, "vus_active": 1 } ], diff --git a/evidence/track1/raw/p-a#n2#rep2.k6.json b/evidence/track1/raw/p-a#n2#rep2.k6.json index 61af7fd..94d3b0a 100644 --- a/evidence/track1/raw/p-a#n2#rep2.k6.json +++ b/evidence/track1/raw/p-a#n2#rep2.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 100.07, + "attempted_rps": 100.07, "avg": 5.43, "duration_s": 15, "failed": 0, @@ -30,10 +30,11 @@ "p99": 10.62, "rate": 100, "requests": 1501, + "successful_rps": 100.07, "vus_active": 2 }, { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 4.54, "duration_s": 15, "failed": 0, @@ -43,10 +44,11 @@ "p99": 9.27, "rate": 200, "requests": 3001, + "successful_rps": 200.07, "vus_active": 4 }, { - "achieved_rps": 300, + "attempted_rps": 300.0, "avg": 5.44, "duration_s": 15, "failed": 0, @@ -56,10 +58,11 @@ "p99": 14.52, "rate": 300, "requests": 4500, + "successful_rps": 300.0, "vus_active": 1 }, { - "achieved_rps": 400.07, + "attempted_rps": 400.07, "avg": 5.12, "duration_s": 15, "failed": 0, @@ -69,10 +72,11 @@ "p99": 11.92, "rate": 400, "requests": 6001, + "successful_rps": 400.07, "vus_active": 4 }, { - "achieved_rps": 550.07, + "attempted_rps": 550.07, "avg": 5.5, "duration_s": 15, "failed": 0, @@ -82,10 +86,11 @@ "p99": 36.34, "rate": 550, "requests": 8251, + "successful_rps": 550.07, "vus_active": 6 }, { - "achieved_rps": 690.2, + "attempted_rps": 690.2, "avg": 53.56, "duration_s": 15, "failed": 0, @@ -95,10 +100,11 @@ "p99": 211.84, "rate": 700, "requests": 10353, + "successful_rps": 690.2, "vus_active": 70 }, { - "achieved_rps": 538, + "attempted_rps": 538.0, "avg": 352.39, "duration_s": 15, "failed": 0, @@ -108,10 +114,11 @@ "p99": 1086.81, "rate": 900, "requests": 8070, + "successful_rps": 538.0, "vus_active": 132 }, { - "achieved_rps": 578.13, + "attempted_rps": 578.13, "avg": 335.13, "duration_s": 15, "failed": 0, @@ -121,6 +128,7 @@ "p99": 734.16, "rate": 1100, "requests": 8672, + "successful_rps": 578.13, "vus_active": 1 } ], diff --git a/evidence/track1/raw/p-a#n2#rep3.k6.json b/evidence/track1/raw/p-a#n2#rep3.k6.json index 15ad1dc..5aaf14a 100644 --- a/evidence/track1/raw/p-a#n2#rep3.k6.json +++ b/evidence/track1/raw/p-a#n2#rep3.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 100.07, + "attempted_rps": 100.07, "avg": 5.14, "duration_s": 15, "failed": 0, @@ -30,10 +30,11 @@ "p99": 9.58, "rate": 100, "requests": 1501, + "successful_rps": 100.07, "vus_active": 2 }, { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 4.23, "duration_s": 15, "failed": 0, @@ -43,10 +44,11 @@ "p99": 9.12, "rate": 200, "requests": 3001, + "successful_rps": 200.07, "vus_active": 5 }, { - "achieved_rps": 300, + "attempted_rps": 300.0, "avg": 6.82, "duration_s": 15, "failed": 0, @@ -56,10 +58,11 @@ "p99": 50.46, "rate": 300, "requests": 4500, + "successful_rps": 300.0, "vus_active": 2 }, { - "achieved_rps": 400.07, + "attempted_rps": 400.07, "avg": 5.09, "duration_s": 15, "failed": 0, @@ -69,10 +72,11 @@ "p99": 12.44, "rate": 400, "requests": 6001, + "successful_rps": 400.07, "vus_active": 4 }, { - "achieved_rps": 549.87, + "attempted_rps": 549.87, "avg": 8.8, "duration_s": 15, "failed": 0, @@ -82,10 +86,11 @@ "p99": 96.85, "rate": 550, "requests": 8248, + "successful_rps": 549.87, "vus_active": 4 }, { - "achieved_rps": 692.4, + "attempted_rps": 692.4, "avg": 43.09, "duration_s": 15, "failed": 0, @@ -95,10 +100,11 @@ "p99": 178.67, "rate": 700, "requests": 10386, + "successful_rps": 692.4, "vus_active": 61 }, { - "achieved_rps": 614.13, + "attempted_rps": 614.13, "avg": 300.09, "duration_s": 15, "failed": 0, @@ -108,10 +114,11 @@ "p99": 608.9, "rate": 900, "requests": 9212, + "successful_rps": 614.13, "vus_active": 136 }, { - "achieved_rps": 590.2, + "attempted_rps": 590.2, "avg": 322.81, "duration_s": 15, "failed": 0, @@ -121,6 +128,7 @@ "p99": 677.61, "rate": 1100, "requests": 8853, + "successful_rps": 590.2, "vus_active": 1 } ], diff --git a/evidence/track1/raw/p-a#n4#rep1.k6.json b/evidence/track1/raw/p-a#n4#rep1.k6.json index 40ffcaf..4a8de19 100644 --- a/evidence/track1/raw/p-a#n4#rep1.k6.json +++ b/evidence/track1/raw/p-a#n4#rep1.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 100.07, + "attempted_rps": 100.07, "avg": 5.47, "duration_s": 15, "failed": 0, @@ -30,10 +30,11 @@ "p99": 10.19, "rate": 100, "requests": 1501, + "successful_rps": 100.07, "vus_active": 3 }, { - "achieved_rps": 200, + "attempted_rps": 200.0, "avg": 6.02, "duration_s": 15, "failed": 0, @@ -43,10 +44,11 @@ "p99": 25.94, "rate": 200, "requests": 3000, + "successful_rps": 200.0, "vus_active": 2 }, { - "achieved_rps": 300.07, + "attempted_rps": 300.07, "avg": 6.42, "duration_s": 15, "failed": 0, @@ -56,10 +58,11 @@ "p99": 35.05, "rate": 300, "requests": 4501, + "successful_rps": 300.07, "vus_active": 4 }, { - "achieved_rps": 398.6, + "attempted_rps": 398.6, "avg": 9.96, "duration_s": 15, "failed": 0, @@ -69,10 +72,11 @@ "p99": 168.94, "rate": 400, "requests": 5979, + "successful_rps": 398.6, "vus_active": 3 }, { - "achieved_rps": 541, + "attempted_rps": 541.0, "avg": 34.57, "duration_s": 15, "failed": 0, @@ -82,10 +86,11 @@ "p99": 308.26, "rate": 550, "requests": 8115, + "successful_rps": 541.0, "vus_active": 5 }, { - "achieved_rps": 695.6, + "attempted_rps": 695.6, "avg": 34.32, "duration_s": 15, "failed": 0, @@ -95,10 +100,11 @@ "p99": 176.47, "rate": 700, "requests": 10434, + "successful_rps": 695.6, "vus_active": 89 }, { - "achieved_rps": 636.67, + "attempted_rps": 636.67, "avg": 296.4, "duration_s": 15, "failed": 0, @@ -108,10 +114,11 @@ "p99": 1283.66, "rate": 900, "requests": 9550, + "successful_rps": 636.67, "vus_active": 189 }, { - "achieved_rps": 609.6, + "attempted_rps": 609.6, "avg": 307.84, "duration_s": 15, "failed": 0, @@ -121,6 +128,7 @@ "p99": 1297.31, "rate": 1100, "requests": 9144, + "successful_rps": 609.6, "vus_active": 1 } ], diff --git a/evidence/track1/raw/p-a#n4#rep2.k6.json b/evidence/track1/raw/p-a#n4#rep2.k6.json index 3656d43..02ec448 100644 --- a/evidence/track1/raw/p-a#n4#rep2.k6.json +++ b/evidence/track1/raw/p-a#n4#rep2.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 100, + "attempted_rps": 100.0, "avg": 5.33, "duration_s": 15, "failed": 0, @@ -30,10 +30,11 @@ "p99": 14.35, "rate": 100, "requests": 1500, + "successful_rps": 100.0, "vus_active": 1 }, { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 6.85, "duration_s": 15, "failed": 0, @@ -43,10 +44,11 @@ "p99": 52.5, "rate": 200, "requests": 3001, + "successful_rps": 200.07, "vus_active": 4 }, { - "achieved_rps": 300.07, + "attempted_rps": 300.07, "avg": 7.26, "duration_s": 15, "failed": 0, @@ -56,10 +58,11 @@ "p99": 47.08, "rate": 300, "requests": 4501, + "successful_rps": 300.07, "vus_active": 3 }, { - "achieved_rps": 400, + "attempted_rps": 400.0, "avg": 6.39, "duration_s": 15, "failed": 0, @@ -69,10 +72,11 @@ "p99": 50.94, "rate": 400, "requests": 6000, + "successful_rps": 400.0, "vus_active": 4 }, { - "achieved_rps": 550.07, + "attempted_rps": 550.07, "avg": 7.33, "duration_s": 15, "failed": 0, @@ -82,10 +86,11 @@ "p99": 62.4, "rate": 550, "requests": 8251, + "successful_rps": 550.07, "vus_active": 6 }, { - "achieved_rps": 653.33, + "attempted_rps": 653.33, "avg": 125.9, "duration_s": 15, "failed": 0, @@ -95,10 +100,11 @@ "p99": 699.08, "rate": 700, "requests": 9800, + "successful_rps": 653.33, "vus_active": 159 }, { - "achieved_rps": 586.93, + "attempted_rps": 586.93, "avg": 326.51, "duration_s": 15, "failed": 0, @@ -108,10 +114,11 @@ "p99": 1034.47, "rate": 900, "requests": 8804, + "successful_rps": 586.93, "vus_active": 179 }, { - "achieved_rps": 566.73, + "attempted_rps": 566.73, "avg": 342.13, "duration_s": 15, "failed": 0, @@ -121,6 +128,7 @@ "p99": 1174.5, "rate": 1100, "requests": 8501, + "successful_rps": 566.73, "vus_active": 1 } ], diff --git a/evidence/track1/raw/p-b#after-ext.k6.json b/evidence/track1/raw/p-b#after-ext.k6.json index 293abd4..3e40ca1 100644 --- a/evidence/track1/raw/p-b#after-ext.k6.json +++ b/evidence/track1/raw/p-b#after-ext.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 399.87, + "attempted_rps": 399.87, "avg": 13.23, "duration_s": 15, "failed": 0, @@ -30,10 +30,11 @@ "p99": 189.84, "rate": 400, "requests": 5998, + "successful_rps": 399.87, "vus_active": 4 }, { - "achieved_rps": 495.33, + "attempted_rps": 495.33, "avg": 77.49, "duration_s": 15, "failed": 0, @@ -43,10 +44,11 @@ "p99": 405.9, "rate": 500, "requests": 7430, + "successful_rps": 495.33, "vus_active": 51 }, { - "achieved_rps": 559.27, + "attempted_rps": 559.27, "avg": 495.27, "duration_s": 15, "failed": 0, @@ -56,10 +58,11 @@ "p99": 1489.61, "rate": 600, "requests": 8389, + "successful_rps": 559.27, "vus_active": 452 }, { - "achieved_rps": 529.2, + "attempted_rps": 529.2, "avg": 2034.05, "duration_s": 15, "failed": 0, @@ -69,6 +72,7 @@ "p99": 3596.6, "rate": 800, "requests": 7938, + "successful_rps": 529.2, "vus_active": 1 } ], diff --git a/evidence/track1/raw/p-b#n4.k6.json b/evidence/track1/raw/p-b#n4.k6.json index 8be71c8..b5be7f8 100644 --- a/evidence/track1/raw/p-b#n4.k6.json +++ b/evidence/track1/raw/p-b#n4.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 50.07, + "attempted_rps": 50.07, "avg": 7.88, "duration_s": 15, "failed": 0, @@ -30,10 +30,11 @@ "p99": 20.83, "rate": 50, "requests": 751, + "successful_rps": 50.07, "vus_active": 2 }, { - "achieved_rps": 100.07, + "attempted_rps": 100.07, "avg": 7.28, "duration_s": 15, "failed": 0, @@ -43,10 +44,11 @@ "p99": 36.14, "rate": 100, "requests": 1501, + "successful_rps": 100.07, "vus_active": 3 }, { - "achieved_rps": 150, + "attempted_rps": 150.0, "avg": 5.78, "duration_s": 15, "failed": 0, @@ -56,10 +58,11 @@ "p99": 19.17, "rate": 150, "requests": 2250, + "successful_rps": 150.0, "vus_active": 1 }, { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 5.58, "duration_s": 15, "failed": 0, @@ -69,10 +72,11 @@ "p99": 20.66, "rate": 200, "requests": 3001, + "successful_rps": 200.07, "vus_active": 3 }, { - "achieved_rps": 188.73, + "attempted_rps": 188.73, "avg": 630.68, "duration_s": 15, "failed": 0, @@ -82,10 +86,11 @@ "p99": 2587.42, "rate": 250, "requests": 2831, + "successful_rps": 188.73, "vus_active": 200 }, { - "achieved_rps": 104, + "attempted_rps": 104.0, "avg": 2012.53, "duration_s": 15, "failed": 0, @@ -95,10 +100,11 @@ "p99": 3947.02, "rate": 300, "requests": 1560, + "successful_rps": 104.0, "vus_active": 201 }, { - "achieved_rps": 79.47, + "attempted_rps": 79.47, "avg": 2658.32, "duration_s": 15, "failed": 0, @@ -108,10 +114,11 @@ "p99": 5020.98, "rate": 350, "requests": 1192, + "successful_rps": 79.47, "vus_active": 201 }, { - "achieved_rps": 102, + "attempted_rps": 102.0, "avg": 1979.19, "duration_s": 15, "failed": 0, @@ -121,6 +128,7 @@ "p99": 4885.3, "rate": 400, "requests": 1530, + "successful_rps": 102.0, "vus_active": 1 } ], diff --git a/evidence/track1/raw/p-c#gen2.0.k6.json b/evidence/track1/raw/p-c#gen2.0.k6.json index 4d73160..8d220a1 100644 --- a/evidence/track1/raw/p-c#gen2.0.k6.json +++ b/evidence/track1/raw/p-c#gen2.0.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 3.99, "duration_s": 15, "failed": 0, @@ -30,10 +30,11 @@ "p99": 26.55, "rate": 200, "requests": 3001, + "successful_rps": 200.07, "vus_active": 2 }, { - "achieved_rps": 400.07, + "attempted_rps": 400.07, "avg": 4.25, "duration_s": 15, "failed": 0, @@ -43,10 +44,11 @@ "p99": 38.25, "rate": 400, "requests": 6001, + "successful_rps": 400.07, "vus_active": 5 }, { - "achieved_rps": 700.07, + "attempted_rps": 700.07, "avg": 5.69, "duration_s": 15, "failed": 0, @@ -56,10 +58,11 @@ "p99": 61.51, "rate": 700, "requests": 10501, + "successful_rps": 700.07, "vus_active": 10 }, { - "achieved_rps": 991, + "attempted_rps": 991.0, "avg": 13.38, "duration_s": 15, "failed": 0, @@ -69,10 +72,11 @@ "p99": 153.26, "rate": 1000, "requests": 14865, + "successful_rps": 991.0, "vus_active": 6 }, { - "achieved_rps": 1358.4, + "attempted_rps": 1358.4, "avg": 99.98, "duration_s": 15, "failed": 0, @@ -82,10 +86,11 @@ "p99": 423.61, "rate": 1500, "requests": 20376, + "successful_rps": 1358.4, "vus_active": 90 }, { - "achieved_rps": 1275.47, + "attempted_rps": 1275.47, "avg": 146.62, "duration_s": 15, "failed": 0, @@ -95,10 +100,11 @@ "p99": 533.66, "rate": 2000, "requests": 19132, + "successful_rps": 1275.47, "vus_active": 142 }, { - "achieved_rps": 1271.53, + "attempted_rps": 1271.53, "avg": 142.72, "duration_s": 15, "failed": 0, @@ -108,10 +114,11 @@ "p99": 435.91, "rate": 2500, "requests": 19073, + "successful_rps": 1271.53, "vus_active": 200 }, { - "achieved_rps": 1301.27, + "attempted_rps": 1301.27, "avg": 145.5, "duration_s": 15, "failed": 0, @@ -121,6 +128,7 @@ "p99": 492.98, "rate": 3000, "requests": 19519, + "successful_rps": 1301.27, "vus_active": 1 } ], diff --git a/evidence/track1/raw/p-c#lb0.25.k6.json b/evidence/track1/raw/p-c#lb0.25.k6.json index a942c71..edf1f10 100644 --- a/evidence/track1/raw/p-c#lb0.25.k6.json +++ b/evidence/track1/raw/p-c#lb0.25.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 200.07, + "attempted_rps": 200.07, "avg": 3.04, "duration_s": 15, "failed": 0, @@ -30,10 +30,11 @@ "p99": 10.1, "rate": 200, "requests": 3001, + "successful_rps": 200.07, "vus_active": 3 }, { - "achieved_rps": 400.07, + "attempted_rps": 400.07, "avg": 4.09, "duration_s": 15, "failed": 0, @@ -43,10 +44,11 @@ "p99": 43.83, "rate": 400, "requests": 6001, + "successful_rps": 400.07, "vus_active": 7 }, { - "achieved_rps": 700.07, + "attempted_rps": 700.07, "avg": 4.39, "duration_s": 15, "failed": 0, @@ -56,10 +58,11 @@ "p99": 53.61, "rate": 700, "requests": 10501, + "successful_rps": 700.07, "vus_active": 5 }, { - "achieved_rps": 999.67, + "attempted_rps": 999.67, "avg": 5.03, "duration_s": 15, "failed": 0, @@ -69,10 +72,11 @@ "p99": 55.7, "rate": 1000, "requests": 14995, + "successful_rps": 999.67, "vus_active": 9 }, { - "achieved_rps": 1419.2, + "attempted_rps": 1419.2, "avg": 79.64, "duration_s": 15, "failed": 0, @@ -82,10 +86,11 @@ "p99": 327.12, "rate": 1500, "requests": 21288, + "successful_rps": 1419.2, "vus_active": 90 }, { - "achieved_rps": 1274.2, + "attempted_rps": 1274.2, "avg": 145.65, "duration_s": 15, "failed": 0, @@ -95,10 +100,11 @@ "p99": 509.19, "rate": 2000, "requests": 19113, + "successful_rps": 1274.2, "vus_active": 123 }, { - "achieved_rps": 1331.13, + "attempted_rps": 1331.13, "avg": 130.46, "duration_s": 15, "failed": 0, @@ -108,10 +114,11 @@ "p99": 457.25, "rate": 2500, "requests": 19967, + "successful_rps": 1331.13, "vus_active": 35 }, { - "achieved_rps": 1267.67, + "attempted_rps": 1267.67, "avg": 132.9, "duration_s": 15, "failed": 0, @@ -121,6 +128,7 @@ "p99": 479.53, "rate": 3000, "requests": 19015, + "successful_rps": 1267.67, "vus_active": 1 } ], diff --git a/evidence/track1/raw/rolling.k6.json b/evidence/track1/raw/rolling.k6.json index 0d7a0e5..639ccce 100644 --- a/evidence/track1/raw/rolling.k6.json +++ b/evidence/track1/raw/rolling.k6.json @@ -14,7 +14,7 @@ "profile": "spread", "steps": [ { - "achieved_rps": 200.01, + "attempted_rps": 200.01, "avg": 4.05, "duration_s": 180, "failed": 0, @@ -30,6 +30,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 200.01, "vus_active": 0 } ], diff --git a/evidence/track1/raw/vuswap#n1-vu200.k6.json b/evidence/track1/raw/vuswap#n1-vu200.k6.json index 70ef348..f79cd14 100644 --- a/evidence/track1/raw/vuswap#n1-vu200.k6.json +++ b/evidence/track1/raw/vuswap#n1-vu200.k6.json @@ -21,7 +21,7 @@ ], "steps": [ { - "achieved_rps": 700.07, + "attempted_rps": 700.07, "avg": 4.41, "duration_s": 15, "failed": 0, @@ -37,10 +37,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 700.07, "vus_active": 41 }, { - "achieved_rps": 892.33, + "attempted_rps": 892.33, "avg": 8.83, "duration_s": 15, "failed": 0, @@ -56,10 +57,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 892.33, "vus_active": 140 }, { - "achieved_rps": 946.13, + "attempted_rps": 946.13, "avg": 163.55, "duration_s": 15, "failed": 0, @@ -75,6 +77,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 946.13, "vus_active": 200 } ], diff --git a/evidence/track1/raw/vuswap#n1-vu2000.k6.json b/evidence/track1/raw/vuswap#n1-vu2000.k6.json index a53d2e2..7bfd05b 100644 --- a/evidence/track1/raw/vuswap#n1-vu2000.k6.json +++ b/evidence/track1/raw/vuswap#n1-vu2000.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 700.07, + "attempted_rps": 700.07, "avg": 3.95, "duration_s": 15, "failed": 0, @@ -36,10 +36,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 700.07, "vus_active": 55 }, { - "achieved_rps": 893.13, + "attempted_rps": 893.13, "avg": 7.23, "duration_s": 15, "failed": 0, @@ -55,10 +56,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 893.13, "vus_active": 126 }, { - "achieved_rps": 1034.4, + "attempted_rps": 1034.4, "avg": 181.58, "duration_s": 15, "failed": 0, @@ -74,6 +76,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 1034.4, "vus_active": 500 } ], diff --git a/evidence/track1/raw/vuswap#n1-vu900.k6.json b/evidence/track1/raw/vuswap#n1-vu900.k6.json index 82a1f4e..7b9873a 100644 --- a/evidence/track1/raw/vuswap#n1-vu900.k6.json +++ b/evidence/track1/raw/vuswap#n1-vu900.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 698.67, + "attempted_rps": 698.67, "avg": 4.55, "duration_s": 15, "failed": 0, @@ -36,10 +36,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 698.67, "vus_active": 77 }, { - "achieved_rps": 895.13, + "attempted_rps": 895.13, "avg": 8.24, "duration_s": 15, "failed": 0, @@ -55,10 +56,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 895.13, "vus_active": 106 }, { - "achieved_rps": 1009.87, + "attempted_rps": 1009.87, "avg": 329.77, "duration_s": 15, "failed": 0, @@ -74,6 +76,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 1009.87, "vus_active": 633 } ], diff --git a/evidence/track1/raw/vuswap#n4-vu200.k6.json b/evidence/track1/raw/vuswap#n4-vu200.k6.json index 6e7a4e6..c220d6a 100644 --- a/evidence/track1/raw/vuswap#n4-vu200.k6.json +++ b/evidence/track1/raw/vuswap#n4-vu200.k6.json @@ -21,7 +21,7 @@ ], "steps": [ { - "achieved_rps": 697.07, + "attempted_rps": 697.07, "avg": 9.8, "duration_s": 15, "failed": 0, @@ -37,10 +37,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 697.07, "vus_active": 85 }, { - "achieved_rps": 890.53, + "attempted_rps": 890.53, "avg": 19.01, "duration_s": 15, "failed": 0, @@ -56,10 +57,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 890.53, "vus_active": 149 }, { - "achieved_rps": 927.2, + "attempted_rps": 927.2, "avg": 173.45, "duration_s": 15, "failed": 0, @@ -75,6 +77,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 927.2, "vus_active": 200 } ], diff --git a/evidence/track1/raw/vuswap#n4-vu2000.k6.json b/evidence/track1/raw/vuswap#n4-vu2000.k6.json index e7681bd..7901fa8 100644 --- a/evidence/track1/raw/vuswap#n4-vu2000.k6.json +++ b/evidence/track1/raw/vuswap#n4-vu2000.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 700.07, + "attempted_rps": 700.07, "avg": 7.15, "duration_s": 15, "failed": 0, @@ -36,10 +36,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 700.07, "vus_active": 55 }, { - "achieved_rps": 897.07, + "attempted_rps": 897.07, "avg": 13.97, "duration_s": 15, "failed": 0, @@ -55,10 +56,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 897.07, "vus_active": 71 }, { - "achieved_rps": 971.67, + "attempted_rps": 971.67, "avg": 535.8, "duration_s": 15, "failed": 0, @@ -74,6 +76,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 971.67, "vus_active": 933 } ], diff --git a/evidence/track1/raw/vuswap#n4-vu900.k6.json b/evidence/track1/raw/vuswap#n4-vu900.k6.json index 248504d..88fbdbc 100644 --- a/evidence/track1/raw/vuswap#n4-vu900.k6.json +++ b/evidence/track1/raw/vuswap#n4-vu900.k6.json @@ -21,7 +21,7 @@ ], "steps": [ { - "achieved_rps": 700.07, + "attempted_rps": 700.07, "avg": 7.44, "duration_s": 15, "failed": 0, @@ -37,10 +37,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 700.07, "vus_active": 52 }, { - "achieved_rps": 893.2, + "attempted_rps": 893.2, "avg": 47.69, "duration_s": 15, "failed": 0, @@ -56,10 +57,11 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 893.2, "vus_active": 118 }, { - "achieved_rps": 953.07, + "attempted_rps": 953.07, "avg": 533.72, "duration_s": 15, "failed": 0, @@ -75,6 +77,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 953.07, "vus_active": 900 } ], diff --git a/evidence/track1/raw/why#n1#rep1.k6.json b/evidence/track1/raw/why#n1#rep1.k6.json index 940ea66..1f5f22d 100644 --- a/evidence/track1/raw/why#n1#rep1.k6.json +++ b/evidence/track1/raw/why#n1#rep1.k6.json @@ -21,7 +21,7 @@ ], "steps": [ { - "achieved_rps": 1035.37, + "attempted_rps": 1035.37, "avg": 815.95, "duration_s": 60, "failed": 0, @@ -37,6 +37,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 1035.37, "vus_active": 900 } ], diff --git a/evidence/track1/raw/why#n4#rep1.k6.json b/evidence/track1/raw/why#n4#rep1.k6.json index 3245d03..116a040 100644 --- a/evidence/track1/raw/why#n4#rep1.k6.json +++ b/evidence/track1/raw/why#n4#rep1.k6.json @@ -21,7 +21,7 @@ ], "steps": [ { - "achieved_rps": 943.02, + "attempted_rps": 943.02, "avg": 918.72, "duration_s": 60, "failed": 0, @@ -37,6 +37,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 943.02, "vus_active": 900 } ], diff --git a/evidence/track1/raw/why#n4-api6#rep1.k6.json b/evidence/track1/raw/why#n4-api6#rep1.k6.json index ac4ebec..68dbb13 100644 --- a/evidence/track1/raw/why#n4-api6#rep1.k6.json +++ b/evidence/track1/raw/why#n4-api6#rep1.k6.json @@ -21,7 +21,7 @@ ], "steps": [ { - "achieved_rps": 891.38, + "attempted_rps": 891.38, "avg": 974.13, "duration_s": 60, "failed": 0, @@ -37,6 +37,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 891.38, "vus_active": 900 } ], diff --git a/evidence/track1/raw/why#n4-lb1#rep1.k6.json b/evidence/track1/raw/why#n4-lb1#rep1.k6.json index b0040ff..41fdb48 100644 --- a/evidence/track1/raw/why#n4-lb1#rep1.k6.json +++ b/evidence/track1/raw/why#n4-lb1#rep1.k6.json @@ -21,7 +21,7 @@ ], "steps": [ { - "achieved_rps": 922.25, + "attempted_rps": 922.25, "avg": 939.66, "duration_s": 60, "failed": 0, @@ -37,6 +37,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 922.25, "vus_active": 900 } ], diff --git a/evidence/track1/raw/why#n4-pg3#rep1.k6.json b/evidence/track1/raw/why#n4-pg3#rep1.k6.json index 3b305f4..ba0cde0 100644 --- a/evidence/track1/raw/why#n4-pg3#rep1.k6.json +++ b/evidence/track1/raw/why#n4-pg3#rep1.k6.json @@ -20,7 +20,7 @@ ], "steps": [ { - "achieved_rps": 1480.45, + "attempted_rps": 1480.45, "avg": 83, "duration_s": 60, "failed": 0, @@ -36,6 +36,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 1480.45, "vus_active": 516 } ], diff --git a/evidence/track1/raw/why#n4-pool20#rep1.k6.json b/evidence/track1/raw/why#n4-pool20#rep1.k6.json index de2f93f..70adc31 100644 --- a/evidence/track1/raw/why#n4-pool20#rep1.k6.json +++ b/evidence/track1/raw/why#n4-pool20#rep1.k6.json @@ -21,7 +21,7 @@ ], "steps": [ { - "achieved_rps": 852.68, + "attempted_rps": 852.68, "avg": 1025.57, "duration_s": 60, "failed": 0, @@ -37,6 +37,7 @@ "other": 0, "server_5xx": 0 }, + "successful_rps": 852.68, "vus_active": 900 } ], diff --git a/infra/README.md b/infra/README.md index c403c79..226a6b9 100644 --- a/infra/README.md +++ b/infra/README.md @@ -21,11 +21,14 @@ build-контекста (`.dockerignore`). Пароль БД и токен ме ## HAProxy (`haproxy.cfg`) -- **Проба backend — `GET /internal/lb-check`, а не `/health/ready`.** Недоступность - общей БД или Redis нельзя вылечить выводом реплик из ротации, а вывод всех - реплик подменил бы ограниченный ответ API (`503 unavailable` с `X-Request-Id`) - HTML-страницей ошибки балансировщика. `/health/ready` остаётся операторским - сигналом и используется healthcheck'ом контейнера. +- **Проба backend — `GET /health/ready`**, та же ручка, что у healthcheck + контейнера: реплика, потерявшая обязательную зависимость (свой путь к общей + БД или Redis), исключается из ротации, а трафик уходит на здоровые. Проба + ограничена на стороне API (`HEALTH_TIMEOUT_MS=400`: `query_timeout` для + `SELECT 1`, `AbortSignal.timeout` для `PING`) и укладывается в `timeout check + 500ms`. Когда недоступна общая для всех зависимость, неготовыми становятся все + реплики, и клиент получает `503` от самого балансировщика — честный признак + отсутствия готовых узлов; `/health/live` при этом остаётся `200`. - **Период проверки 500 ms, `fall 2`, `rise 2`** → максимальное время обнаружения отказа ≈ 1 s. Окно дреина API (`DRAIN_DELAY_MS=3000`) длиннее обнаружения, поэтому узел успевает выйти из ротации до того, как перестанет принимать diff --git a/infra/haproxy/haproxy.cfg b/infra/haproxy/haproxy.cfg index 1a69d9e..655d41c 100644 --- a/infra/haproxy/haproxy.cfg +++ b/infra/haproxy/haproxy.cfg @@ -1,11 +1,17 @@ # HAProxy — единственная точка входа lab3. # -# Проверка готовности backend: GET /internal/lb-check (не /health/ready): -# недоступность общей БД/Redis не лечится выводом реплик из ротации, а вывод -# всех реплик подменил бы ограниченный 503 API страницей ошибки LB. -# inter 500 ms, fall 2 => максимальное время обнаружения отказа ≈ 1 s, что -# короче окна дреина API (DRAIN_DELAY_MS=3000): узел уходит из ротации раньше, -# чем перестаёт обслуживать. +# Проверка готовности backend: GET /health/ready — та же ручка, что у +# healthcheck контейнера. Реплика, потерявшая обязательную зависимость (свой +# путь к общей БД или Redis), исключается из ротации, и трафик уходит на +# здоровые; при отказе общей зависимости неготовыми становятся все реплики, и +# клиент получает 503 от балансировщика — это честный признак того, что +# готовых узлов нет. +# Проба с зависимостями ограничена на стороне API: бюджет пробы 400 ms (общий +# дедлайн /health/ready, проверка БД — по отдельному соединению, не из общего +# пула) меньше timeout check 500 ms, который равен интервалу inter. Обнаружение +# отказа (inter 500 ms × fall 2 ≈ 1 s) короче окна дреина API +# (DRAIN_DELAY_MS=3000): узел уходит из ротации раньше, чем перестаёт +# обслуживать. # # Реплики не перечислены статически: server-template + DNS Docker обновляет # список адресов при масштабировании (init-addr none — стартовать без адресов @@ -41,8 +47,9 @@ frontend http backend api balance roundrobin - option httpchk GET /internal/lb-check + option httpchk GET /health/ready http-check expect status 200 + timeout check 500ms default-server check inter 500ms fastinter 250ms downinter 1s fall 2 rise 2 maxconn 200 server-template api 1-8 api:8080 resolvers docker init-addr none diff --git a/scripts/lab3/lab3.py b/scripts/lab3/lab3.py index 206f0e1..d3dbbb2 100755 --- a/scripts/lab3/lab3.py +++ b/scripts/lab3/lab3.py @@ -10,7 +10,7 @@ фильтр e2e по идемпотентности run --label ... один прогон профиля с сэмплером sweep --profile p-a серия 1/2/4 реплики (интерливинг повторов) - growth --series api|pg|pool серия роста ресурсов на фиксированном темпе + track1-extras --part why блок 1500 req/s: контроль и серия роста ресурсов failover --replicas all фазовый драйвер отказа реплики rolling-update --under-load поочерёдная замена реплик под нагрузкой ab --before T --after T интерливинг A/B двух образов @@ -1025,15 +1025,26 @@ def group_runs(labels: list[str], predicate) -> dict[str, list[str]]: def saturation(series: list[dict]) -> dict: - """Точка сатурации: первый шаг, где достигнутый RPS отстал от предложенного.""" + """Точка сатурации: первый шаг, где успешный RPS отстал от предложенного.""" for step in series: - if step['achieved_rps'] < 0.95 * step['rate']: - return {'rate': step['rate'], 'achieved_rps': step['achieved_rps'], 'step': step} - return {'rate': series[-1]['rate'] if series else 0, 'achieved_rps': series[-1]['achieved_rps'] if series else 0, 'step': series[-1] if series else None} + if step['successful_rps'] < 0.95 * step['rate']: + return {'rate': step['rate'], 'successful_rps': step['successful_rps'], 'step': step} + last = series[-1] if series else None + return { + 'rate': last['rate'] if last else 0, + 'successful_rps': last['successful_rps'] if last else 0, + 'step': last, + } def summarise_series(labels: list[str]) -> dict: - """Медианы по повторам для одной конфигурации: шаги лестницы и пик.""" + """Медианы по повторам для одной конфигурации: шаги лестницы и пик. + + Успешная пропускная способность (`successful_rps`) — рабочая величина: + сатурация, потолок и вердикты считаются по ней. Частота ответов + (`attempted_rps`) сохраняется отдельно, чтобы было видно, сколько запросов + сервис довёл до ответа, включая отказы. + """ steps: dict[int, dict] = {} for label in labels: summary = read_json(RAW_DIR / f'{label}.k6.json', {}) @@ -1041,13 +1052,13 @@ def summarise_series(labels: list[str]) -> dict: rate = int(step['rate']) entry = steps.setdefault( rate, - {'rate': rate, 'achieved': [], 'p95': [], 'failed': [], 'vus': [], 'offered': [], 'status_5xx': [], 'status_4xx': []}, + {'rate': rate, 'successful': [], 'attempted': [], 'p95': [], 'failed': [], 'vus': [], 'status_5xx': [], 'status_4xx': []}, ) - entry['achieved'].append(float(step['achieved_rps'])) + entry['successful'].append(float(step['successful_rps'])) + entry['attempted'].append(float(step['attempted_rps'])) entry['p95'].append(float(step['p95'])) entry['failed'].append(float(step['failed'])) entry['vus'].append(float(step.get('vus_active') or 0)) - entry['offered'].append(float(step['rate'])) entry['status_5xx'].append(float((step.get('status') or {}).get('server_5xx') or 0)) entry['status_4xx'].append(float((step.get('status') or {}).get('client_4xx') or 0)) rows = [] @@ -1056,19 +1067,22 @@ def summarise_series(labels: list[str]) -> dict: rows.append( { 'rate': rate, - 'achieved_rps': median(entry['achieved']), - 'achieved_min': spread(entry['achieved'])[0], - 'achieved_max': spread(entry['achieved'])[1], + 'successful_rps': median(entry['successful']), + 'successful_min': spread(entry['successful'])[0], + 'successful_max': spread(entry['successful'])[1], + 'attempted_rps': median(entry['attempted']), + 'attempted_min': spread(entry['attempted'])[0], + 'attempted_max': spread(entry['attempted'])[1], 'p95': median(entry['p95']), 'p95_max': spread(entry['p95'])[1], 'failed': sum(entry['failed']), 'vus_active': max(entry['vus']) if entry['vus'] else 0, 'status_5xx': int(max(entry['status_5xx'])) if entry['status_5xx'] else 0, 'status_4xx': int(max(entry['status_4xx'])) if entry['status_4xx'] else 0, - 'reps': len(entry['achieved']), + 'reps': len(entry['successful']), } ) - ceiling = max((row['achieved_rps'] for row in rows), default=0.0) + ceiling = max((row['successful_rps'] for row in rows), default=0.0) return {'rows': rows, 'ceiling_rps': ceiling, 'saturation': saturation(rows), 'labels': labels} @@ -1277,10 +1291,10 @@ def analyse_mechanism(groups: dict, labels: list[str]) -> None: generator_peak = max((value['cpu_peak'] for name, value in stats.items() if 'loadgen' in name), default=0.0) lines += [f'## {key} ({len(group)} повторов)', ''] lines += table( - ['достигнуто RPS', 'p95, ms', 'failed', '2xx', '4xx', '5xx', 'прочее', 'CPU API: пик реплики, % её квоты', 'CPU PG пик, % ядра', 'CPU ген. пик, % ядра'], + ['успешный RPS', 'p95, ms', 'failed', '2xx', '4xx', '5xx', 'прочее', 'CPU API: пик реплики, % её квоты', 'CPU PG пик, % ядра', 'CPU ген. пик, % ядра'], [ [ - step.get('achieved_rps'), + step['successful_rps'], step.get('p95'), step.get('failed'), (step.get('status') or {}).get('ok'), @@ -1478,13 +1492,20 @@ def report_series(profile: str, prefix: str) -> None: for key, group in groups.items(): series = summarise_series(group) lines += table( - ['темп', 'достигнуто RPS', 'min', 'max', 'p95', 'ошибок'], + ['темп', 'успешный RPS', 'min..max', 'ответов RPS', 'p95', 'ошибок'], [ - [row['rate'], row['achieved_rps'], row['achieved_min'], row['achieved_max'], row['p95'], row['failed']] + [ + row['rate'], + row['successful_rps'], + f'{row["successful_min"]}..{row["successful_max"]}', + row['attempted_rps'], + row['p95'], + row['failed'], + ] for row in series['rows'] ], ) - lines.append(f'Потолок {key}: {series["ceiling_rps"]} req/s, сатурация на {series["saturation"]["rate"]} req/s ({len(group)} повторов)') + lines.append(f'Потолок {key}: {series["ceiling_rps"]} req/s успешных, сатурация на {series["saturation"]["rate"]} req/s ({len(group)} повторов)') lines.append('') write_markdown(TRACK1_DIR / f'summary-live-{profile}.md', f'Текущие агрегаты {profile}', lines) @@ -1507,60 +1528,6 @@ def group_configurations(labels: list[str]) -> dict[str, list[str]]: return {key: sorted(value) for key, value in sorted(groups.items())} -def knee_rate(profile: str, prefix: str = 'p-a') -> int: - labels = [label for label in raw_labels() if label.startswith(f'{prefix}#n4#')] - if not labels: - return 400 - series = summarise_series(labels) - rows = series['rows'] - for row in rows: - if row['achieved_rps'] < 0.95 * row['rate']: - previous = rows[max(0, rows.index(row) - 1)] - return int(previous['rate']) - return int(rows[-1]['rate']) if rows else 400 - - -def cmd_growth(args) -> None: - base = load_stand_config() - rate = args.rate or max(1, int(knee_rate(args.base_profile) * 0.8)) - points = { - 'api': [ - {'API_TOTAL_CPUS': str(float(base.get('API_TOTAL_CPUS', API_TOTAL_CPUS)) * 2), 'label': 'api-total-6'}, - ], - 'pg': [ - {'PG_CPUS': '3.0', 'label': 'pg-3.0'}, - ], - 'pool': [ - {'DATABASE_POOL_MAX': '5', 'label': 'pool-5'}, - {'DATABASE_POOL_MAX': '20', 'label': 'pool-20'}, - ], - } - log(f'серия роста {args.series} на темпе {rate} req/s (80% от колена {args.base_profile})') - # Каждая точка отличается от базовой конфигурации ровно одним ресурсом: - # остальные значения прибиты к базовым, иначе после точки «API x2» следующий - # ресурс мерился бы уже с удвоенным бюджетом API. - baseline = { - 'API_REPLICAS': '4', - 'API_TOTAL_CPUS': str(DEFAULT_STAND['API_TOTAL_CPUS']), - 'PG_CPUS': str(DEFAULT_STAND['PG_CPUS']), - 'DATABASE_POOL_MAX': str(DEFAULT_STAND['DATABASE_POOL_MAX']), - 'LB_CPUS': str(DEFAULT_STAND['LB_CPUS']), - } - for point in points[args.series]: - overrides = { - **baseline, - **{key: value for key, value in point.items() if key != 'label'}, - } - ensure_stand(overrides) - run_measured( - f'growth#{point["label"]}{args.suffix}', - args.base_profile, - rate=rate, - duration=args.duration, - warmup=not args.no_warmup, - ) - - class MessageProbe(threading.Thread): """Последовательный клиент: измеряет успешность записи и повторяет неопределённый POST тем же ключом (как это делает реальный клиент).""" @@ -1787,7 +1754,8 @@ def failover_once(target: str, args, config: dict) -> dict: 'missing_confirmed': missing, 'haproxy': haproxy_stats(samples), 'k6': { - 'achieved_rps': summary['steps'][0]['achieved_rps'] if summary else None, + 'successful_rps': summary['steps'][0]['successful_rps'] if summary else None, + 'attempted_rps': summary['steps'][0]['attempted_rps'] if summary else None, 'failed': summary['steps'][0]['failed'] if summary else None, 'dropped': summary.get('dropped_iterations') if summary else None, }, @@ -1851,7 +1819,7 @@ def write_failover_evidence(results: list[dict]) -> None: 'ошибок в окне', 'RPS без реплики', 'RPS после', - 'k6 RPS', + 'k6 успешный RPS', 'k6 ошибок', 'дубли', 'потери', @@ -1872,7 +1840,7 @@ def write_failover_evidence(results: list[dict]) -> None: result['probe']['errors_stop_window'], result['probe']['rps_while_stopped'], result['probe']['rps_after'], - result['k6']['achieved_rps'], + result['k6']['successful_rps'], result['k6']['failed'], len(result['duplicates']), len(result['missing_confirmed']), @@ -1990,7 +1958,11 @@ def cmd_rolling(args) -> None: 'under_load': bool(args.under_load), 'steps': steps, 'probe': {'attempts': len(probe.samples), 'failures': len(failures), 'server_5xx': len(server_failures)}, - 'k6': {'achieved_rps': summary['steps'][0]['achieved_rps'] if summary else None, 'failed': summary['steps'][0]['failed'] if summary else None}, + 'k6': { + 'successful_rps': summary['steps'][0]['successful_rps'] if summary else None, + 'attempted_rps': summary['steps'][0]['attempted_rps'] if summary else None, + 'failed': summary['steps'][0]['failed'] if summary else None, + }, 'migrate': {'before': migrate_before, 'after': migrate_after, 'restarted': migrate_before != migrate_after}, 'build_stderr_tail': build.stderr.strip().splitlines()[-3:], } @@ -2080,6 +2052,25 @@ def cmd_ab(args) -> None: report_ab(args, plan) +def ab_side_stats(row: dict) -> dict: + """Сторона A/B в вердикте: успешный RPS медианой и диапазоном повторов. + + Частота всех ответов и классы отказов остаются рядом как диагностика — + именно они объясняют расхождение, а не заменяют пропускную способность. + """ + return { + 'successful_rps': row['successful_rps'], + 'successful_min': row['successful_min'], + 'successful_max': row['successful_max'], + 'attempted_rps': row['attempted_rps'], + 'p95': row['p95'], + 'failed': row['failed'], + 'status_5xx': row['status_5xx'], + 'status_4xx': row['status_4xx'], + 'reps': row['reps'], + } + + def report_ab(args=None, plan: dict | None = None) -> None: prefix = getattr(args, 'prefix', 'ab') if args else 'ab' labels = [label for label in raw_labels() if label.startswith(f'{prefix}#')] @@ -2098,50 +2089,70 @@ def report_ab(args=None, plan: dict | None = None) -> None: RAW_DIR / f'{groups[f"{prefix}#{side}"][-1]}.manifest.json', {} ) images[side] = (manifest.get('stand') or {}).get('API_IMAGE') + rows = [] for rate in sorted({row['rate'] for row in series_by_side['A']['rows']}): row_a = next((row for row in series_by_side['A']['rows'] if row['rate'] == rate), None) row_b = next((row for row in series_by_side['B']['rows'] if row['rate'] == rate), None) if not row_a or not row_b: continue + # Δ считается по успешной пропускной способности: ответы об ошибках, + # которых у стороны A на насыщении большинство, не должны выглядеть + # как выполненная работа. change = ( - round((row_b['achieved_rps'] - row_a['achieved_rps']) / row_a['achieved_rps'] * 100, 2) - if row_a['achieved_rps'] + round((row_b['successful_rps'] - row_a['successful_rps']) / row_a['successful_rps'] * 100, 2) + if row_a['successful_rps'] else 0.0 ) confirmed = ( abs(change) >= 5.0 - and (row_b['achieved_min'] > row_a['achieved_max'] or row_a['achieved_min'] > row_b['achieved_max']) + and (row_b['successful_min'] > row_a['successful_max'] or row_a['successful_min'] > row_b['successful_max']) ) - verdicts.append({'rate': rate, 'change_percent': change, 'confirmed': confirmed}) + verdicts.append({ + 'rate': rate, + 'change_percent': change, + 'confirmed': confirmed, + 'a': ab_side_stats(row_a), + 'b': ab_side_stats(row_b), + }) lines.append( - f'{rate} req/s: A {row_a["achieved_rps"]} [{row_a["achieved_min"]}; {row_a["achieved_max"]}] vs ' - f'B {row_b["achieved_rps"]} [{row_b["achieved_min"]}; {row_b["achieved_max"]}] -> {change}% ' - f'({"подтверждено" if confirmed else "не подтверждено"})' + f'{rate} req/s: A {row_a["successful_rps"]} успешных [{row_a["successful_min"]}; {row_a["successful_max"]}] ' + f'(всего ответов {row_a["attempted_rps"]}) vs B {row_b["successful_rps"]} [{row_b["successful_min"]}; {row_b["successful_max"]}] ' + f'(всего ответов {row_b["attempted_rps"]}) -> {change}% ({"подтверждено" if confirmed else "не подтверждено"})' + ) + rows.append( + [ + rate, + f'{row_a["successful_rps"]} ({row_a["successful_min"]}..{row_a["successful_max"]})', + row_a['p95'], + row_a['attempted_rps'], + f'{row_b["successful_rps"]} ({row_b["successful_min"]}..{row_b["successful_max"]})', + row_b['p95'], + row_b['attempted_rps'], + change, + 'подтверждено' if confirmed else 'не подтверждено', + ] ) lines.append('') lines += table( - ['шаг', 'образ A: RPS (min..max)', 'p95 A', 'образ B: RPS (min..max)', 'p95 B', 'Δ, %', 'вывод'], [ - [ - verdict['rate'], - f'{next(row for row in series_by_side["A"]["rows"] if row["rate"] == verdict["rate"])["achieved_rps"]}' - f' ({next(row for row in series_by_side["A"]["rows"] if row["rate"] == verdict["rate"])["achieved_min"]}..' - f'{next(row for row in series_by_side["A"]["rows"] if row["rate"] == verdict["rate"])["achieved_max"]})', - next(row for row in series_by_side['A']['rows'] if row['rate'] == verdict['rate'])['p95'], - f'{next(row for row in series_by_side["B"]["rows"] if row["rate"] == verdict["rate"])["achieved_rps"]}' - f' ({next(row for row in series_by_side["B"]["rows"] if row["rate"] == verdict["rate"])["achieved_min"]}..' - f'{next(row for row in series_by_side["B"]["rows"] if row["rate"] == verdict["rate"])["achieved_max"]})', - next(row for row in series_by_side['B']['rows'] if row['rate'] == verdict['rate'])['p95'], - verdict['change_percent'], - 'подтверждено' if verdict['confirmed'] else 'не подтверждено', - ] - for verdict in verdicts + 'шаг, req/s', + 'A: успешный RPS (min..max)', + 'A: p95, ms', + 'A: ответов RPS', + 'B: успешный RPS (min..max)', + 'B: p95, ms', + 'B: ответов RPS', + 'Δ успешных, %', + 'вывод', ], + rows, ) lines += [ - f'Потолок A: {series_by_side["A"]["ceiling_rps"]} req/s, потолок B: {series_by_side["B"]["ceiling_rps"]} req/s', + f'Потолок A: {series_by_side["A"]["ceiling_rps"]} успешных req/s, потолок B: {series_by_side["B"]["ceiling_rps"]} успешных req/s', '', - 'Правило подтверждения: медиана меняется ≥5 % и диапазоны min/max повторов не перекрываются.', + 'Δ = (B − A) / A по медиане успешного RPS; «ответов RPS» — частота всех полученных ответов, ' + 'диагностическая величина (на насыщении она растёт, хотя полезная работа падает).', + 'Правило подтверждения: медиана успешного RPS меняется ≥5 % и диапазоны min/max повторов не перекрываются.', ] suffix = '' if prefix == 'ab' else f'-{prefix}' write_json( @@ -2157,7 +2168,7 @@ def report_ab(args=None, plan: dict | None = None) -> None: if groups.get(f'{prefix}#A') else None ), - 'rule': 'медиана меняется ≥5 % и диапазоны min/max повторов не пересекаются', + 'rule': 'медиана успешного RPS меняется ≥5 % и диапазоны min/max повторов не пересекаются', 'captured_at': now_iso(), 'commit': run_command(['git', 'rev-parse', 'HEAD'], check=False).stdout.strip(), }, @@ -2187,7 +2198,7 @@ def representative(group: list[str]) -> str: for label in group: summary = read_json(RAW_DIR / f'{label}.k6.json', {}) steps = summary.get('steps', []) - peak = max((step['achieved_rps'] for step in steps), default=0.0) + peak = max((float(step['successful_rps']) for step in steps), default=0.0) scored.append((peak, label)) if not scored: raise SystemExit('нет прогонов для анализа') @@ -2195,6 +2206,20 @@ def representative(group: list[str]) -> str: return scored[len(scored) // 2][1] +def ab_prefixes(labels: list[str]) -> list[str]: + """Префиксы A/B-серий, у которых в raw есть обе стороны (ab, abdiag, …). + + Иначе вердикт серии, пересобранной не последней, остался бы с прежними + числами: analyze обязан пересчитывать все вердикты из raw. + """ + prefixes = set() + for label in labels: + parts = label.split('#') + if len(parts) >= 2 and parts[1] in ('A', 'B'): + prefixes.add(parts[0]) + return sorted(prefixes) + + def cmd_analyze(args) -> None: labels = raw_labels() if not labels: @@ -2203,11 +2228,12 @@ def cmd_analyze(args) -> None: analyse_runs(groups) analyse_series_a(groups, labels) analyse_diagnostics(groups, labels) - analyse_growth(groups, labels) + analyse_growth(groups) + analyse_probe_check(groups) analyse_mechanism(groups, labels) - if groups.get('ab#A') or groups.get('ab#B'): - report_ab() - make_graphs(groups, labels) + for prefix in ab_prefixes(labels): + report_ab(argparse.Namespace(prefix=prefix)) + make_graphs(groups) log('analyze: таблицы и графики обновлены') @@ -2226,12 +2252,13 @@ def analyse_runs(groups: dict) -> None: reps_note = 'одиночный прогон' if len(group) == 1 else f'{len(group)} прогонов' lines += [f'## {key} ({reps_note}, {series_kind(group)})', ''] lines += table( - ['темп, req/s', 'достигнуто RPS', 'min..max', 'p95, ms', 'ошибок', 'VU', 'dropped', '5xx', '4xx'], + ['темп, req/s', 'успешный RPS', 'min..max', 'ответов RPS', 'p95, ms', 'ошибок', 'VU', 'dropped', '5xx', '4xx'], [ [ row['rate'], - row['achieved_rps'], - f'{row["achieved_min"]}..{row["achieved_max"]}', + row['successful_rps'], + f'{row["successful_min"]}..{row["successful_max"]}', + row['attempted_rps'], row['p95'], row['failed'], row['vus_active'], @@ -2245,8 +2272,8 @@ def analyse_runs(groups: dict) -> None: if series_kind(group) == 'ladder': saturation = series['saturation'] lines.append( - f'Потолок {series["ceiling_rps"]} req/s, сатурация {saturation["rate"]} req/s ' - f'({saturation["achieved_rps"]} req/s достигнуто).' + f'Потолок {series["ceiling_rps"]} успешных req/s, сатурация {saturation["rate"]} req/s ' + f'({saturation["successful_rps"]} успешных req/s достигнуто).' ) lines.append('') limits = manifest.get('stand', {}) if manifest else {} @@ -2308,12 +2335,13 @@ def analyse_series_a(groups: dict, labels: list[str]) -> None: lines.append(f'## {key} ({len(group)} повторов)') lines.append('') lines += table( - ['темп, req/s', 'достигнуто RPS', 'min..max', 'p95, ms', 'p95 max', 'ошибок', 'VU'], + ['темп, req/s', 'успешный RPS', 'min..max', 'ответов RPS', 'p95, ms', 'p95 max', 'ошибок', 'VU'], [ [ row['rate'], - row['achieved_rps'], - f'{row["achieved_min"]}..{row["achieved_max"]}', + row['successful_rps'], + f'{row["successful_min"]}..{row["successful_max"]}', + row['attempted_rps'], row['p95'], row['p95_max'], row['failed'], @@ -2324,8 +2352,8 @@ def analyse_series_a(groups: dict, labels: list[str]) -> None: ) saturation = series['saturation'] lines.append( - f'Потолок: **{series["ceiling_rps"]} req/s**; сатурация: {saturation["rate"]} req/s ' - f'(достигнуто {saturation["achieved_rps"]} req/s).' + f'Потолок: **{series["ceiling_rps"]} успешных req/s**; сатурация: {saturation["rate"]} req/s ' + f'(достигнуто {saturation["successful_rps"]} успешных req/s).' ) lines.append('') label = representative(group) @@ -2366,8 +2394,8 @@ def saturation_conclusion(series_by_n: dict) -> list[str]: for key, series in sorted(series_by_n.items()): saturation = series['saturation'] lines.append( - f'- {key}: knee на {saturation["rate"]} req/s (достигнуто {saturation["achieved_rps"]} req/s), ' - f'потолок {series["ceiling_rps"]} req/s.' + f'- {key}: knee на {saturation["rate"]} req/s (достигнуто {saturation["successful_rps"]} успешных req/s), ' + f'потолок {series["ceiling_rps"]} успешных req/s.' ) lines.append('') return lines @@ -2386,11 +2414,11 @@ def analyse_diagnostics(groups: dict, labels: list[str]) -> None: lines.append(f'## {key} (темпы {series["rows"][0]["rate"]}..{series["rows"][-1]["rate"]} req/s)') lines.append('') lines += table( - ['темп', 'достигнуто RPS', 'p95, ms', 'ошибок'], - [[row['rate'], row['achieved_rps'], row['p95'], row['failed']] for row in series['rows']], + ['темп', 'успешный RPS', 'ответов RPS', 'p95, ms', 'ошибок'], + [[row['rate'], row['successful_rps'], row['attempted_rps'], row['p95'], row['failed']] for row in series['rows']], ) lines.append( - f'Потолок {series["ceiling_rps"]} req/s, knee на {series["saturation"]["rate"]} req/s. ' + f'Потолок {series["ceiling_rps"]} успешных req/s, knee на {series["saturation"]["rate"]} req/s. ' f'Лимиты: LB {manifest["stand"].get("LB_CPUS")} CPU, API {manifest["stand"].get("API_CPUS_PER_REPLICA")} CPU / ' f'{manifest["stand"].get("API_MEMORY_PER_REPLICA")}, PG {manifest["stand"].get("PG_CPUS")} CPU.' ) @@ -2413,64 +2441,280 @@ def analyse_diagnostics(groups: dict, labels: list[str]) -> None: write_markdown(TRACK1_DIR / 'summary-diagnostics.md', 'Диагностика: горячий чат и путь чтения', lines) -def analyse_growth(groups: dict, labels: list[str]) -> None: - growth = {key: group for key, group in groups.items() if key.startswith('growth#')} - if not growth: - write_markdown(TRACK1_DIR / 'summary-growth.md', 'Серия роста ресурсов', ['Нет прогонов growth.']) +def growth_point(key: str, group: list[str], rate: int) -> dict | None: + """Точка серии роста ровно на этом темпе или None. + + Возвращает None, если хотя бы у одного повтора нет ступени с этим темпом: + подставлять соседнюю полку в сравнение нельзя — иначе рост на 560 req/s + оказался бы рядом с 900 и «разностью» ресурсов. Успешный RPS — медиана по + повторам (как и в остальных таблицах), ресурсы — из представительного + прогона (медианного по пику). + """ + steps = [] + for run in group: + step = step_of(read_json(RAW_DIR / f'{run}.k6.json', {}), rate) + if step is None: + return None + steps.append(step) + successful = [float(step['successful_rps']) for step in steps] + attempted = [float(step['attempted_rps']) for step in steps] + label = representative(group) + _, samples, manifest = load_raw(label) + manifest = manifest or {} + stand = manifest.get('stand') or {} + stats = container_stats(samples) + api_peak = max((value['cpu_peak'] for name, value in stats.items() if 'api' in name), default=0.0) + api_limit = float(stand.get('API_CPUS_PER_REPLICA') or 0) + return { + 'key': key, + 'label': label, + 'profile': manifest.get('profile'), + 'mode': manifest.get('mode'), + 'rate': rate, + 'successful_rps': median(successful), + 'successful_min': spread(successful)[0], + 'successful_max': spread(successful)[1], + 'attempted_rps': median(attempted), + 'p95': median([float(step.get('p95') or 0) for step in steps]), + 'failed': sum(step.get('failed') or 0 for step in steps), + 'status_5xx': sum((step.get('status') or {}).get('server_5xx') or 0 for step in steps), + 'status_4xx': sum((step.get('status') or {}).get('client_4xx') or 0 for step in steps), + 'vus_active': max(step.get('vus_active') or 0 for step in steps), + 'max_vus': (manifest.get('generator') or {}).get('max_vus'), + 'dropped': sum( + read_json(RAW_DIR / f'{run}.k6.json', {}).get('dropped_iterations', 0) for run in group + ), + 'api_peak_quota': round(api_peak / (api_limit * 100) * 100, 2) if api_limit else 0.0, + 'pg_peak': stats.get('mtusi-lab3-postgres-1', {}).get('cpu_peak', 0.0), + 'reps': len(group), + } + + +LADDER_MARKERS = ('o', 's', '^', 'D', 'v', 'P', 'X') + +# Серия роста — блок why# (1500 req/s, за коленом): контроль why#n4 и точки, +# каждая из которых отличается от него ровно одним ключом бюджета. +GROWTH_CONTROL = 'why#n4' +GROWTH_POINTS = { + 'why#n4-api6': ('API ×2 (6.0 CPU)', 'API_TOTAL_CPUS'), + 'why#n4-pg3': ('PostgreSQL ×2 (3.0 CPU)', 'PG_CPUS'), + 'why#n4-pool5': ('пул 5', 'DATABASE_POOL_MAX'), + 'why#n4-pool20': ('пул 20', 'DATABASE_POOL_MAX'), + 'why#n4-lb1': ('LB ×4 (1.0 CPU)', 'LB_CPUS'), +} +GROWTH_BUDGET_KEYS = ('API_REPLICAS', 'API_TOTAL_CPUS', 'PG_CPUS', 'DATABASE_POOL_MAX', 'LB_CPUS') +# Разброс повторов на насыщении (REPORT, «Границы измерения»: ±5–8 %): меньшие +# различия одиночных прогонов не считаются эффектом рычага. +GROWTH_NOISE_PERCENT = 8.0 + + +def _budget_value(value) -> str | None: + if value is None: + return None + try: + return str(float(value)) + except (TypeError, ValueError): + return str(value) + + +def growth_comparability(control_group: list[str], group: list[str], changed_key: str) -> str | None: + """None, если точка сопоставима с контролем; иначе причина. + + Сопоставимость проверяется по манифестам: тот же темп, профиль, режим, + коммит, образ и генератор, а из ключей бюджета отличается ровно changed_key. + """ + + def facts(label: str) -> tuple[dict, dict]: + manifest = read_json(RAW_DIR / f'{label}.manifest.json', {}) or {} + summary = read_json(RAW_DIR / f'{label}.k6.json', {}) or {} + generator = manifest.get('generator') or {} + stand = manifest.get('stand') or {} + fields = { + 'темп': tuple(int(step['rate']) for step in summary.get('steps', [])), + 'profile': manifest.get('profile'), + 'mode': manifest.get('mode'), + 'commit': manifest.get('commit'), + 'stand.API_IMAGE': stand.get('API_IMAGE'), + 'generator.max_vus': generator.get('max_vus'), + 'generator.cpus': generator.get('cpus'), + 'generator.memory': generator.get('memory'), + } + return fields, stand + + reference, reference_stand = facts(control_group[0]) + runs = [(label, False) for label in control_group[1:]] + [(label, True) for label in group] + for label, is_point in runs: + fields, stand = facts(label) + for name, value in fields.items(): + if value != reference[name]: + return f'{name}: {value} ≠ {reference[name]}' + for key in GROWTH_BUDGET_KEYS: + value = _budget_value(stand.get(key)) + expected = _budget_value(reference_stand.get(key)) + if is_point and key == changed_key: + if value == expected: + return f'{key}: {value} совпадает с контролем, рычаг не менялся' + elif value != expected: + return f'{key}: {value} ≠ {expected}' + return None + + +def growth_series(groups: dict) -> tuple[dict | None, list[dict], list[tuple[str, str, str]]]: + """Контроль, сопоставимые точки (с Δ и выводом) и исключённые с причиной.""" + control_group = groups.get(GROWTH_CONTROL) + if not control_group: + return None, [], [] + rate = None + for step in read_json(RAW_DIR / f'{control_group[0]}.k6.json', {}).get('steps', []): + rate = int(step['rate']) + if rate is None: + return None, [], [] + control = growth_point(GROWTH_CONTROL, control_group, rate) + if control is None: + return None, [], [] + points: list[dict] = [] + omitted: list[tuple[str, str, str]] = [] + for key, (name, changed_key) in GROWTH_POINTS.items(): + group = groups.get(key) + if not group: + omitted.append((key, name, 'не снята на этом темпе')) + continue + point = growth_point(key, group, rate) + if point is None: + omitted.append((key, name, f'нет ступени {rate} req/s')) + continue + reason = growth_comparability(control_group, group, changed_key) + if reason: + omitted.append((key, name, reason)) + continue + base = control['successful_rps'] + delta = round((point['successful_rps'] - base) / base * 100, 1) if base else 0.0 + if delta >= GROWTH_NOISE_PERCENT: + verdict = 'рычаг поднимает потолок' + elif delta <= -GROWTH_NOISE_PERCENT: + verdict = 'ухудшает' + else: + verdict = 'в пределах разброса' + point.update(name=name, delta=delta, verdict=verdict) + points.append(point) + return control, points, omitted + + +def growth_table_row(point: dict, control: bool = False) -> list: + return [ + point['key'], + 'контроль N=4' if control else point['name'], + f'{point["successful_rps"]} ({point["successful_min"]}..{point["successful_max"]})', + '—' if control else f'{point["delta"]:+}', + point['p95'], + point['status_5xx'], + point['dropped'], + f'{point["vus_active"]} / {point["max_vus"]}', + point['api_peak_quota'], + point['pg_peak'], + 'контроль' if control else point['verdict'], + ] + + +GROWTH_TABLE_HEADER = [ + 'точка', + 'что изменено', + 'успешный RPS (min..max)', + 'Δ к контролю, %', + 'p95, ms', + '5xx', + 'dropped', + 'VU пик / бюджет', + 'CPU API: пик реплики, % её квоты', + 'CPU PG пик, % ядра', + 'вывод', +] + + +def analyse_growth(groups: dict) -> None: + """Серия роста ресурсов: блок why# на одном темпе, один ключ бюджета на точку.""" + control, points, omitted = growth_series(groups) + if control is None: + write_markdown(TRACK1_DIR / 'summary-growth.md', 'Серия роста ресурсов', ['Нет контроля why#n4.']) return - lines = [] - baseline_labels = [label for label in labels if label.startswith('p-a#n4#')] - baseline = summarise_series(baseline_labels) if baseline_labels else None - if baseline: - rate = max((row['rate'] for row in growth_rows(growth)), default=0) - row = step_of_rate(baseline['rows'], rate) - lines.append( - f'Ориентир по колену (серия A, N=4, темп {rate} req/s, сборка C1, MAX_VUS=200): ' - f'**{row["achieved_rps"]} req/s**, p95 {row["p95"]} ms — генератор был ограничен пулом VU.' - ) - control = groups.get('block#n4') - if control: - control_row = step_of_rate(summarise_series(control)['rows'], rate) - lines.append( - f'Контроль на том же темпе, MAX_VUS=900 (block#n4, 2 повтора): ' - f'**{control_row["achieved_rps"]} req/s**, p95 {control_row["p95"]} ms.' - ) + manifest = read_json(RAW_DIR / f'{control["label"]}.manifest.json', {}) or {} + lines = [ + f'Блок {control["rate"]} req/s, N=4, одно временное окно, MAX_VUS={control["max_vus"]}, ' + f'коммит `{str(manifest.get("commit") or "")[:7]}`. Каждая точка отличается от контроля ' + 'одним ключом бюджета; сопоставимость проверена по манифестам.', + '', + ] + rows = [growth_table_row(control, control=True)] + [growth_table_row(point) for point in points] + lines += table(GROWTH_TABLE_HEADER, rows) + if any(point['reps'] == 1 for point in [control] + points): + lines += [ + f'Одиночные прогоны: различия меньше ±{GROWTH_NOISE_PERCENT:g} % не интерпретируются.', + '', + ] + if omitted: + lines += ['Вне сравнения:', ''] + lines += [f'- `{key}` ({name}): {reason}' for key, name, reason in omitted] lines.append('') - lines += table( - ['точка', 'темп', 'достигнуто RPS', 'p95, ms', 'ошибок', 'CPU API: пик реплики, % её квоты', 'CPU PG пик, % ядра'], - [growth_row(key, group) for key, group in sorted(growth.items())], - ) write_markdown(TRACK1_DIR / 'summary-growth.md', 'Серия роста ресурсов', lines) -def growth_rows(growth: dict): - for group in growth.values(): - summary = read_json(RAW_DIR / f'{representative(group)}.k6.json', {}) - yield from summary.get('steps', []) +def analyse_probe_check(groups: dict) -> None: + """Проба готовности под перегрузкой: probecheck#n4 против эталона why#n4.""" + probe = groups.get('probecheck#n4') + reference = groups.get(GROWTH_CONTROL) + if not probe or not reference: + return + rows = [] + successful: dict[str, list[float]] = {} + probe_statuses: set[str] = set() + probe_5xx = 0 + for key, group, check in ((GROWTH_CONTROL, reference, '/internal/lb-check'), ('probecheck#n4', probe, '/health/ready')): + for label in sorted(group): + summary, samples, manifest = load_raw(label) + manifest = manifest or {} + step = (summary or {}).get('steps', [None])[0] + if step is None: + continue + slots = {name: value for name, value in haproxy_stats(samples).items() if value['requests'] > 0} + statuses = sorted({status for value in slots.values() for status in value['statuses']}) + five_xx = (step.get('status') or {}).get('server_5xx') or 0 + successful.setdefault(key, []).append(float(step['successful_rps'])) + if key == 'probecheck#n4': + probe_statuses.update(statuses) + probe_5xx += five_xx + rows.append( + [ + label, + str(manifest.get('commit') or '')[:7], + check, + step['successful_rps'], + step.get('p95'), + five_xx, + (summary or {}).get('dropped_iterations', 0), + (manifest.get('dataset') or {}).get('messages'), + ', '.join(statuses), + ] + ) + if 'probecheck#n4' not in successful or GROWTH_CONTROL not in successful: + return + base = median(successful[GROWTH_CONTROL]) + delta = (median(successful['probecheck#n4']) - base) / base * 100 if base else 0.0 + lines = table( + ['прогон', 'коммит', 'проба LB', 'успешный RPS', 'p95, ms', '5xx', 'dropped', 'сообщений в БД', 'статусы слотов LB'], + rows, + ) + lines += [ + f'Слоты LB всё время UP: {"да" if probe_statuses == {"UP"} else "нет"}', + '', + f'Δ успешного RPS к why#n4: {delta:+.1f} % (порог разброса ±{GROWTH_NOISE_PERCENT:g} %)', + f'5xx на probecheck#n4: {probe_5xx}', + '', + ] + write_markdown(TRACK1_DIR / 'summary-probe-check.md', 'Проба готовности под перегрузкой', lines) -def step_of_rate(rows: list[dict], rate: int) -> dict: - for row in rows: - if row['rate'] == rate: - return row - return rows[-1] if rows else {'rate': 0, 'achieved_rps': 0, 'p95': 0} - - -def growth_row(key: str, group: list[str]) -> list: - label = representative(group) - summary = read_json(RAW_DIR / f'{label}.k6.json', {}) - _, samples, manifest = load_raw(label) - step = summary['steps'][0] if summary.get('steps') else {'rate': 0, 'achieved_rps': 0, 'p95': 0, 'failed': 0} - stats = container_stats(samples) - api_peak = max((value['cpu_peak'] for name, value in stats.items() if 'api' in name), default=0.0) - api_limit = float((manifest or {}).get('stand', {}).get('API_CPUS_PER_REPLICA') or 0) - api_peak_quota = round(api_peak / (api_limit * 100) * 100, 2) if api_limit else 0.0 - pg_peak = stats.get('mtusi-lab3-postgres-1', {}).get('cpu_peak', 0.0) - return [key, step['rate'], step['achieved_rps'], step['p95'], step['failed'], api_peak_quota, pg_peak] - - -def make_graphs(groups: dict, labels: list[str]) -> None: - if not labels: +def make_graphs(groups: dict) -> None: + if not groups: return plt = pyplot() GRAPH_DIR.mkdir(parents=True, exist_ok=True) @@ -2480,36 +2724,35 @@ def make_graphs(groups: dict, labels: list[str]) -> None: if ladders: series = {key: summarise_series(group) for key, group in ladders.items()} figure, axes = plt.subplots(figsize=(9, 5)) - for key, values in series.items(): + for index, (key, values) in enumerate(series.items()): axes.plot( [row['rate'] for row in values['rows']], - [row['achieved_rps'] for row in values['rows']], - marker='o', + [row['successful_rps'] for row in values['rows']], + marker=LADDER_MARKERS[index % len(LADDER_MARKERS)], + color=plt.get_cmap('tab20')(index % 20), label=key, ) - reference = next(iter(series.values())) - axes.plot( - [row['rate'] for row in reference['rows']], - [row['rate'] for row in reference['rows']], - linestyle='--', - color='grey', - label='предложенный темп', - ) + lo = min(row['rate'] for values in series.values() for row in values['rows']) + hi = max(row['rate'] for values in series.values() for row in values['rows']) + axes.plot([lo, hi], [lo, hi], linestyle='--', color='grey', zorder=0, label='предложенный темп') axes.set_xlabel('предложенный темп, req/s') - axes.set_ylabel('достигнутый RPS') - axes.set_title('Пропускная способность: достигнутый RPS от предложенного темпа') + axes.set_ylabel('успешный RPS (ответы ожидаемого класса)') + axes.set_title('Пропускная способность: успешный RPS от предложенного темпа') axes.grid(alpha=0.3) - axes.legend(fontsize=8) + axes.legend(fontsize=7, ncol=2) figure.tight_layout() figure.savefig(GRAPH_DIR / 'throughput.png', dpi=120) plt.close(figure) figure, axes = plt.subplots(figsize=(9, 5)) - for key, values in series.items(): + for index, (key, values) in enumerate(series.items()): + color = plt.get_cmap('tab20')(index % 20) + marker = LADDER_MARKERS[index % len(LADDER_MARKERS)] axes.plot( [row['rate'] for row in values['rows']], [row['p95'] for row in values['rows']], - marker='o', + marker=marker, + color=color, label=f'{key}: p95, ms', ) axes.plot( @@ -2517,46 +2760,48 @@ def make_graphs(groups: dict, labels: list[str]) -> None: [row['failed'] for row in values['rows']], linestyle=':', marker='x', - label=f'{key}: ошибок, шт.', + color=color, + label=f'{key}: неуспешных ответов, шт.', ) axes.set_xlabel('предложенный темп, req/s') - axes.set_ylabel('p95, ms / ошибок') - axes.set_title('Латентность p95 и ошибки по шагам лестницы') + axes.set_ylabel('p95, ms / неуспешных ответов') + axes.set_title('Латентность p95 и неуспешные ответы по шагам лестницы') axes.grid(alpha=0.3) - axes.legend(fontsize=8) + axes.legend(fontsize=7, ncol=2) figure.tight_layout() figure.savefig(GRAPH_DIR / 'latency-errors.png', dpi=120) plt.close(figure) figure, axes = plt.subplots(figsize=(9, 5)) - for key, values in series.items(): + for index, (key, values) in enumerate(series.items()): axes.plot( [row['rate'] for row in values['rows']], [row['vus_active'] for row in values['rows']], - marker='s', + marker=LADDER_MARKERS[index % len(LADDER_MARKERS)], + color=plt.get_cmap('tab20')(index % 20), label=key, ) axes.set_xlabel('предложенный темп, req/s') axes.set_ylabel('активных VU генератора') axes.set_title('Занятость генератора: нехватка VU отличима от перегрузки сервера') axes.grid(alpha=0.3) - axes.legend(fontsize=8) + axes.legend(fontsize=7, ncol=2) figure.tight_layout() figure.savefig(GRAPH_DIR / 'generator-vus.png', dpi=120) plt.close(figure) if steadys: keys = list(steadys) - achieved = [summarise_series(steadys[key])['ceiling_rps'] for key in keys] + successful = [summarise_series(steadys[key])['ceiling_rps'] for key in keys] offered = [summarise_series(steadys[key])['rows'][0]['rate'] for key in keys] figure, axes = plt.subplots(figsize=(9, 5)) positions = range(len(keys)) axes.bar([p - 0.2 for p in positions], offered, width=0.4, label='предложенный темп') - axes.bar([p + 0.2 for p in positions], achieved, width=0.4, label='достигнутый RPS') + axes.bar([p + 0.2 for p in positions], successful, width=0.4, label='успешный RPS') axes.set_xticks(list(positions)) axes.set_xticklabels(keys, fontsize=8) - axes.set_ylabel('req/s') - axes.set_title('Фиксированный темп: предложено против достигнутого') + axes.set_ylabel('req/s (успешные ответы)') + axes.set_title('Фиксированный темп: предложено против успешного RPS') axes.legend() figure.tight_layout() figure.savefig(GRAPH_DIR / 'steady-throughput.png', dpi=120) @@ -2590,31 +2835,42 @@ def make_graphs(groups: dict, labels: list[str]) -> None: figure.savefig(GRAPH_DIR / 'replica-distribution.png', dpi=120) plt.close(figure) - growth = {key: group for key, group in groups.items() if key.startswith('growth#')} - if growth: - rows = [growth_row(key, group) for key, group in sorted(growth.items())] - baseline_labels = [label for label in labels if label.startswith('p-a#n4#')] - figure, axes = plt.subplots(figsize=(9, 5)) - names = [] - values = [] - low = [] - high = [] - if baseline_labels: - series = summarise_series(baseline_labels) - row = step_of_rate(series['rows'], rows[0][1]) - names.append('базовая точка (серия A)') - values.append(row['achieved_rps']) - low.append(row['achieved_min']) - high.append(row['achieved_max']) - for row in rows: - names.append(row[0].replace('growth#', '')) - values.append(row[2]) - low.append(row[2]) - high.append(row[2]) - axes.bar(names, values, yerr=[[value - minimum for value, minimum in zip(values, low)], [maximum - value for value, maximum in zip(values, high)]], capsize=5) - axes.set_ylabel('достигнутый RPS') - axes.set_title('Серия роста ресурсов: какой ресурс является ограничителем') - axes.tick_params(axis='x', labelsize=8) + control, growth_points, _ = growth_series(groups) + if control is None: + log('growth.png: нет контроля why#n4') + else: + rate = control['rate'] + plotted = [control] + growth_points + names = ['контроль N=4'] + [point['name'] for point in growth_points] + values = [point['successful_rps'] for point in plotted] + positions = list(range(len(plotted))) + figure, (left, right) = plt.subplots(1, 2, figsize=(11, 5)) + left.bar( + positions, + values, + width=0.6, + yerr=[ + [max(0.0, point['successful_rps'] - point['successful_min']) for point in plotted], + [max(0.0, point['successful_max'] - point['successful_rps']) for point in plotted], + ], + capsize=4, + ) + for index, point in enumerate(plotted): + label = f'{point["successful_rps"]}' if index == 0 else f'{point["successful_rps"]}\n{point["delta"]:+}%' + left.annotate(label, (index, point['successful_max']), ha='center', va='bottom', fontsize=8) + left.axhline(rate, linestyle='--', color='grey', label='предложенный темп') + left.set_xticks(positions) + left.set_xticklabels(names, fontsize=8, rotation=20, ha='right') + left.set_ylabel('успешный RPS (ответы ожидаемого класса)') + left.set_ylim(0, rate * 1.15) + left.legend(fontsize=8) + left.grid(axis='y', alpha=0.3) + right.bar(positions, [point['p95'] for point in plotted], width=0.6, color='tab:orange') + right.set_xticks(positions) + right.set_xticklabels(names, fontsize=8, rotation=20, ha='right') + right.set_ylabel('p95, ms') + right.grid(axis='y', alpha=0.3) + figure.suptitle(f'Серия роста ресурсов: {rate} req/s, N=4, одно окно (why#)') figure.tight_layout() figure.savefig(GRAPH_DIR / 'growth.png', dpi=120) plt.close(figure) @@ -2625,16 +2881,16 @@ def make_graphs(groups: dict, labels: list[str]) -> None: series_b = summarise_series(groups['ab#B']) rates = [row['rate'] for row in series_a['rows']] positions = list(range(len(rates))) - axes.bar([p - 0.2 for p in positions], [row['achieved_rps'] for row in series_a['rows']], width=0.4, label='A (до)') - axes.bar([p + 0.2 for p in positions], [row['achieved_rps'] for row in series_b['rows']], width=0.4, label='B (после)') + axes.bar([p - 0.2 for p in positions], [row['successful_rps'] for row in series_a['rows']], width=0.4, label='A (до)') + axes.bar([p + 0.2 for p in positions], [row['successful_rps'] for row in series_b['rows']], width=0.4, label='B (после)') for offset, series in ((-0.2, series_a), (0.2, series_b)): for index, row in enumerate(series['rows']): - axes.plot([index + offset, index + offset], [row['achieved_min'], row['achieved_max']], color='black', linewidth=1) + axes.plot([index + offset, index + offset], [row['successful_min'], row['successful_max']], color='black', linewidth=1) axes.set_xticks(positions) axes.set_xticklabels([str(rate) for rate in rates]) axes.set_xlabel('темп, req/s') - axes.set_ylabel('достигнутый RPS') - axes.set_title('A/B: медиана и разброс (min..max) по повторам') + axes.set_ylabel('успешный RPS (ответы ожидаемого класса)') + axes.set_title('A/B: медиана успешного RPS и разброс (min..max) по повторам') axes.legend() figure.tight_layout() figure.savefig(GRAPH_DIR / 'ab-comparison.png', dpi=120) @@ -2722,9 +2978,8 @@ def cmd_track1(args) -> None: run_measured('p-c#lb0.25', 'p-c', warmup=False) ensure_stand({'API_REPLICAS': '4', 'LB_CPUS': '1.0'}) run_measured('p-c#lb1.0', 'p-c', warmup=False) - log('=== серия роста ресурсов') - for series in ('api', 'pg', 'pool'): - cmd_growth(argparse.Namespace(series=series, rate=None, duration=60, base_profile='p-a', no_warmup=False, suffix='')) + log('=== блок «почему» и серия роста: 1500 req/s, интерливинг') + cmd_track1_extras(argparse.Namespace(part='why', rate=1500, duration=60, reps=args.reps, max_vus=900, prefix='why', loadgen_cpus=DEFAULT_STAND['LOADGEN_CPUS'], loadgen_memory='1024m')) log('=== агрегаты') cmd_analyze(argparse.Namespace()) if args.ab_after: @@ -2802,6 +3057,8 @@ def cmd_track1_extras(args) -> None: ('n4-pg3', {'API_REPLICAS': '4', 'API_TOTAL_CPUS': '3.0', 'PG_CPUS': '3.0', 'DATABASE_POOL_MAX': '10'}), ('n4-api6', {'API_REPLICAS': '4', 'API_TOTAL_CPUS': '6.0', 'PG_CPUS': '1.5', 'DATABASE_POOL_MAX': '10'}), ('n4-pool20', {'API_REPLICAS': '4', 'API_TOTAL_CPUS': '3.0', 'PG_CPUS': '1.5', 'DATABASE_POOL_MAX': '20'}), + ('n4-pool5', {'API_REPLICAS': '4', 'API_TOTAL_CPUS': '3.0', 'PG_CPUS': '1.5', 'DATABASE_POOL_MAX': '5'}), + ('n4-lb1', {'API_REPLICAS': '4', 'API_TOTAL_CPUS': '3.0', 'PG_CPUS': '1.5', 'DATABASE_POOL_MAX': '10', 'LB_CPUS': '1.0'}), ] for rep in range(1, args.reps + 1): order = block if rep % 2 else list(reversed(block)) @@ -2887,15 +3144,6 @@ def build_parser() -> argparse.ArgumentParser: sweep.add_argument('--no-warmup', action='store_true') sweep.set_defaults(func=cmd_sweep) - growth = sub.add_parser('growth', help='серия роста ресурсов') - growth.add_argument('--series', choices=['api', 'pg', 'pool'], required=True) - growth.add_argument('--rate', type=int) - growth.add_argument('--duration', type=int, default=60) - growth.add_argument('--base-profile', default='p-a') - growth.add_argument('--no-warmup', action='store_true') - growth.add_argument('--suffix', default='', help='суффикс метки: различает прогоны одной точки на разных темпах') - growth.set_defaults(func=cmd_growth) - failover = sub.add_parser('failover', help='фазовый драйвер отказа реплики') failover.add_argument('--replicas', default='all') failover.add_argument('--rate', type=int, default=200) diff --git a/scripts/load/common.js b/scripts/load/common.js index 4a4f8cd..64b9b94 100644 --- a/scripts/load/common.js +++ b/scripts/load/common.js @@ -267,14 +267,22 @@ export function summaryJson(data, metrics, rates, kind, stepSeconds) { const name = `step_${rate}`; const values = data.metrics[`${name}_duration`]?.values ?? {}; const requests = data.metrics[`${name}_requests`]?.values?.count ?? 0; + const ok = data.metrics[`${name}_status_2xx`]?.values?.count ?? 0; return { rate, duration_s: stepSeconds, requests, - achieved_rps: round(requests / stepSeconds, 2), + // Частота ответов: все полученные HTTP-ответы, включая ошибочные. + // Диагностика: показывает, сколько запросов довёл до ответа LB, а не + // сколько работы сервис выполнил успешно. + attempted_rps: round(requests / stepSeconds, 2), + // Успешная пропускная способность: только ответы ожидаемого класса + // (2xx). Публикуемая величина — при отказах она отличается от + // частоты ответов на порядок. + successful_rps: round(ok / stepSeconds, 2), failed: data.metrics[`${name}_failed`]?.values?.count ?? 0, status: { - ok: data.metrics[`${name}_status_2xx`]?.values?.count ?? 0, + ok, client_4xx: data.metrics[`${name}_status_4xx`]?.values?.count ?? 0, server_5xx: data.metrics[`${name}_status_5xx`]?.values?.count ?? 0, other: data.metrics[`${name}_status_other`]?.values?.count ?? 0, diff --git a/tests/README.md b/tests/README.md index 0dfa3f8..aa3500e 100644 --- a/tests/README.md +++ b/tests/README.md @@ -43,6 +43,24 @@ python3 tests/load.py --duration 30 --concurrency 4 --output evidence/load.json Это простой **closed-loop** генератор POST сообщений; он ограничен производительностью клиента и страдает coordinated omission. Он выдаёт successful RPS, ошибки и p50/p95/p99 **только успешных запросов**. Во время нагрузки нет прозрачных retry; timeout мог скрыть совершённую запись, поэтому это throughput HTTP-подтверждений, не точный счётчик COMMIT. Изменение размера истории входит в профиль. Для серьёзного исследования используйте k6/Locust/wrk либо свой обоснованный генератор, а не выводите максимальную пропускную способность из одного запуска этого скрипта. Для нагрузки pipeline изображений нужен отдельный сценарий студента. +## Аналитика трека 1 (оффлайн, проверка этого репозитория) + +```sh +make test-analytics +# без make: +python3 -m unittest discover -s tests -p 'test_*.py' -v +``` + +`test_lab3_analytics.py` — регрессия харнесса трека 1 (`scripts/lab3/lab3.py`, +`scripts/load/common.js`), а не часть публичных проверок курса: она не требует +стенда, подставляет сырые сводки k6 фикстурами во временный каталог и проверяет, +что (а) пропускная способность считается по успешным ответам, а не по всем (шаг +`requests=1978, ok=853, failed=1125, duration=15` → 56.87 успешных против 131.87 +ответов в секунду), (б) Δ A/B и потолок считаются по успешному RPS, (в) сравнение +роста ресурсов идёт только внутри одного темпа, а отсутствующий темп исключает +точку, а не подставляет чужую полку, и (г) сырые сводки в `evidence/track1/raw` +остаются в текущей схеме (`successful_rps`/`attempted_rps`, без `achieved_rps`). + ## HTTPS, lab7 ```sh diff --git a/tests/test_lab3_analytics.py b/tests/test_lab3_analytics.py new file mode 100755 index 0000000..f3d12f0 --- /dev/null +++ b/tests/test_lab3_analytics.py @@ -0,0 +1,270 @@ +#!/usr/bin/env python3 +"""Регрессия аналитики трека 1: успешный RPS отделён от частоты ответов. + +Проверяются два дефекта, найденные в разборе серии роста и A/B: + +1. Пропускная способность считалась как `requests / duration`, поэтому ответы об + ошибках выглядели выполненной работой. На шаге `abdiag#A` 400 req/s клиент + получил 1978 ответов, из них 853 успешных: старая формула давала 131.87 req/s + вместо 56.87, и это же число шло в вердикт A/B и в потолок. +2. Серия роста — блок why# на одном темпе. Точка, отличающаяся от контроля больше + чем одним ключом бюджета или снятая на другом темпе, исключается с причиной. + +Тест детерминированный и оффлайн: сырые сводки k6 подставляются фикстурами в +временный каталог, стенд и Docker не нужны. + +Запуск: make test-analytics + python3 -m unittest discover -s tests -p 'test_*.py' -v +""" +from __future__ import annotations + +import importlib.util +import json +import sys +import tempfile +import unittest +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] + + +def load_lab3(): + """Загружает драйвер экспериментов как модуль, не запуская CLI.""" + path = ROOT / 'scripts' / 'lab3' / 'lab3.py' + spec = importlib.util.spec_from_file_location('lab3', path) + if spec is None or spec.loader is None: + raise SystemExit(f'cannot load {path}') + module = importlib.util.module_from_spec(spec) + sys.modules['lab3'] = module + spec.loader.exec_module(module) + return module + + +lab3 = load_lab3() + +# Дефектный шаг из abdiag#A: 1978 ответов за 15 s, 853 успешных, 1125 ответов 503. +DEGRADED_RATE = 400 +DEGRADED_REQUESTS = 1978 +DEGRADED_OK = 853 +DEGRADED_FAILED = 1125 +STEP_SECONDS = 15 +DEGRADED_SUCCESSFUL_RPS = 56.87 +DEGRADED_ATTEMPTED_RPS = 131.87 + + +def step( + rate: int, + *, + ok: int, + requests: int | None = None, + failed: int = 0, + duration: int = STEP_SECONDS, + p95: float = 10.0, +) -> dict: + total = requests if requests is not None else ok + failed + return { + 'rate': rate, + 'duration_s': duration, + 'requests': total, + 'successful_rps': round(ok / duration, 2), + 'attempted_rps': round(total / duration, 2), + 'failed': failed, + 'p95': p95, + 'vus_active': 0, + 'status': {'ok': ok, 'client_4xx': 0, 'server_5xx': failed, 'other': 0}, + } + + +def summary(label: str, kind: str, steps: list[dict], profile: str = 'spread') -> dict: + return { + 'label': label, + 'profile': profile, + 'mode': 'write', + 'kind': kind, + 'steps': steps, + 'dropped_iterations': 0, + } + + +class AnalyticsTestCase(unittest.TestCase): + """Изолирует raw/каталоги вывода: аналитика читает их как глобальные пути.""" + + def setUp(self) -> None: + self._temporary = tempfile.TemporaryDirectory() + root = Path(self._temporary.name) + self.raw_dir = root / 'raw' + self.raw_dir.mkdir() + self.track1_dir = root / 'track1' + self.track1_dir.mkdir() + self._original = (lab3.RAW_DIR, lab3.TRACK1_DIR, lab3.GRAPH_DIR) + lab3.RAW_DIR = self.raw_dir + lab3.TRACK1_DIR = self.track1_dir + lab3.GRAPH_DIR = self.track1_dir / 'graphs' + + def tearDown(self) -> None: + lab3.RAW_DIR, lab3.TRACK1_DIR, lab3.GRAPH_DIR = self._original + self._temporary.cleanup() + + def write_raw( + self, + label: str, + payload: dict, + *, + profile: str = 'spread', + mode: str = 'write', + manifest: dict | None = None, + ) -> None: + (self.raw_dir / f'{label}.k6.json').write_text(json.dumps(payload, ensure_ascii=False, indent=1)) + (self.raw_dir / f'{label}.manifest.json').write_text( + json.dumps( + {'label': label, 'profile': profile, 'mode': mode, 'kind': payload.get('kind'), **(manifest or {})}, + ensure_ascii=False, + ) + ) + + def capture_log(self) -> list[str]: + messages: list[str] = [] + self._log = lab3.log + lab3.log = messages.append + self.addCleanup(lambda: setattr(lab3, 'log', self._log)) + return messages + + +class SuccessfulThroughputTest(AnalyticsTestCase): + def test_error_answers_are_not_throughput(self) -> None: + label = 'ab#A#rep1' + self.write_raw( + label, + summary( + label, + 'ladder', + [ + step( + DEGRADED_RATE, + ok=DEGRADED_OK, + requests=DEGRADED_REQUESTS, + failed=DEGRADED_FAILED, + p95=5200.88, + ) + ], + ), + ) + series = lab3.summarise_series([label]) + row = series['rows'][0] + self.assertEqual(row['successful_rps'], DEGRADED_SUCCESSFUL_RPS) + self.assertEqual(row['attempted_rps'], DEGRADED_ATTEMPTED_RPS) + self.assertEqual(row['successful_min'], DEGRADED_SUCCESSFUL_RPS) + self.assertEqual(row['successful_max'], DEGRADED_SUCCESSFUL_RPS) + # Потолок и сатурация считаются по успешным ответам, а не по всем. + self.assertEqual(series['ceiling_rps'], DEGRADED_SUCCESSFUL_RPS) + self.assertEqual(series['saturation']['rate'], DEGRADED_RATE) + self.assertEqual(series['saturation']['successful_rps'], DEGRADED_SUCCESSFUL_RPS) + + +class AbVerdictTest(AnalyticsTestCase): + def test_verdict_delta_uses_successful_rps(self) -> None: + for rep in (1, 2, 3): + label = f'ab#A#rep{rep}' + self.write_raw( + label, + summary( + label, + 'ladder', + [step(DEGRADED_RATE, ok=DEGRADED_OK, requests=DEGRADED_REQUESTS, failed=DEGRADED_FAILED, p95=5200.88)], + ), + ) + label_b = f'ab#B#rep{rep}' + self.write_raw(label_b, summary(label_b, 'ladder', [step(DEGRADED_RATE, ok=6000, requests=6000, failed=0, p95=24.4)])) + + lab3.report_ab() + verdict = json.loads((self.track1_dir / 'ab-verdict.json').read_text()) + entry = next(item for item in verdict['verdicts'] if item['rate'] == DEGRADED_RATE) + expected_change = round((400.0 - DEGRADED_SUCCESSFUL_RPS) / DEGRADED_SUCCESSFUL_RPS * 100, 2) + self.assertEqual(entry['change_percent'], expected_change) + self.assertEqual(entry['a']['successful_rps'], DEGRADED_SUCCESSFUL_RPS) + self.assertEqual(entry['a']['attempted_rps'], DEGRADED_ATTEMPTED_RPS) + self.assertEqual(entry['a']['status_5xx'], DEGRADED_FAILED) + self.assertEqual(entry['b']['successful_rps'], 400.0) + self.assertTrue(entry['confirmed']) + # Потолок стороны тоже успешный, а не «все ответы». + self.assertEqual(verdict['ceiling'], {'A': DEGRADED_SUCCESSFUL_RPS, 'B': 400.0}) + + summary_md = (self.track1_dir / 'summary-ab.md').read_text() + self.assertIn('успешный RPS', summary_md) + self.assertIn(str(DEGRADED_SUCCESSFUL_RPS), summary_md) + self.assertIn(str(DEGRADED_ATTEMPTED_RPS), summary_md) + + +class GrowthBlockTest(AnalyticsTestCase): + """Серия роста — блок why# на одном темпе: несопоставимые точки исключаются.""" + + COMMON = { + 'commit': 'c', + 'generator': {'max_vus': '900', 'cpus': '1.5', 'memory': '1024m'}, + } + BASE_STAND = { + 'API_REPLICAS': '4', + 'API_TOTAL_CPUS': '3.0', + 'PG_CPUS': '1.5', + 'DATABASE_POOL_MAX': '10', + 'LB_CPUS': '0.25', + 'API_IMAGE': 'img', + } + + def write_point(self, label: str, successful: int, stand: dict | None = None, generator: dict | None = None) -> None: + manifest = { + 'commit': self.COMMON['commit'], + 'generator': {**self.COMMON['generator'], **(generator or {})}, + 'stand': {**self.BASE_STAND, **(stand or {})}, + } + self.write_raw(label, summary(label, 'steady', [step(1500, ok=successful * 60, duration=60)]), manifest=manifest) + + def setUp(self) -> None: + super().setUp() + self.write_point('why#n4#rep1', 943) + self.write_point('why#n4-pg3#rep1', 1480, {'PG_CPUS': '3.0'}) + self.write_point('why#n4-api6#rep1', 891, {'API_TOTAL_CPUS': '6.0'}) + self.write_point('why#n4-pool20#rep1', 853, {'DATABASE_POOL_MAX': '20'}) + self.write_point('why#n4-lb1#rep1', 922, {'LB_CPUS': '1.0'}, {'max_vus': '200'}) + self.groups = lab3.group_configurations(lab3.raw_labels()) + + def test_only_comparable_points_are_compared(self) -> None: + lab3.analyse_growth(self.groups) + text = (self.track1_dir / 'summary-growth.md').read_text() + rows = {line.split(' | ')[0].lstrip('| '): line for line in text.splitlines() if line.startswith('| why#')} + self.assertIn('рычаг поднимает потолок', rows['why#n4-pg3']) + self.assertIn('в пределах разброса', rows['why#n4-api6']) + self.assertIn('ухудшает', rows['why#n4-pool20']) + self.assertNotIn('why#n4-lb1', rows) + omitted = text.split('Вне сравнения:')[1] + lb1 = next(line for line in omitted.splitlines() if 'why#n4-lb1' in line) + self.assertIn('max_vus', lb1) + pool5 = next(line for line in omitted.splitlines() if 'why#n4-pool5' in line) + self.assertIn('не снята на этом темпе', pool5) + + def test_graph_built_from_same_block(self) -> None: + try: + import matplotlib # noqa: F401 + except ImportError: + self.skipTest('matplotlib не установлен: график не строится') + lab3.make_graphs(self.groups) + self.assertTrue((lab3.GRAPH_DIR / 'growth.png').is_file()) + + +class RawSchemaTest(unittest.TestCase): + """Сырые сводки k6 обязаны быть в текущей схеме: без achieved_rps.""" + + def test_committed_raw_uses_current_fields(self) -> None: + files = sorted((ROOT / 'evidence' / 'track1' / 'raw').glob('*.k6.json')) + self.assertTrue(files, 'нет сырых сводок k6') + for path in files: + text = path.read_text() + self.assertNotIn('achieved_rps', text, path.name) + for s in json.loads(text).get('steps', []): + self.assertIn('successful_rps', s, path.name) + self.assertIn('attempted_rps', s, path.name) + self.assertLessEqual(s['successful_rps'], s['attempted_rps'], path.name) + + +if __name__ == '__main__': + unittest.main()