Skip to content

Commit

Permalink
e7d5c27e72236cb7d4ba6cff580b8fc65623d178
Browse files Browse the repository at this point in the history
  • Loading branch information
oke11o committed Jul 18, 2024
1 parent 648b637 commit d21bccc
Show file tree
Hide file tree
Showing 22 changed files with 480 additions and 10 deletions.
18 changes: 16 additions & 2 deletions .mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,15 @@
"docs/assets/scss/_variables_project.scss":"load/projects/pandora/docs/assets/scss/_variables_project.scss",
"docs/config.yaml":"load/projects/pandora/docs/config.yaml",
"docs/content/en/_index.md":"load/projects/pandora/docs/content/en/_index.md",
"docs/content/en/aggregator/_index.md":"load/projects/pandora/docs/content/en/aggregator/_index.md",
"docs/content/en/aggregator/sink.md":"load/projects/pandora/docs/content/en/aggregator/sink.md",
"docs/content/en/best-practices/_index.md":"load/projects/pandora/docs/content/en/best-practices/_index.md",
"docs/content/en/best-practices/discard-overflow.md":"load/projects/pandora/docs/content/en/best-practices/discard-overflow.md",
"docs/content/en/best-practices/rps-per-instance.md":"load/projects/pandora/docs/content/en/best-practices/rps-per-instance.md",
"docs/content/en/best-practices/shared-client.md":"load/projects/pandora/docs/content/en/best-practices/shared-client.md",
"docs/content/en/generator/_index.md":"load/projects/pandora/docs/content/en/generator/_index.md",
"docs/content/en/generator/custom.md":"load/projects/pandora/docs/content/en/generator/custom.md",
"docs/content/en/generator/dummy-generator.md":"load/projects/pandora/docs/content/en/generator/dummy-generator.md",
"docs/content/en/generator/grpc-generator.md":"load/projects/pandora/docs/content/en/generator/grpc-generator.md",
"docs/content/en/generator/http-generator.md":"load/projects/pandora/docs/content/en/generator/http-generator.md",
"docs/content/en/generator/scenario-grpc-generator.md":"load/projects/pandora/docs/content/en/generator/scenario-grpc-generator.md",
Expand All @@ -296,16 +299,23 @@
"docs/content/en/get-started/tutorial.md":"load/projects/pandora/docs/content/en/get-started/tutorial.md",
"docs/content/en/load-profile.md":"load/projects/pandora/docs/content/en/load-profile.md",
"docs/content/en/performance.md":"load/projects/pandora/docs/content/en/performance.md",
"docs/content/en/providers.md":"load/projects/pandora/docs/content/en/providers.md",
"docs/content/en/provider/_index.md":"load/projects/pandora/docs/content/en/provider/_index.md",
"docs/content/en/provider/data-sources.md":"load/projects/pandora/docs/content/en/provider/data-sources.md",
"docs/content/en/provider/dummy-provider.md":"load/projects/pandora/docs/content/en/provider/dummy-provider.md",
"docs/content/en/provider/http-provider.md":"load/projects/pandora/docs/content/en/provider/http-provider.md",
"docs/content/en/provider/json-provider.md":"load/projects/pandora/docs/content/en/provider/json-provider.md",
"docs/content/en/search.md":"load/projects/pandora/docs/content/en/search.md",
"docs/content/en/startup.md":"load/projects/pandora/docs/content/en/startup.md",
"docs/content/ru/_index.md":"load/projects/pandora/docs/content/ru/_index.md",
"docs/content/ru/aggregator/_index.md":"load/projects/pandora/docs/content/ru/aggregator/_index.md",
"docs/content/ru/aggregator/sink.md":"load/projects/pandora/docs/content/ru/aggregator/sink.md",
"docs/content/ru/best-practices/_index.md":"load/projects/pandora/docs/content/ru/best-practices/_index.md",
"docs/content/ru/best-practices/discard-overflow.md":"load/projects/pandora/docs/content/ru/best-practices/discard-overflow.md",
"docs/content/ru/best-practices/rps-per-instance.md":"load/projects/pandora/docs/content/ru/best-practices/rps-per-instance.md",
"docs/content/ru/best-practices/shared-client.md":"load/projects/pandora/docs/content/ru/best-practices/shared-client.md",
"docs/content/ru/generator/_index.md":"load/projects/pandora/docs/content/ru/generator/_index.md",
"docs/content/ru/generator/custom.md":"load/projects/pandora/docs/content/ru/generator/custom.md",
"docs/content/ru/generator/dummy-generator.md":"load/projects/pandora/docs/content/ru/generator/dummy-generator.md",
"docs/content/ru/generator/grpc-generator.md":"load/projects/pandora/docs/content/ru/generator/grpc-generator.md",
"docs/content/ru/generator/http-generator.md":"load/projects/pandora/docs/content/ru/generator/http-generator.md",
"docs/content/ru/generator/scenario-grpc-generator.md":"load/projects/pandora/docs/content/ru/generator/scenario-grpc-generator.md",
Expand All @@ -321,7 +331,11 @@
"docs/content/ru/get-started/tutorial.md":"load/projects/pandora/docs/content/ru/get-started/tutorial.md",
"docs/content/ru/load-profile.md":"load/projects/pandora/docs/content/ru/load-profile.md",
"docs/content/ru/performance.md":"load/projects/pandora/docs/content/ru/performance.md",
"docs/content/ru/providers.md":"load/projects/pandora/docs/content/ru/providers.md",
"docs/content/ru/provider/_index.md":"load/projects/pandora/docs/content/ru/provider/_index.md",
"docs/content/ru/provider/data-sources.md":"load/projects/pandora/docs/content/ru/provider/data-sources.md",
"docs/content/ru/provider/dummy-provider.md":"load/projects/pandora/docs/content/ru/provider/dummy-provider.md",
"docs/content/ru/provider/http-provider.md":"load/projects/pandora/docs/content/ru/provider/http-provider.md",
"docs/content/ru/provider/json-provider.md":"load/projects/pandora/docs/content/ru/provider/json-provider.md",
"docs/content/ru/search.md":"load/projects/pandora/docs/content/ru/search.md",
"docs/content/ru/startup.md":"load/projects/pandora/docs/content/ru/startup.md",
"docs/docsy.work":"load/projects/pandora/docs/docsy.work",
Expand Down
10 changes: 9 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Docsy Example
# Pandora documentation with Docsy theme

