Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/perfana/test-events-springboot
Fire test events for springboot. Talks to actuator metrics and actions.
https://github.com/perfana/test-events-springboot
Last synced: 17 days ago
JSON representation
Fire test events for springboot. Talks to actuator metrics and actions.
- Host: GitHub
- URL: https://github.com/perfana/test-events-springboot
- Owner: perfana
- License: apache-2.0
- Created: 2022-01-27T15:46:41.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-15T12:26:33.000Z (8 months ago)
- Last Synced: 2024-11-09T04:15:19.644Z (2 months ago)
- Language: Java
- Size: 95.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# test-events-springboot
Fire test events for Spring Boot. Talks to actuator metrics and actions.## Actuator client
There is an
actuator client that calls an actuator/env endpoint and turns properties
into variables in an event-scheduler message. The variables in a message
are picked up by the perfana-java-client and are sent to Perfana for the
current test run.* `tags` comma separated list of tags send along with the properties
* `actuatorBaseUrl` the base url for the actuator endpoint, `/env` will be added
* `actuatorEnvProperties` comma seperated list of actuator env properties to turn into variables
* `actuatorPropPrefix` (DEPRECATED, use tags instead) prefix for the properties to send as variablesTip: check your http://application/actuator/env to see what is available.
Note: env needs to be enabled in actuator. Be careful though to not expose this endpoint on the internet!
```xml
ActuatorEvent
my-app
http://my-app:8080/actuator
java.runtime.version,JDK_JAVA_OPTIONS```
## Events
This events plugin reacts to the following custom events:
* `heapdump` - calls actuator heap dump endpoint and saves it to `dumpPath` (defaults to `java.io.tmpdir`)
* `threaddump` - calls actuator thread dump endpoint and saves it to `dumpPath` (defaults to `java.io.tmpdir`)In the example below, there are two heap dump requests (5 and 60 seconds into the test run) and two stack dump requests (10 and 15 seconds into the test run).
The names of the dumps include the test run id and a time stamp.
In the test start event, it collects settings from actuator env endpoint, and broadcasts this to
other plugins. For instance, if you use the Perfana Java client plugin as well, this information
is automatically send to Perfana. The values are then stored with the current test run.## Example config
Use one of the Perfana maven plugins (`event-scheduler-maven-plugin`, `events-gatling-maven-plugin`, `events-jmeter-maven-plugin`, ...) and hook-up this `test-events-springboot` via a sub-dependency:
```xml
io.perfana
event-scheduler-maven-plugin
true
true
true
true
PT5S|heapdump
PT10S|threaddump
PT15S|threaddump
PT1M|heapdump
${systemUnderTest}
${version}
${workload}
${testEnvironment}
${testRunId}
${buildResultsUrl}
${rampupTimeInSeconds}
${constantLoadTimeInSeconds}
${annotations}
${tags}
SpringBootEventFrontend
optimus-prime-fe,beta
http://optimus-prime-fe:8080/actuator
java.runtime.version,JDK_JAVA_OPTIONS,afterburner.async_core_pool_size
/test-data/dump-files/fontend/
SpringBootEventBackend
optimus-prime-be,beta
http://optimus-prime-be:8080/actuator
java.runtime.version,JDK_JAVA_OPTIONS,afterburner.async_core_pool_size
/test-data/dump-files/backend/
io.perfana
test-events-springboot
${test-events-springboot.version}
io.perfana
perfana-java-client
${perfana-java-client.version}
```
See also:
* https://github.com/perfana/event-scheduler-maven-plugin
* https://github.com/perfana/events-jmeter-maven-plugin
* https://github.com/perfana/events-gatling-maven-plugin
* https://github.com/perfana/event-scheduler
* https://github.com/perfana/perfana-java-client