partest-load 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. partest_load-0.1.0/CHANGELOG.md +175 -0
  2. partest_load-0.1.0/LICENSE +21 -0
  3. partest_load-0.1.0/MANIFEST.in +23 -0
  4. partest_load-0.1.0/PKG-INFO +139 -0
  5. partest_load-0.1.0/docs/PYPI.md +99 -0
  6. partest_load-0.1.0/partest_load/__init__.py +23 -0
  7. partest_load-0.1.0/partest_load/cli.py +244 -0
  8. partest_load-0.1.0/partest_load/configs/__init__.py +34 -0
  9. partest_load-0.1.0/partest_load/configs/endpoints.py +127 -0
  10. partest_load-0.1.0/partest_load/configs/profiles.py +164 -0
  11. partest_load-0.1.0/partest_load/core/__init__.py +13 -0
  12. partest_load-0.1.0/partest_load/core/client.py +164 -0
  13. partest_load-0.1.0/partest_load/core/metrics.py +186 -0
  14. partest_load-0.1.0/partest_load/core/pacing.py +34 -0
  15. partest_load-0.1.0/partest_load/core/runner.py +69 -0
  16. partest_load-0.1.0/partest_load/core/worker.py +260 -0
  17. partest_load-0.1.0/partest_load/engines/__init__.py +26 -0
  18. partest_load-0.1.0/partest_load/engines/base.py +51 -0
  19. partest_load-0.1.0/partest_load/engines/batch.py +26 -0
  20. partest_load-0.1.0/partest_load/engines/linear.py +52 -0
  21. partest_load-0.1.0/partest_load/engines/ramp.py +36 -0
  22. partest_load-0.1.0/partest_load/engines/stress.py +138 -0
  23. partest_load-0.1.0/partest_load/operation.py +71 -0
  24. partest_load-0.1.0/partest_load/py.typed +0 -0
  25. partest_load-0.1.0/partest_load/reporting/__init__.py +13 -0
  26. partest_load-0.1.0/partest_load/reporting/charts.py +261 -0
  27. partest_load-0.1.0/partest_load/reporting/generator.py +296 -0
  28. partest_load-0.1.0/partest_load/reporting/templates/card.html.j2 +63 -0
  29. partest_load-0.1.0/partest_load/reporting/templates/dashboard.html.j2 +451 -0
  30. partest_load-0.1.0/partest_load/reporting/templates/modal_full_report.html.j2 +153 -0
  31. partest_load-0.1.0/partest_load/storage/__init__.py +40 -0
  32. partest_load-0.1.0/partest_load/storage/result_store.py +289 -0
  33. partest_load-0.1.0/partest_load/storage/schema.py +170 -0
  34. partest_load-0.1.0/partest_load.egg-info/PKG-INFO +139 -0
  35. partest_load-0.1.0/partest_load.egg-info/SOURCES.txt +40 -0
  36. partest_load-0.1.0/partest_load.egg-info/dependency_links.txt +1 -0
  37. partest_load-0.1.0/partest_load.egg-info/entry_points.txt +2 -0
  38. partest_load-0.1.0/partest_load.egg-info/requires.txt +13 -0
  39. partest_load-0.1.0/partest_load.egg-info/top_level.txt +1 -0
  40. partest_load-0.1.0/setup.cfg +4 -0
  41. partest_load-0.1.0/setup.py +97 -0
