Skip to content

Commit 4729191

Browse files
committed
chore: merge gatling documentation
1 parent b8cce71 commit 4729191

File tree

540 files changed

+35879
-61
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

540 files changed

+35879
-61
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/.hugo_build.lock
2-
/content
32
/node_modules
43
/public
54
/resources

bin/entrypoint.sh

-56
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ fi
4343
clean() {
4444
echo "=====> cleaning phase"
4545
rm -Rf \
46-
./content/* \
4746
./package.json \
4847
./package-lock.json \
4948
./go.sum \
@@ -52,57 +51,6 @@ clean() {
5251
./resources
5352
}
5453

55-
merge_and_delete_temp() {
56-
local temp_path="$1"
57-
local merge_path="$2"
58-
59-
if [[ -f "$merge_path" ]]; then
60-
yq ea --front-matter=process "select(di == 0) | select(fi == 0) * select(fi == 1)" "$merge_path" "$temp_path" > tmpfile && \
61-
mv tmpfile "$merge_path"
62-
else
63-
cp "$temp_path" "$merge_path"
64-
fi
65-
rm "$temp_path"
66-
}
67-
68-
fetch_doc() {
69-
local repository="$1"
70-
local branch="$2"
71-
local remote_dir="$3"
72-
local local_dir="$4"
73-
74-
rm -rf "$local_dir"
75-
mkdir -p "$local_dir"
76-
rm -rf "${MYTMPDIR:?}/$repository"
77-
git clone "https://github.com/gatling/$repository.git" --depth 1 --branch "$branch" "$MYTMPDIR/$repository"
78-
cp -r "$MYTMPDIR/$repository/$remote_dir"/* "$local_dir"
79-
}
80-
81-
add_repository_url() {
82-
local repository="$1"
83-
local branch="$2"
84-
local remote_dir="$3"
85-
local local_dir="$4"
86-
87-
main_index="$local_dir/_index.md"
88-
main_index_tmp=$(mktemp)
89-
90-
# shellcheck disable=SC2016
91-
REPOSITORY="$repository" BRANCH="$branch" REMOTE_DIR="$remote_dir" \
92-
envsubst '${REPOSITORY} ${BRANCH} ${REMOTE_DIR}' < "templates/repository_url.md" > "$main_index_tmp"
93-
merge_and_delete_temp "$main_index_tmp" "$main_index"
94-
}
95-
96-
hugo_structure() {
97-
local repository="$1"
98-
local branch="$2"
99-
local remote_dir="$3"
100-
local local_dir="$4"
101-
102-
fetch_doc "$repository" "$branch" "$remote_dir" "$local_dir"
103-
add_repository_url "$repository" "$branch" "$remote_dir" "$local_dir"
104-
}
105-
10654
install_dependencies() {
10755
# envsubst
10856
apk add gettext
@@ -129,10 +77,6 @@ prepare () {
12977
hugo mod npm pack
13078

13179
npm install
132-
133-
# # repository # branch # remote # local
134-
hugo_structure "gatling" "main" "src/docs/content" "content"
135-
13680
else
13781
echo "=====> skip prepare"
13882
fi
22.7 KB
Loading

content/_index.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: Gatling documentation
3+
description: Documentation for the Gatling and Gatling Enterprise load testing tools.
4+
date: 2021-04-20T18:30:56+02:00
5+
lastmod: 2021-04-20T18:30:56+02:00
6+
cascade:
7+
docsRepo: https://github.com/gatling/gatling.io-doc/blob/main/src/docs/content
8+
ordering:
9+
- tutorials
10+
- reference
11+
- guides
12+
- release-notes
13+
- project
14+
---
15+
16+
Gatling is a highly capable load testing tool.
17+
It is designed for ease of use, maintainability and high performance.
18+
19+
Out of the box, Gatling comes with excellent support of the HTTP protocol that makes it a tool of choice for load testing any HTTP server.
20+
As the core engine is actually protocol agnostic, it is perfectly possible to implement support for other protocols.
21+
For example, Gatling currently also ships JMS support.
22+
23+
The following tutorials will help you get started with Gatling:
24+
25+
- [Create a simulation with Java]({{< ref "tutorials/scripting-intro" >}})
26+
- [Create a simulation with JavaScript]({{< ref "tutorials/scripting-intro-js" >}})
27+
- [Introduction to the Recorder]({{< ref "tutorials/recorder" >}})
28+
- [Writing realistic tests]({{< ref "tutorials/advanced" >}})
29+
30+
Having *scenarios* that are defined in code and are resource efficient are the two requirements that motivated us to create Gatling. Based on an expressive [DSL](http://en.wikipedia.org/wiki/Domain-specific_language), the *scenarios* are self-explanatory. They are easy to maintain and can be kept in a version control system.
31+
32+
Gatling's architecture is asynchronous as long as the underlying protocol, such as HTTP, can be implemented in a non blocking way. This kind of architecture lets us implement virtual users as messages instead of dedicated threads, making them very resource cheap. Thus, running thousands of concurrent virtual users is not an issue.
33+
34+
## Gatling Enterprise
35+
36+
[Gatling Enterprise](https://gatling.io/enterprise/), formerly known as Gatling FrontLine, is a management interface for Gatling, that includes advanced metrics and advanced features for integration and automation.
37+
38+
{{< img src="Gatling-enterprise-logo-RVB.png" alt="Gatling Enterprise" >}}
39+
40+
## Migrating from a Previous Version of Gatling
41+
42+
If you're upgrading from Gatling 2.3 to Gatling 3.0, please check the [dedicated migration guide]({{< ref "/release-notes/upgrading/2.3-to-3.0.md" >}}).
43+
44+
Otherwise, please follow the [previous migration guides]({{< ref "/release-notes/upgrading" >}}).

content/guides/_index.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: Guides
3+
seotitle: Gatling practical guides
4+
description: Detailed and practical advice
5+
lead: Detailed and practical advice
6+
ordering:
7+
- debugging
8+
- passing-parameters
9+
- grouping-feeder
10+
- dynatrace
11+
- aws-secrets-manager
12+
- config-as-code
13+
---
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright 2011-2025 GatlingCorp (https://gatling.io)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
//#aws-secrets-manager
18+
import io.gatling.javaapi.core.*;
19+
20+
import software.amazon.awssdk.regions.Region;
21+
import software.amazon.awssdk.services.secretsmanager.SecretsManagerClient;
22+
import software.amazon.awssdk.services.secretsmanager.model.GetSecretValueRequest;
23+
import software.amazon.awssdk.services.secretsmanager.model.GetSecretValueResponse;
24+
25+
public class AWSSecretsManagerSampleJava extends Simulation {
26+
{
27+
String secretName = "my-secret-name";
28+
Region region = Region.of("{region-name}");
29+
30+
SecretsManagerClient client = SecretsManagerClient.builder().region(region).build();
31+
32+
GetSecretValueRequest getSecretValueRequest = GetSecretValueRequest.builder().secretId(secretName).build();
33+
GetSecretValueResponse getSecretValueResponse;
34+
35+
try {
36+
getSecretValueResponse = client.getSecretValue(getSecretValueRequest);
37+
} catch (Exception e) {
38+
throw new RuntimeException(e);
39+
}
40+
41+
String secret = getSecretValueResponse.secretString();
42+
}
43+
}
44+
//#aws-secrets-manager
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: AWS Secrets Manager
3+
seotitle: Easily Access and Manage AWS Secret Values with Gatling
4+
description: Learn how to retrieve and access your AWS Secrets Manager values directly within your Gatling scripts for improved security and efficiency during load testing.
5+
lead: Integrate AWS Secrets Manager with your Gatling scripts to securely retrieve and manage secret values after the initialization stage of your load generators.
6+
---
7+
8+
## Use Case
9+
10+
Integrating AWS Secrets Manager with Gatling allows secure access and retrieval of secret values directly within your Gatling scripts. This process is performed only once during the spawning of load generators in the initialization block, ensuring your secrets are handled securely before launching your simulation test.
11+
12+
13+
## Prerequisites
14+
15+
- Utilizing Gatling Enterprise's Private Locations feature. For more information, visit: [Gatling Cloud Installation Guide]({{< ref "/reference/install/cloud/private-locations/introduction/" >}})
16+
- Using Gatling SDK with Java 1.x or 2.x.
17+
18+
19+
## Configuration
20+
21+
To enable secure access to AWS Secrets Manager, assign an IAM instance profile to your load generators. This profile should grant access permissions for retrieving and describing secrets as detailed below.
22+
For more information, visit: [Gatling AWS Locations Configuration]({{< ref "reference/install/cloud/private-locations/aws/configuration/" >}}).
23+
24+
```json
25+
{
26+
"Version": "2012-10-17",
27+
"Statement": [
28+
{
29+
"Effect": "Allow",
30+
"Action": [
31+
"secretsmanager:GetSecretValue",
32+
"secretsmanager:DescribeSecret"
33+
],
34+
"Resource": "arn:aws:secretsmanager:{region}:{account-id}:secret:{secret-name}"
35+
}
36+
]
37+
}
38+
```
39+
40+
### Batch Retrieval Permissions
41+
42+
{{< alert info >}}
43+
To retrieve secrets in batches, ensure you have the `secretsmanager:GetSecretValue` permission for each secret. Additionally, the `secretsmanager:BatchGetSecretValue` permission is required.
44+
{{< /alert >}}
45+
46+
### Pass Role Policy
47+
48+
{{< alert tip >}}
49+
Next policy is required to pass the created role as an iam-instance-profile to AWS private location.
50+
51+
IAM Instance Profile on AWS private location allow to assign that role to all load generator instances spawned for that private location.
52+
{{< /alert >}}
53+
54+
`GatlingIAMPolicy` allows the Control Plane to pass an IAM instance profile role to a deployed a load generator on EC2.
55+
```
56+
{
57+
"Version": "2012-10-17",
58+
"Statement": [
59+
{
60+
"Action": [
61+
"iam:PassRole"
62+
],
63+
"Effect": "Allow",
64+
"Resource": [
65+
"arn:aws:iam::{Account}:role/{RoleNameWithPath}"
66+
]
67+
}
68+
]
69+
}
70+
```
71+
{{< alert info >}}
72+
The resources are the Amazon Resource Names (ARN) of the IAM instance-profile roles you configured on some of your private locations.
73+
{{< /alert >}}
74+
75+
## Installation
76+
77+
Install the AWS SDK into your Java project using either Maven or Gradle:
78+
- [AWS SDK Maven Installation Guide](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/setup-project-maven.html)
79+
- [AWS SDK Gradle Installation Guide](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/setup-project-gradle.html)
80+
81+
82+
## Suggested Implementation
83+
84+
Utilize the AWS SDK for Java 2.x to implement the `Get a Secret Value` sample from the AWS Secrets Manager examples. For more detailed examples, visit the [AWS SDK for Java Code Examples](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/java_secrets-manager_code_examples.html).
85+
86+
{{< include-code "aws-secrets-manager" java >}}

0 commit comments

Comments
 (0)