## Quick start

```shell
hugo server
```

## Docsy

[Docsy][] is a [Hugo theme module][] for technical documentation sites, providing easy
site navigation, structure, and more. This **Docsy Example Project** uses the Docsy
Expand Down
61 changes: 61 additions & 0 deletions docs/content/en/aggregator/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: Aggregator
description:
categories: [Aggregator]
weight: 10
---

The aggregator collects samples and stores them somewhere.

### 1. phout

**All config**

```yaml
result:
type: phout
destination: file_path.log
id: false # Print ammo ids if true.
flush-time: 1s
sample-queue-size: 262144
buffer-size: 1048576
```
### 2. jsonlines
```yaml
result:
type: jsonlines
sink:
type: file
path: file_path
buffer-size: 1048576
flush-interval: 1s
sample-queue-size: 131072
marshal-float-with-6-digits: false
sort-map-keys: false
```
See [here](./sink.md) for other types for `sink`.

### 3. json

This is an alias for `jsonlines`.

### 4. log

Output aggregator data to Pandora's standard logs

```yaml
result:
type: log
```

### 5. discard

Discard aggregator output

```yaml
result:
type: discard
```
28 changes: 28 additions & 0 deletions docs/content/en/aggregator/sink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: Sink
description:
categories: [Aggregators]
weight: 2
---

1. file

```yaml
sink:
type: file
path: file_path
```
2. stdout
```yaml
sink:
type: stdout
```
3. stderr
```yaml
sink:
type: stderr
```
2 changes: 1 addition & 1 deletion docs/content/en/best-practices/_index.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
title: Best practices
description:
categories: [Best practices]
weight: 6
weight: 12
---
16 changes: 16 additions & 0 deletions docs/content/en/generator/dummy-generator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: Dummy generator
description: Dummy generator is used to check load profiles
categories: [Provider]
tags: [provider, dummy]
weight: 1
---