@@ -0,0 +1,175 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ### Сломано намеренно: формат записи прогона
6
+
7
+ **Прогон опознаётся операцией (`operation`), а не слагом эндпоинта.** Операция записывается в
8
+ форме `МЕТОД /путь` (`GET /v1/items/{id}`), то есть ровно так, как эндпоинт опознаётся в
9
+ остальном семействе. Слаг остаётся подписью для глаз: он пишется в прогон и показывается в
10
+ отчёте, но ничего не опознаёт.
11
+
12
+ Формат записи прогона — `2.0`. Что изменилось в файле:
13
+
14
+ | Было (1.0) | Стало (2.0) |
15
+ |---|---|
16
+ | `endpoint_key` | `operation` (обязательное) и `slug` (подпись) |
17
+ | `run_id`: `<время>__<слаг>__<профиль>__<hex>` | `<время>__<ключ операции>__<профиль>__<hex>` |
18
+
19
+ Раскладка и указатели ключуются операцией: прогоны лежат в
20
+ `<корень>/<ключ операции>/<профиль>/`, указатели — в
21
+ `_latest/<ключ операции>__<профиль>.json`. Ключ операции получается из неё необратимо
22
+ (читаемый остаток плюс восемь знаков хеша), поэтому сама операция лежит **внутри файла
23
+ прогона в исходном виде** — расшифровывать имя каталога не нужно никому.
24
+
25
+ **Миграции старых прогонов нет и не будет:** пакет не опубликован, прогонов в обращении
26
+ нет. Файл формата `1.0` новым кодом не читается.
27
+
28
+ Интерфейсы, которые от этого изменились:
29
+
30
+ - `save_run_results(results_root, *, operation, slug, profile_name, metrics, events, …)` —
31
+ опознание передаётся только по имени: перепутать операцию с подписью было бы легко, а
32
+ последствие — раскладка по подписи, то есть ровно то, от чего уходили;
33
+ - `validate_run_names(*, operation, slug, profile_name)` — операция проверяется той же
34
+ проверкой до прогона, что и имена;
35
+ - `latest_pointer_path`, `get_latest_run_path`, `run_history` принимают операцию вместо ключа
36
+ эндпоинта; добавился `runs_dir`;
37
+ - `iter_latest_runs` отдаёт **ключ** операции (из имени указателя операцию не восстановить);
38
+ - `collect_endpoint_groups` группирует прогоны по операции, и `endpoint_names` ключуется
39
+ операцией. Два прогона одной операции с разными подписями стоят в отчёте рядом; одинаковая
40
+ подпись у двух операций больше не склеивает их в один эндпоинт;
41
+ - `EndpointConfig.operation()` — операция выводится из метода и пути, которые в описании уже
42
+ есть. Отдельного аргумента командной строки нет: выведенное значение не может разойтись с
43
+ тем, что нагружали, а аргумент — может.
44
+
45
+ Командная строка не изменилась: `--endpoint` остаётся ключом в файле эндпоинтов и подписью
46
+ прогона. В выводе появилась строка «операция прогона», и негодная операция — отказ до
47
+ нагрузки, включая `--dry-run`.
48
+
49
+ ### Переименовано до публикации: `scope` → `operation`
50
+
51
+ Понятие, которым опознаётся прогон, называлось **областью прогона** (`scope`). Слово `scope`
52
+ принадлежит контракту артефактов (`partest_atlas.artifacts`) и значит там другое. При выгрузке
53
+ артефакта оба значения легли бы в один файл, и одно слово отвечало бы на два разных вопроса.
54
+
55
+ Решением владельца контракта от 2026-09-20 `scope` остался за ним, а здешнее
56
+ понятие называется **операцией** (`operation`). Потребителей у переименованных имён нет:
57
+ пакет ещё не выпущен, и раскладка каталогов интерфейсом пока не стала — поэтому это правка
58
+ имени, а не ломающее изменение.
59
+
60
+ Переименованы модуль `partest_load/scope.py` → `partest_load/operation.py`
61
+ (`normalize_scope` → `normalize_operation`, `check_scope` → `check_operation`,
62
+ `scope_key` → `operation_key`), одноимённые параметры хранилища, поле `scope` записи прогона,
63
+ `EndpointConfig.scope()` и строка вывода командной строки. Значения, форма `МЕТОД /путь`,
64
+ правило ключа каталога и поведение не изменились.
65
+
66
+ ### Упаковка приведена к общему порядку семейства
67
+
68
+ Не новая возможность: пакет собирается и ставится ровно так же, как раньше. Изменилось, чем
69
+ это описано, — и теперь оно совпадает с `partest` и `partest-gen`.
70
+
71
+ - **`setup.py` и `setup.cfg` вместо `pyproject.toml`.** `pyproject.toml` удалён. Привычная
72
+ владельцу команда `python setup.py sdist bdist_wheel` в этом репозитории не работала вовсе
73
+ (файла не было); теперь работают обе — и она, и `python -m build`.
74
+ - **Версия объявлена литералом в `partest_load/__init__.py`**, `setup.py` читает её оттуда
75
+ регулярным выражением — как у обоих соседей. Было наоборот: литерал лежал в
76
+ `pyproject.toml`, а `__version__` выводился из метаданных установленного дистрибутива,
77
+ то есть из рабочего дерева показывал `0.0.0.dev0`. Номер прежний — **0.1.0**.
78
+ - **`pytest.ini`** — настройки прогона (`pythonpath`, `testpaths`, область цикла событий)
79
+ переехали из `[tool.pytest.ini_options]` без изменения значений.
80
+ - Перенесено всё, что объявлял `[project]`: описание и `docs/PYPI.md` как страница пакета,
81
+ лицензия, автор, классификаторы, зависимости, extra `report` и `all`, консольная команда,
82
+ шесть ссылок, состав пакетов и данные пакета (`py.typed`, `reporting/templates/*.j2`).
83
+
84
+ Записи ниже по этому же разделу описывают упаковку в терминах `pyproject.toml` — так она и
85
+ была устроена на тот момент. Проверено сборкой: обе команды, колесо с тремя шаблонами и
86
+ `py.typed`, `twine check` зелёный, `python setup.py --version` в распакованном sdist отвечает
87
+ `0.1.0`, колесо в чистом окружении даёт рабочую команду `partest-load` и `--dry-run`.
88
+
89
+ ### Подготовлено к первому выпуску на PyPI
90
+
91
+ Дистрибутив доведён до вида, общего с `partest` и `partest-gen`.
92
+
93
+ - **`LICENSE`** — файла не было, а `pyproject.toml` заявлял MIT. Пакет без текста лицензии
94
+ не сообщает, на каких условиях его вообще разрешено брать.
95
+ - **Описание страницы пакета — `docs/PYPI.md`**, как у соседей, и `readme` указывает на
96
+ него. `README.md` обращён к репозиторию (в нём «пакета на PyPI пока нет» и отсылки к вики)
97
+ и на странице дистрибутива читался бы как чужой текст.
98
+ - **`py.typed` объявлен данными пакета.** Файл лежал в дереве с самого начала, но в колесо
99
+ не попадал: у потребителя, проверяющего типы, аннотаций пакета не существовало.
100
+ - **Ссылки (`project.urls`)**: исходники, задачи, changelog, документация, PyPI. Раньше со
101
+ страницы пакета не было пути к репозиторию.
102
+ - **Метаданные**: почта автора, классификаторы (Python 3.10–3.13, аудитория, ОС, разделы
103
+ каталога), описание на языке остальных страниц семейства, ключевое слово `partest`.
104
+ - **`MANIFEST.in`**: в дистрибутив уходят пакет с шаблонами и `py.typed`, `LICENSE`,
105
+ `CHANGELOG.md` и `docs/PYPI.md`; тесты, вики и `README.md` — нет.
106
+
107
+ Проверено сборкой, а не чтением манифеста: колесо и sdist собраны, `twine check` зелёный,
108
+ колесо поставлено в чистое окружение — `partest-load --help` и `--dry-run` работают,
109
+ шаблоны отчёта и `py.typed` на месте.
110
+
111
+ Версия первого выпуска остаётся **0.1.0**: публичного интерфейса пакет пока не обещает —
112
+ выгрузки артефакта нет, переиспользование `partest` не подключено, а формат записи прогона
113
+ уже ломался на 2.0. Номер `1.0.0` сказал бы обратное.
114
+
115
+ ### Добавлено
116
+
117
+ Пакет наполнен кодом: перенос прототипа `github.com/Dec01/load` со снятием продуктового
118
+ домена. Появились `configs/` (схемы профиля и эндпоинта), `core/` (клиент, метрики, пейсинг,
119
+ воркер, раннер), `engines/` (linear, ramp, stress, batch), `storage/` (схема прогона и
120
+ хранилище результатов), `reporting/` (данные графиков, сборка дашборда, шаблоны) и `cli.py` —
121
+ точка входа `partest-load`, на которую уже ссылался `project.scripts`.
122
+
123
+ Шаблоны дашборда объявлены данными пакета (`tool.setuptools.package-data`): без этого колесо
124
+ собиралось без `reporting/templates`, и отчёт падал у потребителя после прогона.
125
+
126
+ Появились тесты: расчёт метрик, разбор и проверка профиля, расписание нагрузки каждого
127
+ движка, критерий обрыва и точка насыщения stress, хранилище результатов, сборка дашборда.
128
+ Сети и стенда ни один из них не требует.
129
+
130
+ ### Исправлено
131
+
132
+ - **`httpx[http2]` вместо `httpx`.** Клиент создаётся с `http2=True`, и без пакета `h2` httpx
133
+ бросает ImportError при создании клиента: ни один воркер не отправлял ни одного запроса.
134
+ В прототипе `h2` тоже не был объявлен — на машине автора он стоял по другой причине.
135
+ - **Тело запроса больше не уезжает в снимок конфигурации.** `EndpointConfig.snapshot()`
136
+ написан ровно для этого — оставлять имена заголовков и метки вариантов тела, а значения не
137
+ брать, — но `cli` собирал снимок сам и брал `model_dump()`. Значения заголовков он выбрасывал,
138
+ а `payloads` оставлял целиком: логин с паролем из профиля, создающего данные, ложился в
139
+ открытый JSON рядом с замерами и жил там месяцами. Красная линия 4 в `AGENTS.md`.
140
+ - **Фаза, в которой не ушло ни одного запроса, больше не выглядит успешной.** Упавший воркер
141
+ фазу не отменяет (это нужно: один разорванный сокет не должен обрывать прогон), но если
142
+ упали все, поднимается `PhaseFailedError`. Раньше такая фаза доезжала до метрик как
143
+ «0 запросов, 0% ошибок» и ложилась в отчёт прогоном, который прошёл.
144
+
145
+ ### Изменено против прототипа
146
+
147
+ Прототип писался как инструмент, и в библиотеке так нельзя:
148
+
149
+ - **Ни одной ссылки наружу в отчёте.** plotly.js вшивается в файл (из установленного пакета
150
+ или из указанного файла), иконочный шрифт убран. Взять plotly негде — дашборд собирается
151
+ с таблицами и пишет, почему нет графиков. Адрес CDN не подставляется ни при каких условиях.
152
+ - **Все пути приходят аргументами.** Ни чтения конфигурации на импорте, ни поиска профилей
153
+ относительно текущего каталога, ни создания каталога результатов при `import`.
154
+ - **Печать заменена журналом** везде, кроме `cli.py`; `sys.exit` из модулей убран.
155
+ - **Расписание отделено от нагрузки**: у каждого движка есть `plan()` — чистая арифметика
156
+ фаз, проверяемая без стенда.
157
+ - **Неизвестный ключ в профиле — ошибка**, а не молчаливое игнорирование.
158
+ - **Точка насыщения stress — число.** В прототипе в это поле писалась строка `"approx"`,
159
+ и модель прогона её не принимала: главный результат stress-прогона терялся.
160
+ - **Запись результата атомарна**, имена проверяются до прогона, а «последний прогон»
161
+ отмечается файлом-указателем там, где симлинки запрещены.
162
+
163
+ ### Планируется к первому релизу
164
+
165
+ Остаток работ по переносу. Сделанное перечислено выше; здесь — то, чего ещё нет:
166
+
167
+ - **Авторизация — через `partest.TokenManager`**, а не своя. Заголовки и параметры — через
168
+ `partest.http.Config`. Пока заголовки задаёт потребитель прямо в описании эндпоинта, а
169
+ объявленная зависимость `partest` кодом ещё не используется.
170
+ - **Список эндпоинтов из контракта** (`partest.openapi`, `partest.path_match`): профиль
171
+ пишется на спецификацию, а не на руками перечисленные URL, и не разъезжается с ней молча.
172
+ - **Секреты через `partest.redact`** — ни в дашборде, ни в артефакте.
173
+ - **Выгрузка артефакта `load.profile`** (вид объявлен в `partest_atlas.artifacts`): на
174
+ эндпоинт — RPS, перцентили, доля ошибок, точка насыщения, наклон деградации. Модуля
175
+ `artifacts.py` ещё нет: результат прогона пока читает только дашборд.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Parshin Ewgeniy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,23 @@
1
+ # Что уходит в дистрибутив. Всё перечисленное здесь публично навсегда.
2
+ include partest_load/py.typed
3
+ recursive-include partest_load/reporting/templates *.j2
4
+ include LICENSE
5
+ include CHANGELOG.md
6
+ # Описание страницы пакета. В отличие от соседей файл оставлен в дистрибутиве намеренно:
7
+ # без него колесо, собранное из sdist, не собирается — `readme` указывает именно сюда.
8
+ include docs/PYPI.md
9
+
10
+ # Намеренно НЕ уходит:
11
+ # tests/ — писаны на рабочую копию, из sdist всё равно не прошли бы
12
+ # README.md — обращён к репозиторию: отсылает к docs/wiki/ и AGENTS.md, которых в
13
+ # дистрибутиве нет. Страница на PyPI берётся из docs/PYPI.md
14
+ # docs/wiki/ — вики написана для тех, кто сопровождает репозиторий
15
+ prune tests
16
+ prune docs/wiki
17
+ prune .idea
18
+ prune .github
19
+ exclude README.md
20
+ exclude AGENTS.md
21
+ exclude CLAUDE.md
22
+ exclude pytest.ini
23
+ exclude .private-names
@@ -0,0 +1,139 @@
1
+ Metadata-Version: 2.1
2
+ Name: partest-load
3
+ Version: 0.1.0
4
+ Summary: Time-based load harness for the partest family: duration-driven profiles, saturation and degradation metrics, offline HTML dashboard
5
+ Home-page: https://github.com/Dec01/partest-load
6
+ Author: dec01
7
+ Author-email: parshin.ewgeniy@yandex.ru
8
+ License: MIT
9
+ Project-URL: Source, https://github.com/Dec01/partest-load
10
+ Project-URL: Issues, https://github.com/Dec01/partest-load/issues
11
+ Project-URL: Changelog, https://github.com/Dec01/partest-load/blob/master/CHANGELOG.md
12
+ Project-URL: Documentation, https://github.com/Dec01/partest-load/blob/master/docs/wiki/index.md
13
+ Project-URL: PyPI, https://pypi.org/project/partest-load/
14
+ Project-URL: partest, https://github.com/Dec01/partest
15
+ Keywords: load testing,stress testing,performance,api,openapi,partest
16
+ Classifier: Development Status :: 3 - Alpha
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Topic :: Software Development :: Testing
25
+ Classifier: Topic :: Software Development :: Testing :: Traffic Generation
26
+ Requires-Python: >=3.10
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ Requires-Dist: partest>=1.8
30
+ Requires-Dist: httpx[http2]>=0.27.2
31
+ Requires-Dist: PyYAML>=6.0.2
32
+ Requires-Dist: pydantic>=2.0.0
33
+ Provides-Extra: report
34
+ Requires-Dist: numpy>=1.24; extra == "report"
35
+ Requires-Dist: pandas>=2.0; extra == "report"
36
+ Requires-Dist: plotly>=5.18; extra == "report"
37
+ Requires-Dist: Jinja2>=3.1; extra == "report"
38
+ Provides-Extra: all
39
+ Requires-Dist: partest-load[report]; extra == "all"
40
+
41
+ # partest-load
42
+
43
+ Time-based load harness of the [partest](https://pypi.org/project/partest/) family: load
44
+ profiles measured in **seconds, not request counts**, saturation and degradation metrics, and
45
+ an HTML dashboard that is assembled entirely offline.
46
+
47
+ ```bash
48
+ pip install 'partest-load[report]'
49
+ ```
50
+
51
+ Python 3.10+. Without the `report` extra a run still executes and its results are still
52
+ saved — only the HTML dashboard is missing. The extra carries `numpy`, `pandas`, `plotly` and
53
+ `Jinja2`, which weigh more than everything else together.
54
+
55
+ ## Duration, not a request count
56
+
57
+ A run of "10 000 requests" finishes sooner the slower the system is: a degrading service
58
+ receives less load per second and therefore looks calmer. A request count measures our
59
+ patience, not the system's endurance.
60
+
61
+ Duration fixes the experiment on the load side and leaves the system's behaviour observable.
62
+ Two runs of the same duration are comparable; two runs of the same request count are not.
63
+
64
+ | Profile | What it does | What it answers |
65
+ |---|---|---|
66
+ | `linear` | constant load | does the system hold the given level |
67
+ | `ramp` | gradual rise to a plateau, then a decline | where degradation starts |
68
+ | `stress` | aggressive rise until failure | saturation point and degradation slope |
69
+ | `batch` | a finite set of requests at one level | does the system get through the list |
70
+
71
+ Metrics: RPS, latency percentiles, success and error share, response sizes; for `stress` also
72
+ the saturation point and the degradation slope. Mean latency is deliberately not reported —
73
+ an average over a long-tailed distribution hides exactly what a load run is made for.
74
+
75
+ ## One command
76
+
77
+ ```bash
78
+ partest-load \
79
+ --endpoints my/endpoints.yaml --endpoint orders_create \
80
+ --profile my/profiles/ramp.yaml \
81
+ --results-root out/load --save-raw \
82
+ --report out/load/dashboard.html
83
+ ```
84
+
85
+ `--dry-run` parses and prints the configuration without sending a single request.
86
+ `--report-only` rebuilds the dashboard from runs already on disk.
87
+
88
+ **Load is sent only on an explicit command** — no warm-up on import, no background requests.
89
+ A tool that can hit a stand by accident does not get installed.
90
+
91
+ ## A run is identified by its operation
92
+
93
+ The identity of a run is the **operation**, written as `METHOD /path`
94
+ (`GET /v1/items/{id}`), and it is derived from the endpoint description — there is no
95
+ separate argument for it, so it cannot disagree with what was actually loaded.
96
+
97
+ ```text
98
+ <root>/<operation key>/<profile>/<time>__<operation key>__<profile>__<hex>.json
99
+ <root>/_latest/<operation key>__<profile>.json pointer to the latest run
100
+ ```
101
+
102
+ The operation key is a filesystem-safe name (a readable remainder plus eight hex characters).
103
+ The conversion is one-way, so the operation itself is stored **inside the run file** in its
104
+ original form, path `{placeholders}` included: that is what lets a measurement be matched with
105
+ outside data about the same endpoint, without decoding a directory name.
106
+
107
+ `--endpoint` stays a **caption** — the name you gave the endpoint yourself. It is written into
108
+ the run and shown in the report, but identifies nothing: rename it and the run history stays
109
+ where it is.
110
+
111
+ ## Your values stay yours
112
+
113
+ Endpoint descriptions and profiles are your files. The package ships **schemas and engines**;
114
+ concrete endpoints, stand addresses and credentials never enter it, not even as examples. All
115
+ paths are passed explicitly — nothing is discovered relative to the current directory.
116
+
117
+ ## The dashboard is built offline
118
+
119
+ No CDN, no external fonts, no libraries fetched from the network: `plotly.js` is embedded into
120
+ the file, taken from the installed `plotly` package or from a file you point at with
121
+ `--plotly-js`. If there is nowhere to take it from, the dashboard is built with tables and
122
+ says on the page why there are no charts.
123
+
124
+ ## Early days
125
+
126
+ First release. Not yet implemented, and not to be relied upon: the `load.profile` artifact
127
+ export (`artifacts.py` does not exist — the run result is read by the dashboard only), reuse
128
+ of `partest` for authentication, headers, the endpoint list and secret redaction, and stopping
129
+ a run on profile thresholds for `linear` and `ramp` (only `stress` decides to abort).
130
+
131
+ The run record format is `2.0`.
132
+
133
+ ## Links
134
+
135
+ Source and issues: **https://github.com/Dec01/partest-load**
136
+
137
+ ## License
138
+
139
+ MIT.
@@ -0,0 +1,99 @@
1
+ # partest-load
2
+
3
+ Time-based load harness of the [partest](https://pypi.org/project/partest/) family: load
4
+ profiles measured in **seconds, not request counts**, saturation and degradation metrics, and
5
+ an HTML dashboard that is assembled entirely offline.
6
+
7
+ ```bash
8
+ pip install 'partest-load[report]'
9
+ ```
10
+
11
+ Python 3.10+. Without the `report` extra a run still executes and its results are still
12
+ saved — only the HTML dashboard is missing. The extra carries `numpy`, `pandas`, `plotly` and
13
+ `Jinja2`, which weigh more than everything else together.
14
+
15
+ ## Duration, not a request count
16
+
17
+ A run of "10 000 requests" finishes sooner the slower the system is: a degrading service
18
+ receives less load per second and therefore looks calmer. A request count measures our
19
+ patience, not the system's endurance.
20
+
21
+ Duration fixes the experiment on the load side and leaves the system's behaviour observable.
22
+ Two runs of the same duration are comparable; two runs of the same request count are not.
23
+
24
+ | Profile | What it does | What it answers |
25
+ |---|---|---|
26
+ | `linear` | constant load | does the system hold the given level |
27
+ | `ramp` | gradual rise to a plateau, then a decline | where degradation starts |
28
+ | `stress` | aggressive rise until failure | saturation point and degradation slope |
29
+ | `batch` | a finite set of requests at one level | does the system get through the list |
30
+
31
+ Metrics: RPS, latency percentiles, success and error share, response sizes; for `stress` also
32
+ the saturation point and the degradation slope. Mean latency is deliberately not reported —
33
+ an average over a long-tailed distribution hides exactly what a load run is made for.
34
+
35
+ ## One command
36
+
37
+ ```bash
38
+ partest-load \
39
+ --endpoints my/endpoints.yaml --endpoint orders_create \
40
+ --profile my/profiles/ramp.yaml \
41
+ --results-root out/load --save-raw \
42
+ --report out/load/dashboard.html
43
+ ```
44
+
45
+ `--dry-run` parses and prints the configuration without sending a single request.
46
+ `--report-only` rebuilds the dashboard from runs already on disk.
47
+
48
+ **Load is sent only on an explicit command** — no warm-up on import, no background requests.
49
+ A tool that can hit a stand by accident does not get installed.
50
+
51
+ ## A run is identified by its operation
52
+
53
+ The identity of a run is the **operation**, written as `METHOD /path`
54
+ (`GET /v1/items/{id}`), and it is derived from the endpoint description — there is no
55
+ separate argument for it, so it cannot disagree with what was actually loaded.
56
+
57
+ ```text
58
+ <root>/<operation key>/<profile>/<time>__<operation key>__<profile>__<hex>.json
59
+ <root>/_latest/<operation key>__<profile>.json pointer to the latest run
60
+ ```
61
+
62
+ The operation key is a filesystem-safe name (a readable remainder plus eight hex characters).
63
+ The conversion is one-way, so the operation itself is stored **inside the run file** in its
64
+ original form, path `{placeholders}` included: that is what lets a measurement be matched with
65
+ outside data about the same endpoint, without decoding a directory name.
66
+
67
+ `--endpoint` stays a **caption** — the name you gave the endpoint yourself. It is written into
68
+ the run and shown in the report, but identifies nothing: rename it and the run history stays
69
+ where it is.
70
+
71
+ ## Your values stay yours
72
+
73
+ Endpoint descriptions and profiles are your files. The package ships **schemas and engines**;
74
+ concrete endpoints, stand addresses and credentials never enter it, not even as examples. All
75
+ paths are passed explicitly — nothing is discovered relative to the current directory.
76
+
77
+ ## The dashboard is built offline
78
+
79
+ No CDN, no external fonts, no libraries fetched from the network: `plotly.js` is embedded into
80
+ the file, taken from the installed `plotly` package or from a file you point at with
81
+ `--plotly-js`. If there is nowhere to take it from, the dashboard is built with tables and
82
+ says on the page why there are no charts.
83
+
84
+ ## Early days
85
+
86
+ First release. Not yet implemented, and not to be relied upon: the `load.profile` artifact
87
+ export (`artifacts.py` does not exist — the run result is read by the dashboard only), reuse
88
+ of `partest` for authentication, headers, the endpoint list and secret redaction, and stopping
89
+ a run on profile thresholds for `linear` and `ramp` (only `stress` decides to abort).
90
+
91
+ The run record format is `2.0`.
92
+
93
+ ## Links
94
+
95
+ Source and issues: **https://github.com/Dec01/partest-load**
96
+
97
+ ## License
98
+
99
+ MIT.
@@ -0,0 +1,23 @@
1
+ """partest-load — нагрузочный харнесс семейства partest.
2
+
3
+ Нагрузка задаётся временем, а не количеством запросов: интересует не «сколько отправили»,
4
+ а «где система перестала держать». Пакет пишет свои результаты в каталог прогонов и умеет
5
+ собрать по ним HTML-дашборд.
6
+
7
+ Артефакта `load.profile` для внешнего потребителя пакет **пока не пишет**: модуля
8
+ `artifacts.py` нет, и формат ещё не согласован с владельцем контракта артефактов.
9
+ Предыдущая редакция этой строки обещала его в настоящем времени — то есть
10
+ `help(partest_load)` сообщал неправду тому, кто пришёл за этим артефактом.
11
+ """
12
+
13
+ # Единственный источник правды о версии — этот литерал; `setup.py` читает его отсюда
14
+ # регулярным выражением. Так же устроены `partest` и `partest-gen`, и порядок в семействе
15
+ # один: номер объявляется в пакете, сборка его забирает. Обратное объявление (литерал в
16
+ # метаданных дистрибутива, а здесь чтение через `importlib.metadata`) давало верный номер
17
+ # только у установленного пакета: из рабочего дерева `__version__` был `0.0.0.dev0`, а при
18
+ # старой установке рядом — номером той установки, а не этого кода.
19
+ __version__ = "0.1.0"
20
+
21
+ from .core.runner import run_load_test # noqa: E402
22
+
23
+ __all__ = ["__version__", "run_load_test"]