Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anasoid/jmeter-as-code
Jmeter as code is the easy way to write jmeter test as code.
https://github.com/anasoid/jmeter-as-code
code dsl java jmeter jmx performance performance-testing
Last synced: about 2 months ago
JSON representation
Jmeter as code is the easy way to write jmeter test as code.
- Host: GitHub
- URL: https://github.com/anasoid/jmeter-as-code
- Owner: anasoid
- License: apache-2.0
- Created: 2020-09-15T12:26:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-09T09:15:57.000Z (9 months ago)
- Last Synced: 2024-04-09T10:32:43.197Z (9 months ago)
- Topics: code, dsl, java, jmeter, jmx, performance, performance-testing
- Language: Java
- Homepage:
- Size: 1.83 MB
- Stars: 30
- Watchers: 6
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-jmeter - jmeter-as-code - Simple wrapper for JMeter to write and execute JMeter tests with Java. (Automation / DSL)
README
# Write Jmeter tests as code.
An API that give access to full Jmeter feature as code, All designed object in GUI can be written as code.
![Build & Test](https://github.com/anasoid/jmeter-as-code/actions/workflows/main.yml/badge.svg)
![Audit](https://github.com/anasoid/jmeter-as-code/actions/workflows/audit.yml/badge.svg)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=anasoid_jmeter-as-code&metric=coverage)](https://sonarcloud.io/dashboard?id=anasoid_jmeter-as-code)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=anasoid_jmeter-as-code&metric=ncloc)](https://sonarcloud.io/dashboard?id=anasoid_jmeter-as-code)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=anasoid_jmeter-as-code&metric=security_rating)](https://sonarcloud.io/dashboard?id=anasoid_jmeter-as-code)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=anasoid_jmeter-as-code&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=anasoid_jmeter-as-code)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=anasoid_jmeter-as-code&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=anasoid_jmeter-as-code)![Maven Central](https://img.shields.io/maven-central/v/org.anasoid.jmc/jmc-core)
[![javadoc](https://javadoc.io/badge2/org.anasoid.jmc/jmc-core/javadoc.svg)](https://javadoc.io/doc/org.anasoid.jmc/jmc-core)## Where to start
If you are new with **Jmeter as code**, try [examples project](https://github.com/anasoid/jmc-examples) and see [documentation website](https://jmc.anasoid.org).
###### A basic script example:
````java
TestPlanWrapper testPlan = TestPlanWrapper.builder()
.addThread(ThreadGroupWrapper.builder()
.addSampler(
HTTPSamplerProxyWrapper.builder()
.withName("Home")
.withDomain("https://github.com")
.withProtocol("https")
.withPath("/anasoid")
.build())
.build())
.build();
ApplicationTest applicationTest = new ApplicationTest(testPlanWrapper);
applicationTest.run();
//OR
applicationTest.toJmx(new File("mytest.jmx"));
````###### A basic script example using template:
````java
TestPlanWrapper testPlan = TestPlanWrapper.builder()
.addThread(ThreadGroupWrapper.builder()
.addSampler(new HomePage())
.build())
.build();ApplicationTest applicationTest = new ApplicationTest(testPlanWrapper);
applicationTest.run();
//OR
applicationTest.toJmx(new File("mytest.jmx"));
class HomePage extends
AbstractJmcTemplate> {@Override
protected void prepareBuilder(HTTPSamplerProxyWrapperBuilder, ?> builder) {
super.prepareBuilder(builder);
builder.withName("Home")
.withDomain("https://github.com")
.withProtocol("https")
.withPath("/anasoid");
}@Override
protected JmcWrapperBuilder> init() {
return HTTPSamplerProxyWrapper.builder();
}
}
````