Skip to content

Commit

Permalink
Merge pull request #6 from delirius325/0.0.2
Browse files Browse the repository at this point in the history
0.0.2
  • Loading branch information
anthonygauthier authored Mar 21, 2019
2 parents 5550a7f + 3c2045a commit 20481fc
Show file tree
Hide file tree
Showing 17 changed files with 794 additions and 81 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Version 0.0.2

* Changed web server to Jetty + JAX-RS (from webbit-server + webbit-rest)
* Modified `/api/threads/` endpoint to retrieve all thread groups and their properties
* Added `GET /api/threads/{name}` endpoint to retrieve information about a specific thread group
* Added `POST /api/threads/{name}` endpoint to modify a specific thread group
* Added error handling for `GET & POST /threads/{name}` returns RESTful error if thread group doesn't exist
* Added `GET /api/test/status` endpoint to retrieve information about the test status (time running, finished, started, etc.)
* Added `GET /api/test/end` endpoint to end the test run
* Added JavaDoc compatible comments to all the classes/methods
* Added `ResultHolder` class which calculates and holds a summary of the test results
* Added `GET /api/test/summary` endpoint to retrieve a results summary of every sample (#1)


Note: All endpoints require the test to be running to be consumed.

## Version 0.0.1

* Temporary API documentation in README
* Exposes certain routes to access thread group values
* Only works with one thread group
* `GET & POST /variables` to modify variables on the fly
* `GET & POST /properties` to modify properties on the fly

5 changes: 5 additions & 0 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Things to know to contribute to the codebase

- To be able to change values while the test is running, we make use of the `LiveChanges.iterationStart()`.
This acts as an "event loop" and allows us to create methods such as `checkForThreadChanges()`, `checkForVariableChanges()`, etc.
- We use static variables to be able to modify values from outside `JMeterContext` and pass them to the event loop.
115 changes: 99 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![patreon](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/bePatron?u=17797269)

## Overview
This plugin, which is still in an early development stage __(v 0.0.1)__, allows the user to communicate with a RESTful API to change JMeter tests to change values such as:
This plugin, which is still in an early development stage __(v 0.0.2)__, allows the user to communicate with a RESTful API to change JMeter tests to change values such as:

* Throughput
* Number of active threads
Expand All @@ -27,26 +27,30 @@ Here are some scenarios where this kind of tool becomes very handy:
- [x] Modify variables
- [x] Get properties
- [x] Modify properties
- [ ] Support for multiple `Thread Group`
- [x] Support for multiple `Thread Group`
- [ ] Support for native distributed load testing
- [ ] Support for distributed load testing through multiple injectors executing the same test
- [ ] Initial documentation of the REST API
- [x] Initial documentation of the REST API
- [x] Restructure code-base so it's easier to read and maintain
- [ ] Generate a Swagger (or some sort of API docs)
- [ ] Publish version __1.0.0__ to [JMeter-Plugins](https://jmeter-plugins.org/)

## Known issues/limitations

As of right now, I am aware of a few limitations;

* Of course, everything that's not checked on the roadmap is not working.
* The live changes plugin currently only works with one Thread Group. There seems to be issues when more than one thread groups are involved in a test plan.
### Issues
* Everything that's not checked on the roadmap is not working.
* The `GET /api/threads AND /api/threads/{name}` endpoint seem to be returning 0 active threads (will be fixed in 0.0.3)

### Limitations
* The `Live Changes Config` __must__ be declared at the root of your `Test Plan`
## Setup

1. Download the latest JAR from the release section
2. Move the file to your `JMETER_HOME/lib/ext` folder
3. Start JMeter, load your test plan
4. Add the `Live Changes Config` element to your Thread Group
4. Add the `Live Changes Config` element to the root of your test plan
5. Set the port you want to be able to communicate with (defaults to `7566`)
6. Start your test
7. By using any HTTP client (Postman, Insomnia, cURL, etc.) communicate with the REST API to change your test's values
Expand All @@ -55,13 +59,13 @@ As of right now, I am aware of a few limitations;

## Temporary API Doc

`GET /variables`: Retrieves the variables declared for your test
`GET /api/variables`: Retrieves the variables declared for your test

---

`POST /variables`: Send (as JSON) your variables changes.
`POST /api/variables`: Send (as JSON) your variables changes.

Example:
__Request__ example:
```json
{
"myInt": 1,
Expand All @@ -71,28 +75,33 @@ Example:

---

`GET /threads`: Retrieves the number of active threads.
`GET /api/threads`: Retrieves information about all thread groups

---
`GET /api/threads/{name}`: Retrieves information about a specific thread group

`POST /threads`: Send (as JSON) your new active threads number.
---

`POST /api/threads/{name}`: Send data (as JSON) to modify a specific thread group values.

Example:
__Request__ example:
```json
{
"threadNum": 5
"threadNum": 5,
"delay": 0
// etc.
}
```

---

`GET /properties`: Retrieves the properties declared for your test
`GET /api/properties`: Retrieves the properties declared for your test

---

`POST /properties`: Send (as JSON) your properties changes.
`POST /api/properties`: Send (as JSON) your properties changes.

Example:
__Request__ example:
```json
{
"myProp": "bar"
Expand All @@ -101,6 +110,80 @@ Example:

---

`GET /api/test/status`: Retrieves basic info about the test

__Response__ example :
```json
{
"startTime": 0,
"runningTime": 0,
"totalActiveThreads": 0,
"totalThreads": 0
}
```

---
`GET /api/test/end`: Ends the test run

__Response__ example :
```json
{
"info": "success",
"description": "Threads will gracefully stop."
}
```

---
`GET /api/test/summary`: Retrieves a summary of the test results for every sampler

__Response__ example :
```json
[
{
"testSample": {
"averageLatency": 75,
"averageResponseTime": 797,
"minResponseTime": 0,
"maxResponseTime": 417,
"hitsPerSecond": 3,
"sentBytesPerSecond": 0,
"totalErrors": 0,
"errorPercentage": 0,
"receivedBytesPerSecond": 352,
"timeRunning": 4055,
"90thPercentile": 349,
"totalSamples": 12,
"totalBytes": 1368,
"averageBytes": 114,
"totalSentBytes": 0,
"standardDeviation": -554
}
},
{
"testSample - 2": {
"averageLatency": 98,
"averageResponseTime": 955,
"minResponseTime": 0,
"maxResponseTime": 450,
"hitsPerSecond": 3,
"sentBytesPerSecond": 0,
"totalErrors": 0,
"errorPercentage": 0,
"receivedBytesPerSecond": 369,
"timeRunning": 4055,
"90thPercentile": 393,
"totalSamples": 13,
"totalBytes": 1482,
"averageBytes": 114,
"totalSentBytes": 0,
"standardDeviation": -708
}
}
]
```

---




Expand Down
Loading

0 comments on commit 20481fc

Please sign in to comment.