Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/perfana/event-scheduler-maven-plugin
Use plain event-scheduler from maven build.
https://github.com/perfana/event-scheduler-maven-plugin
Last synced: 17 days ago
JSON representation
Use plain event-scheduler from maven build.
- Host: GitHub
- URL: https://github.com/perfana/event-scheduler-maven-plugin
- Owner: perfana
- License: apache-2.0
- Created: 2020-11-08T09:10:24.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-04T07:05:27.000Z (4 months ago)
- Last Synced: 2024-11-09T04:15:19.931Z (2 months ago)
- Language: Java
- Size: 147 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# event-scheduler-maven-plugin
Use plain event-scheduler from maven build to generate events during a load test.
* Fires events according to the schedule.
* Send start session and stop session and waits for given duration.
* In case of failure or kill of process, sends abort session.Run with: `mvn event-scheduler:test`
# Properties
* `debugEnabled` (default: `false`) - Enable debug logging with `true`.
* `schedulerEnabled` (default: `true`) - Disable the scheduler with `false`.
* `failOnError` (default: `true`) - Fail the build on exceptions thrown during waiting for the result.
* `continueOnEventCheckFailure` (default: `false`) - Continue the build then result checks are not successful.
* `scheduleScript` (default: empty) - Schedule events with as described in [custom-events](https://github.com/perfana/event-scheduler#custom-events).
* `slackDurationSeconds` (default: `0`) - Extra time to add after the duration of test has finished.# Proposed Properties
* `ultimateTimeout` - Ultimate time out for the commands, e.g. when using `vetoContinueOnKeepAlive` and a participant fails to send a Stop in reasonable time
* `vetoContinueOnKeepAlive` - only stop the keep-alives of the test when all continue on keep-alive participants have send a Stop event## Example
Example configuration in maven `pom.xml` with `test-events-hello-world` events:
```xml
4.0.0
io.perfana
events-test
1.0-SNAPSHOT
UTF-8
3.0.3
[3.0.0,3.1.0)${BUILD_URL}
60
900Afterburner
1.0
cloud
io.perfana
event-scheduler-maven-plugin
${event-scheduler-maven-plugin.version}
io.perfana
event-scheduler-maven-plugin
true
true
true
false
${systemUnderTest}
${version}
${workload}
${testEnvironment}
${testRunId}
${buildResultsUrl}
${rampupTimeInSeconds}
${constantLoadTimeInSeconds}
${annotations}
${tags}
${eventScheduleScript}
HelloEvent1
https://my-rest-api
${ENV.SECRET}
io.perfana
test-events-hello-world
${test-events-hello-world.version}
short-test
true
shortTest
20
20
${systemUnderTest}-${version}-${workload}-${testEnvironment}
short-test
PT10S|hello-world|name=pp
PT20S|hello-world2|duration=2s
```
This will output:
```
➜ mvn -f src/test/resources/example-pom.xml event-scheduler:test
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< io.perfana:events-test >-----------------------
[INFO] Building events-test 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- event-scheduler-maven-plugin:3.0.3:test (default-cli) @ events-test ---
[INFO] Execute event-scheduler-maven-plugin
[HelloWorldEvent] Class loaded
[INFO] [HelloEvent1] [HelloWorldEvent] Default constructor called.
[INFO] [HelloEvent1] [HelloWorldEvent] Number of processors: 8 cores
[INFO] [HelloEvent1] [HelloWorldEvent] Max memory: 4096 MB
[INFO] [HelloEvent1] [HelloWorldEvent] Total memory: 256 MB
[INFO] [HelloEvent1] [HelloWorldEvent] Free memory: 246 MB
[INFO] [HelloEvent1] [HelloWorldEvent] Message: Default Hello Message
[INFO] start test session
[INFO] broadcast before test event
[INFO] [HelloEvent1] [HelloWorldEvent] Hello before test [Afterburner-1.0-shortTest-cloud]
[INFO] [HelloEvent1] [HelloWorldEvent] Sleep for 2 seconds
[INFO] [HelloEvent1] [HelloWorldEvent] Wakeup after 2 seconds
[INFO] calling keep alive every PT30S
[INFO] create new thread: Keep-Alive-Thread
[INFO] === custom events schedule ===
==> ScheduleEvent (hello-world-PT10S) [fire-at=PT10S settings=name=pp ]
==> ScheduleEvent (hello-world2-PT20S) [fire-at=PT20S settings=duration=2s ]
[INFO] [HelloEvent1] [HelloWorldEvent] Hello keep alive for test [Afterburner-1.0-shortTest-cloud]
[INFO] create new thread: Custom-Event-Thread-1
[INFO] create new thread: Custom-Event-Thread-2
[INFO] event-scheduler-maven-plugin will now wait for PT40S for scheduler to finish.
[INFO] broadcast hello-world custom event
[INFO] [HelloEvent1] [HelloWorldEvent] Custom hello world called:name=pp
[INFO] broadcast hello-world2 custom event
[INFO] [HelloEvent1] [HelloWorldEvent] WARNING: ignoring unknown event [hello-world2]
[INFO] [HelloEvent1] [HelloWorldEvent] Hello keep alive for test [Afterburner-1.0-shortTest-cloud]
[INFO] stop test session.
[INFO] shutdown Executor threads
[INFO] broadcast after test event
[INFO] [HelloEvent1] [HelloWorldEvent] Hello after test [Afterburner-1.0-shortTest-cloud]
[INFO] all broadcasts for stop test session are done
[INFO] check results called
[INFO] broadcast check test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 42.354 s
[INFO] Finished at: 2021-01-08T11:34:05+01:00
[INFO] ------------------------------------------------------------------------
```# test
The `EventSchedulerMojoTest` might fail in an ide with the following error: `org.codehaus.plexus.component.repository.exception.ComponentLookupException: java.util.NoSuchElementException`.
Try to do a `mvn test` from the command line, if that succeeds, it also works from ide.## See also
* https://github.com/perfana/event-scheduler
* https://github.com/perfana/test-events-wiremock
* https://github.com/perfana/test-events-hello-world
* https://github.com/perfana/events-gatling-maven-plugin
* https://github.com/perfana/events-jmeter-maven-plugin