When you are creating a complex load profile that consists of multiple phases, or just want to test
what your load profile will look like, you can use the Dummy Generator to keep your test server unloaded in the first stage.

```yaml
gun:
type: dummy
sleep: 10ms # optional
```
7 changes: 7 additions & 0 deletions docs/content/en/provider/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Providers
description: Pandora component responsible for generating Payload from files for the generator
categories: [Providers]
weight: 3
---

35 changes: 35 additions & 0 deletions docs/content/en/provider/data-sources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: Data Sources
description: To simplify the implementation of your custom generators
categories: [Provider]
tags: [provider, dummy]
weight: 40
---

Used for json providers

There are 3 data sources

1. `file`

```yaml
source:
type: file
path: you_path
```
2. `stdin`

```yaml
source:
type: stdin
```

3. `inline`

```yaml
source:
type: inline
data: |
{"you": "json"}
```
20 changes: 20 additions & 0 deletions docs/content/en/provider/dummy-provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Dummy Provider
description: Dummy provider is used for generators without external Payload.
categories: [Provider]
tags: [provider, dummy]
weight: 30
---

Pandora requires a Provider configuration. But there are cases where you don't need any Payload.
In such cases, you can use an empty `dummy` Provider

```yaml
ammo:
type: dummy
```
This provider is useful in 2 cases:
1. for checks on your payload profile configuration
2. for custom generators, where you prepare your Payloads inside the generator
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: HTTP Ammo providers
description: HTTP Ammo provider is a source of test data - it makes ammo object
categories: [Provider]
tags: [provider, http]
weight: 6
weight: 10
---

HTTP Ammo provider is a source of test data: it makes ammo object.
Expand Down
46 changes: 46 additions & 0 deletions docs/content/en/provider/json-provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: JSON provider
description: JSON provider converts to Payload json files
categories: [Provider]
tags: [provider, json]
weight: 20
---

The provider reads the payload files and passes a structure of the desired type to the generators.

Since you cannot use your own structures in the default build, the default provider returns
`map[string]interface{}{}`

But this provider is convenient for creating custom generators.
You only need to specify your type into which you want to marshal the json file

```go
import (
"github.com/yandex/pandora/core"
coreimport "github.com/yandex/pandora/core/import"
)

type MyCustomPayload struct {
URL string
QueryParam string
}

//...
coreimport.RegisterCustomJSONProvider("my-custom-provider-name", func() core.Ammo { return &MyCustomPayload{} })
//...
```

And specify your ISP in the config

```yaml
provider:
type: my-custom-provider-name
ammo-queue-size: 1
limit: 0
passes: 0
source:
type: file
path: my-costom-payload.json
```
You can also use `stdin`, `inline` for the source. See [payload sources](data-sources.md) for more details
82 changes: 82 additions & 0 deletions docs/content/ru/aggregator/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
title: Аггрегатор
description:
categories: [Aggregator]
weight: 10
---

Агрегатор собирает замеры запросов и сохраняет их в каком-нибудь месте.


### 1. phout

**Минимальный конфиг**

```yaml
result:
type: phout
destination: file_path.log
```
**Весь конфиг**
```yaml
result:
type: phout
destination: file_path.log
id: false # Print ammo ids if true.
flush-time: 1s
sample-queue-size: 262144
buffer-size: 1048576
```
### 2. jsonlines
**Минимальный конфиг**
```yaml
result:
type: jsonlines
sink:
type: file
path: file_path
```
**Весь конфиг**
```yaml
result:
type: jsonlines
sink:
type: file
path: file_path
buffer-size: 1048576
flush-interval: 1s
sample-queue-size: 131072
marshal-float-with-6-digits: false
sort-map-keys: false
```
Какие еще типы для `sink` существуют смотрите [тут](./sink.md)

### 3. json

Эта псевдоним для `jsonlines`

### 4. log

Вывод данных аггрегатора в о стандартный лог Пандоры

```yaml
result:
type: log
```

### 5. discard

Отказ от вывода аггрегатора

```yaml
result:
type: discard
```
Loading

0 comments on commit d21bccc

Please sign in to comment.