Skip to content

Commit

Permalink
Merge pull request #10 from marcosborges/feat/bzt
Browse files Browse the repository at this point in the history
Feat/bzt
  • Loading branch information
marcosborges authored Nov 4, 2021
2 parents 2adcfde + 9434c21 commit 04f4423
Show file tree
Hide file tree
Showing 21 changed files with 389 additions and 112 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ terraform.tfstate
nome-da-implantacao-keypair
data.csv00*
.terraform.tfstate.lock
*.pem
*.pem
.terraform.lock.hcl
.log
.terraform.tfstate.lock.info
jmeter.log
44 changes: 27 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,20 @@ This module proposes a simple and uncomplicated way to run your load tests creat

![bp](https://raw.githubusercontent.com/marcosborges/terraform-aws-loadtest-distribuited/v0.0.7-alpha/assets/blueprint.png)

---

## Basic usage with Taurus

In its basic use it is necessary to provide information about which network will be used, where are your test plan scripts and finally define the number of nodes needed to carry out the desired load.
## Basic usage with JMeter

```hcl
module "loadtest" {
source = "marcosborges/loadtest-distribuited/aws"
version = "0.0.4-alpha"
version = "1.0.0"
name = "nome-da-implantacao"
executor = "bzt"
loadtest_dir_source = "./load-test-plan"
loadtest_entrypoint = "bzt -q -o execution.0.distributed=\"{NODES_IPS}\" *.yml"
nodes_size = 3
executor = "jmeter"
loadtest_dir_source = "./assets"
loadtest_entrypoint = "jmeter -n -t -R \"{NODES_IPS}\" *.jmx"
nodes_size = 2
subnet_id = data.aws_subnet.current.id
}
Expand All @@ -34,21 +31,30 @@ data "aws_subnet" "current" {
}
```

![bp](https://github.com/marcosborges/terraform-aws-loadtest-distribuited/raw/master/assets/example-basic.png)


![bp](https://github.com/marcosborges/terraform-aws-loadtest-distribuited/raw/master/assets/jmeter-dashboard.png)



---

## Basic usage with JMeter
## Basic usage with Taurus

In its basic use it is necessary to provide information about which network will be used, where are your test plan scripts and finally define the number of nodes needed to carry out the desired load.

```hcl
module "loadtest" {
source = "marcosborges/loadtest-distribuited/aws"
version = "0.0.4-alpha"
version = "1.0.0"
name = "nome-da-implantacao"
executor = "jmeter"
loadtest_dir_source = "./assets"
loadtest_entrypoint = "jmeter -n -t -R \"{NODES_IPS}\" *.jmx"
nodes_size = 3
executor = "bzt"
loadtest_dir_source = "./load-test-plan"
loadtest_entrypoint = "bzt -q -o execution.0.distributed=\"{NODES_IPS}\" *.yml"
nodes_size = 2
subnet_id = data.aws_subnet.current.id
}
Expand All @@ -61,9 +67,9 @@ data "aws_subnet" "current" {
}
```


---


## Advanced Config:

The module also provides advanced settings.
Expand All @@ -81,7 +87,7 @@ The module also provides advanced settings.
module "loadtest" {
source = "marcosborges/loadtest-distribuited/aws"
version = "0.0.3-alpha"
version = "1.0.0"
subnet_id = data.aws_subnet.current.id
Expand Down Expand Up @@ -178,6 +184,10 @@ data "aws_ami" "my_image" {
---


## Defaults

**Instance type:** https://aws.amazon.com/pt/ec2/instance-types/c5/



## Examples with another executors
Expand Down
Binary file added assets/example-basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/jmeter-dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions examples/basic/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions examples/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@ module "loadtest-distribuited" {
}
```


![bp](https://github.com/marcosborges/terraform-aws-loadtest-distribuited/raw/master/assets/example-basic.png)


![bp](https://github.com/marcosborges/terraform-aws-loadtest-distribuited/raw/master/assets/jmeter-dashboard.png)


---
9 changes: 4 additions & 5 deletions examples/basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ module "loadtest" {

source = "../../"
#source = "marcosborges/loadtest-distribuited/aws"
#version = "0.0.8-alpha"
#version = "1.0.0"

name = "nome-da-implantacao"
executor = "jmeter"
executor = var.executor #"jmeter"
loadtest_dir_source = "../plan/"
nodes_size = 2

loadtest_entrypoint = "jmeter -n -t jmeter/*.jmx -R \"{NODES_IPS}\" -l /var/logs/loadtest -e -o /var/www/html -Dnashorn.args=--no-deprecation-warning -Dserver.rmi.ssl.disable=true "
loadtest_entrypoint = "jmeter -n -t jmeter/*.jmx -R \"{NODES_IPS}\" -l /loadtest/logs -e -o /var/www/html/jmeter -Dnashorn.args=--no-deprecation-warning -Dserver.rmi.ssl.disable=true "

ssh_export_pem = true
subnet_id = data.aws_subnet.current.id
}

}
5 changes: 5 additions & 0 deletions examples/basic/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@ output "nodes_public_ip" {
output "nodes_private_ip" {
value = module.loadtest.nodes_private_ip
description = "The private IP address of the nodes instances."
}

output "dashboard_url" {
value = "http://${coalesce(module.loadtest.leader_public_ip, module.loadtest.leader_private_ip)}/${var.executor}"
description = "The URL of the loadtest dashboard."
}
4 changes: 4 additions & 0 deletions examples/basic/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
variable "executor" {
description = "Executor name"
default = "jmeter"
}
25 changes: 16 additions & 9 deletions examples/isolated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,29 @@ In its basic use it is necessary to provide information about which network will

```hcl
module "loadtest" {
source = "../../"
#source = "marcosborges/loadtest-distribuited/aws"
#version = "1.0.0"
name = "nome-da-implantacao"
executor = "jmeter"
loadtest_dir_source = "../plan"
loadtest_entrypoint = "bzt -q -o execution.0.distributed=\"{NODES_IPS}\" *.yml"
nodes_size = 3
subnet_id = data.aws_subnet.current.id
nodes_size = 2
loadtest_entrypoint = "jmeter -n -t jmeter/*.jmx -R \"{NODES_IPS}\" -l /loadtest/logs -e -o /var/www/html/jmeter -Dnashorn.args=--no-deprecation-warning -Dserver.rmi.ssl.disable=true"
subnet_id = module.vpc.private_subnets[0].id
}
data "aws_subnet" "current" {
filter {
name = "tag:Name"
values = ["subnet-prd-a"]
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
name = "my-vpc"
cidr = "10.0.0.0/16"
azs = ["us-east-1a"]
private_subnets = ["10.0.1.0/24"]
enable_nat_gateway = true
enable_vpn_gateway = true
tags = {
Terraform = "true"
Environment = "load-test"
}
}
```
Expand Down
16 changes: 4 additions & 12 deletions examples/isolated/main.tf
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
module "loadtest" {

source = "../../"

#source = "marcosborges/loadtest-distribuited/aws"
#version = "1.0.0"
name = "nome-da-implantacao"
executor = "jmeter"
executor = var.executor
loadtest_dir_source = "../plan"
nodes_size = 2

#loadtest_entrypoint = "bzt -q -o execution.0.distributed=\"{NODES_IPS}\" *.yml"
loadtest_entrypoint = "jmeter -n -t *.jmx -R \"{NODES_IPS}\" -l ./logs -e -o ./results -Dserver.rmi.localport=50000 -Dserver_port=1099 -Dserver.rmi.ssl.disable=true -Djava.rmi.server.hostname=$PRIVATE_IP"
#loadtest_entrypoint = "jmeter -n -t *.jmx -R \"{NODES_IPS}\" -l ./logs -e -o ./results "

ssh_export_pem = true

loadtest_entrypoint = "jmeter -n -t jmeter/*.jmx -R \"{NODES_IPS}\" -l /loadtest/logs -e -o /var/www/html/jmeter -Dnashorn.args=--no-deprecation-warning -Dserver.rmi.ssl.disable=true"
subnet_id = module.vpc.private_subnets[0].id

}


module "vpc" {
source = "terraform-aws-modules/vpc/aws"
name = "my-vpc"
Expand Down
5 changes: 5 additions & 0 deletions examples/isolated/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@ output "nodes_public_ip" {
output "nodes_private_ip" {
value = module.loadtest.nodes_private_ip
description = "The private IP address of the nodes instances."
}

output "dashboard_url" {
value = "http://${coalesce(module.loadtest.leader_public_ip, module.loadtest.leader_private_ip)}/${var.executor}"
description = "The URL of the loadtest dashboard."
}
4 changes: 4 additions & 0 deletions examples/isolated/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
variable "executor" {
description = "Executor name"
default = "jmeter"
}
43 changes: 25 additions & 18 deletions examples/plan/jmeter/basic.jmx
Original file line number Diff line number Diff line change
Expand Up @@ -16,71 +16,78 @@
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<intProp name="LoopController.loops">-1</intProp>
<stringProp name="LoopController.loops">1</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">10</stringProp>
<stringProp name="ThreadGroup.num_threads">20</stringProp>
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
<boolProp name="ThreadGroup.scheduler">true</boolProp>
<stringProp name="ThreadGroup.duration">30</stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
<stringProp name="ThreadGroup.delay">5</stringProp>
<boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
<boolProp name="ThreadGroup.delayedStart">true</boolProp>
</ThreadGroup>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Google" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">google.com</stringProp>
<stringProp name="HTTPSampler.port"></stringProp>
<stringProp name="HTTPSampler.port">443</stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path"></stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
<boolProp name="HTTPSampler.auto_redirects">true</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<boolProp name="HTTPSampler.BROWSER_COMPATIBLE_MULTIPART">true</boolProp>
<boolProp name="HTTPSampler.image_parser">true</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.connect_timeout">1000</stringProp>
<stringProp name="HTTPSampler.response_timeout">6000</stringProp>
</HTTPSamplerProxy>
<hashTree/>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Microsoft" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">microsoft.com</stringProp>
<stringProp name="HTTPSampler.port"></stringProp>
<stringProp name="HTTPSampler.port">443</stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path"></stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
<boolProp name="HTTPSampler.auto_redirects">true</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<boolProp name="HTTPSampler.BROWSER_COMPATIBLE_MULTIPART">true</boolProp>
<boolProp name="HTTPSampler.image_parser">true</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.connect_timeout">1000</stringProp>
<stringProp name="HTTPSampler.response_timeout">6000</stringProp>
</HTTPSamplerProxy>
<hashTree/>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Facebook" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">facebook.com</stringProp>
<stringProp name="HTTPSampler.port"></stringProp>
<stringProp name="HTTPSampler.port">443</stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path"></stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
<boolProp name="HTTPSampler.auto_redirects">true</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<boolProp name="HTTPSampler.BROWSER_COMPATIBLE_MULTIPART">true</boolProp>
<boolProp name="HTTPSampler.image_parser">true</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.connect_timeout">1000</stringProp>
<stringProp name="HTTPSampler.response_timeout">6000</stringProp>
</HTTPSamplerProxy>
<hashTree/>
</hashTree>
Expand Down
Loading

0 comments on commit 04f4423

Please sign in to comment.