From 8b70505c363084a1309e8ada987fa3d3d2554aa1 Mon Sep 17 00:00:00 2001 From: sabevzenko Date: Thu, 14 Mar 2024 18:21:23 +0300 Subject: [PATCH] docs f9583770112b3eaa1f00a8f151ffad6d7219b31f --- .mapping.json | 6 +- docs/eng/architecture.md | 6 +- docs/eng/grpc-generator.md | 37 +++++++++-- docs/eng/load-profile.md | 3 - docs/eng/scenario-grpc-generator.md | 4 +- docs/eng/startup.md | 93 +++++++++++++++++++++++++++ docs/eng/{tuturial.md => tutorial.md} | 0 docs/index.md | 4 +- docs/rus/architecture.md | 9 +-- docs/rus/custom.md | 4 +- docs/rus/grpc-generator.md | 39 +++++++++-- docs/rus/index.md | 4 +- docs/rus/load-profile.md | 8 +-- docs/rus/performance.md | 4 +- docs/rus/providers.md | 4 +- docs/rus/scenario-grpc-generator.md | 4 +- docs/rus/startup.md | 93 +++++++++++++++++++++++++++ docs/rus/{tuturial.md => tutorial.md} | 4 +- 18 files changed, 283 insertions(+), 43 deletions(-) create mode 100644 docs/eng/startup.md rename docs/eng/{tuturial.md => tutorial.md} (100%) create mode 100644 docs/rus/startup.md rename docs/rus/{tuturial.md => tutorial.md} (95%) diff --git a/.mapping.json b/.mapping.json index db797b8c7..dde39b51d 100644 --- a/.mapping.json +++ b/.mapping.json @@ -260,7 +260,8 @@ "docs/eng/scenario-grpc-generator.md":"load/projects/pandora/docs/eng/scenario-grpc-generator.md", "docs/eng/scenario-http-generator.md":"load/projects/pandora/docs/eng/scenario-http-generator.md", "docs/eng/scenario/variable_source.md":"load/projects/pandora/docs/eng/scenario/variable_source.md", - "docs/eng/tuturial.md":"load/projects/pandora/docs/eng/tuturial.md", + "docs/eng/startup.md":"load/projects/pandora/docs/eng/startup.md", + "docs/eng/tutorial.md":"load/projects/pandora/docs/eng/tutorial.md", "docs/images/architecture.graphml":"load/projects/pandora/docs/images/architecture.graphml", "docs/images/architecture.png":"load/projects/pandora/docs/images/architecture.png", "docs/images/http_100kb_net.png":"load/projects/pandora/docs/images/http_100kb_net.png", @@ -284,7 +285,8 @@ "docs/rus/scenario-grpc-generator.md":"load/projects/pandora/docs/rus/scenario-grpc-generator.md", "docs/rus/scenario-http-generator.md":"load/projects/pandora/docs/rus/scenario-http-generator.md", "docs/rus/scenario/variable_source.md":"load/projects/pandora/docs/rus/scenario/variable_source.md", - "docs/rus/tuturial.md":"load/projects/pandora/docs/rus/tuturial.md", + "docs/rus/startup.md":"load/projects/pandora/docs/rus/startup.md", + "docs/rus/tutorial.md":"load/projects/pandora/docs/rus/tutorial.md", "examples/connect.yaml":"load/projects/pandora/examples/connect.yaml", "examples/custom_pandora/custom.yaml":"load/projects/pandora/examples/custom_pandora/custom.yaml", "examples/custom_pandora/custom_main.go":"load/projects/pandora/examples/custom_pandora/custom_main.go", diff --git a/docs/eng/architecture.md b/docs/eng/architecture.md index 5e3ff3de1..1f0bf1206 100644 --- a/docs/eng/architecture.md +++ b/docs/eng/architecture.md @@ -28,11 +28,9 @@ Pandora is a set of components talking to each other through Go channels. There Ammo Provider knows how to make an ammo object from an ammo file or other external resource. Instances get ammo objects from Ammo Provider. -### Instances Pool +### Instance Pool -Instances Pool manages the creation of Instances. You can think of one Instance as a single user that sends requests to -a server sequentially. All Instances from one Instances Pool get their ammo from one Ammo Provider. Instances creation -times are controlled by Startup Scheduler. All Instances from one Instances Pool also have Guns of the same type. +Instance Pool manages the creation of Instances. You can think of one Instance as a single user that sends requests to a server sequentially. All Instances from one Instance Pool get their ammo from one Ammo Provider. Instances creation times are controlled by Startup Scheduler. All Instances from one Instance Pool also have Guns of the same type. ### Scheduler diff --git a/docs/eng/grpc-generator.md b/docs/eng/grpc-generator.md index 31313a0a7..206d3dbe6 100644 --- a/docs/eng/grpc-generator.md +++ b/docs/eng/grpc-generator.md @@ -8,19 +8,46 @@ Full gRPC generator config ```yaml gun: - type: http + type: grpc target: '[hostname]:443' - timeout: 15s - tls: true + timeout: 15s # Grpc request timeout. Default: 15s + tls: false # If true, Pandora accepts any certificate presented by the server and any host name in that certificate. Default: false dial_options: - timeout: 1s - authority: string + authority: some.host # Specifies the value to be used as the :authority pseudo-header and as the server name in authentication handshake + timeout: 1s # Timeout for dialing GRPC connect. Default: 1s answlog: enabled: true path: ./answ.log filter: all # all - all http codes, warning - log 4xx and 5xx, error - log only 5xx. Default: error ``` +## Mapping Response Codes + +Pandora uses the gRPC client from google.golang.org/grpc as a client (https://github.com/grpc/grpc-go) + +But to unify reports it converts them into HTTP codes. + +### Mapping table gPRC StatusCode -> HTTP StatusCode + +| gRPC Status Name | gRPC Status Code | HTTP Status Code | +|--------------------|------------------|------------------| +| OK | 0 | 200 | +| Canceled | 1 | 499 | +| InvalidArgument | 3 | 400 | +| DeadlineExceeded | 4 | 504 | +| NotFound | 5 | 404 | +| AlreadyExists | 6 | 409 | +| PermissionDenied | 7 | 403 | +| ResourceExhausted | 8 | 429 | +| FailedPrecondition | 9 | 400 | +| Aborted | 10 | 409 | +| OutOfRange | 11 | 400 | +| Unimplemented | 12 | 501 | +| Unavailable 14 | 14 | 503 | +| Unauthenticated 16 | 16 | 401 | +| unknown | - | 500 | + + --- [Home](index.md) diff --git a/docs/eng/load-profile.md b/docs/eng/load-profile.md index 61c3dc29d..20899fd6a 100644 --- a/docs/eng/load-profile.md +++ b/docs/eng/load-profile.md @@ -6,9 +6,6 @@ To determine what load to create on the server, use a load profile. It sets how the load will be changed and maintained. -Most tools have their own formats for defining load profiles. When configuring a test via the UI, you can get the final profile by adding sections in the correct order. - - ## line Linearly increases the load in a given range over a certain period of time. diff --git a/docs/eng/scenario-grpc-generator.md b/docs/eng/scenario-grpc-generator.md index fd68578f4..7729a4d20 100644 --- a/docs/eng/scenario-grpc-generator.md +++ b/docs/eng/scenario-grpc-generator.md @@ -43,8 +43,8 @@ The minimum generator configuration is as follows ```yaml gun: - type: http/scenario - target: localhost:80 + type: grpc/scenario + target: localhost:8888 ``` For a scenario gRPC generator, all settings of a regular gRPC generator are supported [gRPC generator](grpc-generator.md) diff --git a/docs/eng/startup.md b/docs/eng/startup.md new file mode 100644 index 000000000..4bb5bf66c --- /dev/null +++ b/docs/eng/startup.md @@ -0,0 +1,93 @@ +[Home](index.md) + +--- + +# Instance startup profile + +You can control the profile of instance starts. + +Types of Instance startup profile: + +- [once](#once) +- [const](#const) +- [instance_step](#instance_step) +- [composite](#composite) + +#### Note: you cannot reduce the number of running instances + +The startup profile only works to create instances. That is, Pandora does not delete instances until the test is complete. + +## once + +A specified number of instances are created once. + +**Example**: + +creating 10 instances at the start of this test section + +```yaml +startup: + type: once + times: 10 +``` + +## const + +Creating instances at a certain speed. + +**Example**: + +creating 5 instances every second for 60 seconds. As a result, 300 instances will be created after 60 seconds + +```yaml +startup: + type: const + duration: 60s + ops: 5 +``` + +## instance_step + +Creates instances in periodic increments. + +**Example**: + +10 instances are created every 10 seconds. As a result, 100 instances will be created after 100 seconds + +```yaml +startup: + type: instance_step + from: 10 + to: 100 + step: 10 + stepduration: 10s +``` + +## composite + +Composite startup profile is a possibility of arbitrary combination of the above described profiles. + +**Example**: + +Implement a single step [instance_step](#instance_step) using once and const. +- 10 instances are created +- No instances are created within 10 seconds(_ops: 0_) +- 10 instances are created. +- As a result, 20 instances will be created and will run until the entire test is complete + +```yaml +startup: + - type: once + times: 10 + - type: const + ops: 0 + duration: 10s + - type: once + times: 10 +``` + + + +--- + +[Home](index.md) diff --git a/docs/eng/tuturial.md b/docs/eng/tutorial.md similarity index 100% rename from docs/eng/tuturial.md rename to docs/eng/tutorial.md diff --git a/docs/index.md b/docs/index.md index bdf9fccb7..22b993a3e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -7,11 +7,13 @@ write your own load scenarios in Go, compiling them just before your test. - [Installation](eng/install.md) - [Configuration](eng/config.md) -- [Your first test](eng/tuturial.md) +- [Your first test](eng/tutorial.md) - [Load profile](eng/load-profile.md) +- [Instance startup profile](eng/startup.md) - [HTTP providers](eng/providers.md) - [HTTP generators](eng/http-generator.md) - [Scenario generator / HTTP](eng/scenario-http-generator.md) +- [gRPC generators](eng/grpc-generator.md) - [Scenario generator / gRPC](eng/scenario-grpc-generator.md) - [Custom guns](eng/custom.md) - [Pandora’s performance](eng/performance.md) diff --git a/docs/rus/architecture.md b/docs/rus/architecture.md index 874482291..76139543d 100644 --- a/docs/rus/architecture.md +++ b/docs/rus/architecture.md @@ -28,11 +28,12 @@ Pandora - это набор компонентов, взаимодействую Ammo Provider знает, как создать объект Payload из payload файла (ammo file) или другого внешнего ресурса. И их задача передать Payload Instance'у. См метод `func (p *Provider) Acquire() (core.Ammo, bool)` -### Instances Pool +### Instance Pool -Instances Pool manages the creation of Instances. You can think of one Instance as a single user that sends requests to -a server sequentially. All Instances from one Instances Pool get their ammo from one Ammo Provider. Instances creation -times are controlled by Startup Scheduler. All Instances from one Instances Pool also have Guns of the same type. +**Пул инстансов** управляет созданием **инстансов**. Один инстанс можно представить как одного пользователя, который +**последовательно** отправляет запросы на сервер. Все инстансы из одного пула инстансов получают данные от одного +**провайдера**. Время создания инстанса контролируется **планировщиком**. Все инстансы из одного пула инстансов имеют генераторы +одного типа. ### Scheduler diff --git a/docs/rus/custom.md b/docs/rus/custom.md index 85be8f633..770b920a7 100644 --- a/docs/rus/custom.md +++ b/docs/rus/custom.md @@ -1,4 +1,4 @@ -[Home](index.md) +[К содержанию](index.md) --- @@ -452,4 +452,4 @@ func main() { --- -[Home](index.md) \ No newline at end of file +[К содержанию](index.md) \ No newline at end of file diff --git a/docs/rus/grpc-generator.md b/docs/rus/grpc-generator.md index 1ec3d6e77..0223a2a2c 100644 --- a/docs/rus/grpc-generator.md +++ b/docs/rus/grpc-generator.md @@ -8,19 +8,46 @@ ```yaml gun: - type: http + type: grpc target: '[hostname]:443' - timeout: 15s - tls: true + timeout: 15s # Таймаут для запросов gRPC. По умолчанию: 15s + tls: false # Если true, Pandora принимает любой сертификат, представленный сервером, и любое имя хоста в этом сертификате. По умолчанию: false dial_options: - timeout: 1s - authority: string + authority: some.host # Указывает значение, которое будет использоваться в качестве псевдозаголовка :authority и имени сервера в процессе аутентификации. + timeout: 1s # Таймаут установки gRPC соединения. По умолчанию: 1s answlog: enabled: true path: ./answ.log - filter: all # all - all http codes, warning - log 4xx and 5xx, error - log only 5xx. Default: error + filter: all # all - все http-коды, warning - логировать 4xx и 5xx, error - логировать только 5xx. По умолчанию: error ``` +## Маппинг кодов ответа + +В качестве клиента Пандора использует gRPC клиент от google.golang.org/grpc (https://github.com/grpc/grpc-go) + +Но для унификации графиков преобразует их в HTTP коды. + +### Таблица маппинга gPRC StatusCode -> HTTP StatusCode + +| gRPC Status Name | gRPC Status Code | HTTP Status Code | +|--------------------|------------------|------------------| +| OK | 0 | 200 | +| Canceled | 1 | 499 | +| InvalidArgument | 3 | 400 | +| DeadlineExceeded | 4 | 504 | +| NotFound | 5 | 404 | +| AlreadyExists | 6 | 409 | +| PermissionDenied | 7 | 403 | +| ResourceExhausted | 8 | 429 | +| FailedPrecondition | 9 | 400 | +| Aborted | 10 | 409 | +| OutOfRange | 11 | 400 | +| Unimplemented | 12 | 501 | +| Unavailable 14 | 14 | 503 | +| Unauthenticated 16 | 16 | 401 | +| unknown | - | 500 | + + --- [Домой](index.md) diff --git a/docs/rus/index.md b/docs/rus/index.md index 33159a117..e96ee8756 100644 --- a/docs/rus/index.md +++ b/docs/rus/index.md @@ -6,11 +6,13 @@ Pandora - это высокопроизводительный генератор - [Установка](install.md) - [Конфигурация](config.md) -- [Первый тест](tuturial.md) +- [Первый тест](tutorial.md) - [Профиль нагрузки](load-profile.md) +- [Профиль создание инстансов](startup.md) - [HTTP providers](providers.md) - [HTTP генератор](http-generator.md) - [Сценарный генератор / HTTP](scenario-http-generator.md) +- [gRPC генератор](grpc-generator.md) - [Сценарный генератор / gRPC](scenario-grpc-generator.md) - [Custom](custom.md) - [Производительность Pandora](performance.md) diff --git a/docs/rus/load-profile.md b/docs/rus/load-profile.md index 2488978b6..163a625a2 100644 --- a/docs/rus/load-profile.md +++ b/docs/rus/load-profile.md @@ -1,4 +1,4 @@ -[Home](index.md) +[К содержанию](index.md) --- @@ -6,8 +6,6 @@ Чтобы определить, какую нагрузку подавать на сервер, используется профиль нагрузки. Профиль определяет, как будет изменяться и поддерживаться нагрузка. -В большинстве инструментов есть свои форматы для определения профиля нагрузки. При конфигурации теста через UI можно собрать итоговый профиль, добавляя участки в правильном порядке. - ## line Линейно увеличивает нагрузку в заданном диапазоне за определенный период времени. @@ -55,9 +53,9 @@ Пример: ``` -Передает столько запросов, сколько может принять цель в рамках установленных соединений без ограничений в течение указанного времени +{type: unlimited, duration: 30s} ``` --- -[Home](index.md) +[К содержанию](index.md) diff --git a/docs/rus/performance.md b/docs/rus/performance.md index 3d49e66da..e92954248 100644 --- a/docs/rus/performance.md +++ b/docs/rus/performance.md @@ -1,4 +1,4 @@ -[Home](index.md) +[К содержанию](index.md) --- @@ -102,4 +102,4 @@ to do this. --- -[Home](index.md) +[К содержанию](index.md) diff --git a/docs/rus/providers.md b/docs/rus/providers.md index a6269a41e..c9ad1a6bb 100644 --- a/docs/rus/providers.md +++ b/docs/rus/providers.md @@ -1,4 +1,4 @@ -[Home](index.md) +[К содержанию](index.md) --- @@ -234,4 +234,4 @@ pools: --- -[Home](index.md) +[К содержанию](index.md) diff --git a/docs/rus/scenario-grpc-generator.md b/docs/rus/scenario-grpc-generator.md index e1be97652..357122665 100644 --- a/docs/rus/scenario-grpc-generator.md +++ b/docs/rus/scenario-grpc-generator.md @@ -43,8 +43,8 @@ pools: ```yaml gun: - type: http/scenario - target: localhost:80 + type: grpc/scenario + target: localhost:8888 ``` Для сценарного генератора поддерживаются все настройки обычного [gRPC генератора](grpc-generator.md) diff --git a/docs/rus/startup.md b/docs/rus/startup.md new file mode 100644 index 000000000..0ae410d68 --- /dev/null +++ b/docs/rus/startup.md @@ -0,0 +1,93 @@ +[К содержанию](index.md) + +--- + +# Профиль создание инстансов + +Вы можете контролировать профиль создания инстансов. + +Варианты правил создания Инстансов: + +- [once](#once) +- [const](#const) +- [instance_step](#instance_step) +- [composite](#composite) + +#### Замечание: нельзя уменьшить количество работающих инстансов + +Профили создания инстансов работают только на создание, то есть Пандора не удаляет инстансы до окончания теста. + +## once + +Разово создается указанное количество инстансов. + +**Пример**: + +создание 10 инстансов на старте этого участка теста + +```yaml +startup: + type: once + times: 10 +``` + +## const + +Создание инстансов с определенной скоростью. + +**Пример**: + +создание 5 инстансов каждую секунду на протяжении 60 секунд. В результате через 60 секунд будет создано 300 инстансов + +```yaml +startup: + type: const + duration: 60s + ops: 5 +``` + +## instance_step + +Создает инстансы с периодическим шагом. + +**Пример**: + +каждые 10 секунд создается 10 инстансов. В результате через 100 секунд будет создано 100 инстансов + +```yaml +startup: + type: instance_step + from: 10 + to: 100 + step: 10 + stepduration: 10s +``` + +## composite + +Композитное создание инстансов - это возможность произвольной комбинации вышеописанных профилей. + +**Пример**: + +Реализация одного шага [instance_step](#instance_step) с помощью once и const. +- Создается 10 инстансов +- В течение 10 секунд инстансы не создаются (_ops: 0_) +- Создается 10 инстансов. +- Итого 20, которые будут работать до окончания всего теста + +```yaml +startup: + - type: once + times: 10 + - type: const + ops: 0 + duration: 10s + - type: once + times: 10 +``` + + + +--- + +[К содержанию](index.md) diff --git a/docs/rus/tuturial.md b/docs/rus/tutorial.md similarity index 95% rename from docs/rus/tuturial.md rename to docs/rus/tutorial.md index 0c66d4576..47e09ccd7 100644 --- a/docs/rus/tuturial.md +++ b/docs/rus/tutorial.md @@ -1,4 +1,4 @@ -[Home](index.md) +[К содержанию](index.md) --- @@ -47,4 +47,4 @@ The results are in `phout.log`. Use [Yandex.Tank](https://yandextank.readthedocs --- -[Home](index.md) +[К содержанию](index.md)