Skip to content

Commit

Permalink
update documentation to look good in both Techdocs and markdown (#168)
Browse files Browse the repository at this point in the history
* update documentation to look good in both Techdocs and markdown
  • Loading branch information
s-radyuk authored Dec 22, 2021
1 parent 08f49e1 commit 0f73559
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 24 deletions.
14 changes: 7 additions & 7 deletions docs/ghz/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Kangal supports `ghz` as a loadtest backend using a custom docker image: [`hellofresh/kangal-ghz`][kangal-ghz] published to [dockerhub].

For more information, please check [ghz official website][`ghz`].
For more information, please check [ghz official website](https://ghz.sh/).

## Usage
To create a loadtest, simply send a request to Kangal proxy with the `ghz` configuration in the `testFile` field:
Expand Down Expand Up @@ -64,7 +64,7 @@ You can specify resource limits and requests for the containers to ensure that w

The following environment variables can be specified to configure this parameter:

```
```bash
GHZ_CPU_LIMITS
GHZ_CPU_REQUESTS
GHZ_MEMORY_LIMITS
Expand All @@ -80,14 +80,14 @@ More information regarding resource limits and requests can be found in the foll

## Notes
Kangal overrides the following options:
* The output format is always set to html
* Output directory is always set to `/results`
* This is done so Kangal is able to pick up the results and persist the results.
* Because they are set as container arguments, this cannot be overridden with the configuration file.

- The output format is always set to html
- Output directory is always set to `/results`
- This is done so Kangal is able to pick up the results and persist the results
- Because they are set as container arguments, this cannot be overridden with the configuration file

[`ghz`]: https://ghz.sh/
[ghz params]: https://ghz.sh/docs/options
[ghz protoset-example]: https://ghz.sh/docs/options#--protoset
[kangal-ghz]: https://github.com/hellofresh/kangal-ghz
[dockerhub]: hub.docker.com/r/hellofresh/kangal-ghz/
[dockerhub]: https://hub.docker.com/r/hellofresh/kangal-ghz/
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Kangal can be easily extended by adding different load generators as backends.
1. Create a docker image that must contain an executable of a new load generator and all required scripts to run it. Docker image should exit once load test is finished and it should provide logs to stdout which will be used by Kangal Proxy.

2. Create a new backend resource definition in Kangal source code:

- [main.go](/main.go)
- [pkg/backends/](/pkg/backends)
- [charts/kangal/crds/loadtest.yaml](/charts/kangal/crds/loadtest.yaml#L43)
Expand Down Expand Up @@ -102,7 +103,7 @@ or just use:
make apply-crd
```

### 3 Get project dependencies
### 3. Get project dependencies

```bash
go mod vendor
Expand Down
2 changes: 1 addition & 1 deletion docs/jmeter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

JMeter is one of the load generators used in Kangal. A powerful tool which can be used for different performance testing tasks.

Currently Kangal uses the docker image [hellofresh/kangal-jmeter](https://github.com/hellofresh/kangal-jmeter) based on JMeter v5.0 r1840935.
Currently Kangal uses the docker image [hellofresh/kangal-jmeter](https://github.com/hellofresh/kangal-jmeter) based on JMeter v5.4.1.

Apache JMeter features include ability to create and run performance test for different applications/server/protocol types:

Expand Down
2 changes: 1 addition & 1 deletion docs/jmeter/reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ InfluxDB installed in your cluster is required to enable this functionality.
> Note: InfluxDB is not the part of Kangal, read more about it in [InfluxDB official documentation](https://github.com/influxdata/influxdb).
You can use InfluxDB as a datasource for Grafana and create a set of useful graphs.
![grafana_example dmg](images/grafana_example.png) { height=500 }
![grafana_example dmg](images/grafana_example.png){ height=500 }

## Static report
JMeter also offers a functionality to generate HTML report dashboards after the end of the test. Read more about it [in official JMeter documentation](https://jmeter.apache.org/usermanual/generating-dashboard.html).
Expand Down
7 changes: 6 additions & 1 deletion docs/jmeter/writing-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ Test Plan element is the root of the test. Inside it you can find all the nested
The first important element in the configuration is a **Throughput Shaping Timer**. More information about this element can be found in the [official docs](https://jmeter-plugins.org/wiki/ThroughputShapingTimer/?utm_source=jmeter&utm_medium=helplink&utm_campaign=ThroughputShapingTimer)

Values to manipulate:

- Start RPS
- End RPS
- Duration
Expand All @@ -196,6 +197,7 @@ Values to manipulate:
Second required element is **Concurrency Thread Group**. A [Thread Group](https://jmeter-plugins.org/wiki/ConcurrencyThreadGroup/) basically is a pool of virtual users that will execute a particular test case against your server. In our case - every thread will make a particular call to exact endpoint specified in HTTP request element.

Values to manipulate:

- Start Threads Count
- Startup Time

Expand All @@ -211,6 +213,7 @@ In this example we advise to use thread count growing up to 20 threads during th
Next important element is [HTTP request](https://jmeter.apache.org/usermanual/component_reference.html#HTTP_Request_Defaults) itself.

Values to manipulate:

- Protocol (http/https)
- Server name or IP (e.g. 127.0.0.1)
- Method (e.g. GET)
Expand All @@ -225,7 +228,8 @@ For some requests may be necessary to specify some headers. You can do it with H
To send the metrics to JMeter Grafana dashboard we use [Backend Listener](https://jmeter.apache.org/usermanual/component_reference.html#Backend_Listener) element.

Values to manipulate:
- backend listener implementation (in out case it's **org.apache.jmeter.visualizers.backend.influxdb.HttpMetricsSender**)

- backend listener implementation (in our case it's **org.apache.jmeter.visualizers.backend.influxdb.HttpMetricsSender**)
- InfluxDB URL
- application

Expand Down Expand Up @@ -357,6 +361,7 @@ There is not much difference between constant and linear load tests. You can sim
With [thread group](https://jmeter.apache.org/usermanual/component_reference.html#Thread_Group) element you can define the duration of your test and a constant number of threads to perform the calls. JMeter runs the thread group until either the number of loops is reached or the duration/end-time is reached - whichever occurs first.

Values to manipulate:

- Number of Threads
- Ramp-Up Period
- Loop Count
Expand Down
4 changes: 3 additions & 1 deletion docs/locust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Let's break it down the parameters:
- `targetURL` is the host to be prefixed on all relative URLs in the locustfile

> Note: If you don't specify `duration`, your tests will run infinitely.
<!-- comment -->
> Note: If you don't specify `targetURL`, be sure to use absolute URLs on your locustfile or your tests will fail.
Expand Down Expand Up @@ -79,7 +80,7 @@ You can specify resource limits and requests for Locust master and worker contai

The following environment variables can be specified to configure this parameter:

```
```bash
LOCUST_MASTER_CPU_LIMITS
LOCUST_MASTER_CPU_REQUESTS
LOCUST_MASTER_MEMORY_LIMITS
Expand All @@ -93,6 +94,7 @@ LOCUST_WORKER_MEMORY_REQUESTS
You have to specify these variables on Kangal Controller, read more at [charts/kangal/README.md](/charts/kangal/README.md#kangal-controller-locust-specific).

More information regarding resource limits and requests can be found in the following page(s):

- https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
- https://cloud.google.com/blog/products/gcp/kubernetes-best-practices-resource-requests-and-limits

Expand Down
22 changes: 10 additions & 12 deletions docs/user-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ We expect users to communicate with Kangal by only using API, which is provided
Here is an example of requests users can send to Kangal API to manage their load test.

## Create
## Create
Create a new load test by making a POST request to Kangal Proxy.

> **Note**: The sample CURL commands below use example test files, those files can be found in [Kangal repository](https://github.com/hellofresh/kangal/).
Expand Down Expand Up @@ -64,26 +64,24 @@ curl -X POST http://${KANGAL_PROXY_ADDRESS}/load-test \
-F masterImage=hellofresh/kangal-jmeter-master:5.4.1 \
-F workerImage=hellofresh/kangal-jmeter-worker:5.4.1
```
**Note: ** For locust only master image will be taken into account!!
**Note:** For locust only master image will be taken into account!!



## Check
## Check
Check the status of the load test.

```
```bash
curl -X GET \
http://${KANGAL_PROXY_ADDRESS}/load-test/loadtest-name
```

## Live monitoring
Get logs and monitor your tests. 
Get logs and monitor your tests.
For the logs of the main load generator process use the following command:
```
```bash
curl -X GET http://${KANGAL_PROXY_ADDRESS}/load-test/loadtest-name/logs
```
### Advanced logs monitoring
For the logs of the worker pod use the index number of the worker.
For the logs of the worker pod use the index number of the worker.
Index numbers are `0`, `1`, etc, according to the number of workers you created.
```bash
curl -X GET http://${KANGAL_PROXY_ADDRESS}/load-test/loadtest-name/logs/0
Expand All @@ -93,17 +91,17 @@ You can also monitor the behavior of your service with your custom tools e.g. Gr

Example of monitoring for JMeter is described at [docs/jmeter/reporting.md](jmeter/reporting.md).

## Get static report.
## Get static report
When the test is finished successfully the backend will save the report.

The report for a particular test can be found by the link `https://${KANGAL_PROXY_ADDRESS}/load-test/loadtest-name/report/`.

> Report persistence depends on the backend implementation.
## Delete
## Delete
Delete your finished load test.

```
```bash
curl -X DELETE http://${KANGAL_PROXY_ADDRESS}/load-test/loadtest-name
```

Expand Down

0 comments on commit 0f73559

Please sign in to comment.