com.keyholesoftware:khs-spring-boot-troublemaker-starter

TroubleMaker Client Starter

License

License

Categories

Categories

Spring Boot Container Microservices KeY Data Data Formats Formal Verification
GroupId

GroupId

com.keyholesoftware
ArtifactId

ArtifactId

khs-spring-boot-troublemaker-starter
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

TroubleMaker Client Starter
Project URL

Project URL

http://keyholesoftware.com
Project Organization

Project Organization

Keyhole Software
Source Code Management

Source Code Management

https://github.com/in-the-keyhole/khs-spring-boot-troublemaker-starter

Download khs-spring-boot-troublemaker-starter

How to add to project

<!-- https://jarcasting.com/artifacts/com.keyholesoftware/khs-spring-boot-troublemaker-starter/ -->
<dependency>
    <groupId>com.keyholesoftware</groupId>
    <artifactId>khs-spring-boot-troublemaker-starter</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.keyholesoftware/khs-spring-boot-troublemaker-starter/
implementation 'com.keyholesoftware:khs-spring-boot-troublemaker-starter:1.0.0'
// https://jarcasting.com/artifacts/com.keyholesoftware/khs-spring-boot-troublemaker-starter/
implementation ("com.keyholesoftware:khs-spring-boot-troublemaker-starter:1.0.0")
'com.keyholesoftware:khs-spring-boot-troublemaker-starter:jar:1.0.0'
<dependency org="com.keyholesoftware" name="khs-spring-boot-troublemaker-starter" rev="1.0.0">
  <artifact name="khs-spring-boot-troublemaker-starter" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.keyholesoftware', module='khs-spring-boot-troublemaker-starter', version='1.0.0')
)
libraryDependencies += "com.keyholesoftware" % "khs-spring-boot-troublemaker-starter" % "1.0.0"
[com.keyholesoftware/khs-spring-boot-troublemaker-starter "1.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-web jar
org.springframework.boot : spring-boot-configuration-processor Optional jar

Project Modules

There are no modules declared in this project.

khs-spring-boot-troublemaker-starter

A Spring Boot starter for auto-configuration of the TroubleMaker Client.

This auto-configuration can be used to configure clients of the Trouble Maker framework used to randomly produce server trouble issues.

##Quick Links Trouble Maker Client

Trouble Maker Spring Boot Starter

Trouble Maker Website

Installation

Add this dependency to your pom.xml:

<dependency>
	<groupId>com.keyholesoftware</groupId>
	<artifactId>khs-spring-boot-troublemaker-starter</artifactId>
	<version>1.0.0</version>
</dependency>	

Annotate your Spring Boot main class:

@SpringBootApplication
@EnableTroubleMaker
public class MySpringBootApp {

	public static void main(String[] args) {
		SpringApplication.run(MySpringBootApp.class, args);
	}
}

Configure an access token:

using properties:

troublemaker.client.token=abc123

or yaml:

troublemaker:
	client:
		token: abc123

Actions

By default, Trouble Maker actions will be performed by calling the following APIs. A matching access token is required to be provided in the token request header. The Trouble Maker dashboard will invoke these APIs.

http://<server>/trouble/kill - Kills the service with a System.exit() command.

http://<server>/trouble/memory - Executes a thread that fills up heap memory and keeps it there for the timeout period.

http://<server>/trouble/load - Spawns specified number of threads the block for the the timeout period.

http://<server>/trouble/exception - Throws an exception to validate exception handling behavior of a service.

Defining Custom Actions Code Blocks

If you want to apply your own trouble actions and override the supplied defaults, you can create a class that extends from this supplied abstract class, as shown below.

package com.mycode;

public class MyKillCodeBlock extends BaseCodeBlock {	

	public KillBlock() {
  		super();
	}

	@Override
	public void eval() {
		// Do stuff to kill this process...like..
		System.exit(-1)
	}	
}

Then you will need to register the custom block. The example below shows how a custom load action is registered:

using properties:

troublemaker.client.kill=com.mycode.MyKillCodeBlock

or yaml:

troublemaker:
	client:
		kill: com.mycode.MyKillCodeBlock

The complete list of operation names that can be overridden are:

  • kill
  • load
  • memory
  • exception
com.keyholesoftware

Keyhole Software

Software dev team providing consulting, development & education services with Java, JavaScript & .NET technologies.

Versions

Version
1.0.0