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

TroubleMaker Client Starter

Лицензия

Лицензия

Категории

Категории

Spring Boot Контейнер Микросервисы KeY Данные Data Formats Formal Verification
Группа

Группа

com.keyholesoftware
Идентификатор

Идентификатор

khs-spring-boot-troublemaker-starter
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

TroubleMaker Client Starter
Ссылка на сайт

Ссылка на сайт

http://keyholesoftware.com
Организация-разработчик

Организация-разработчик

Keyhole Software
Система контроля версий

Система контроля версий

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

Скачать khs-spring-boot-troublemaker-starter

Как подключить последнюю версию

<!-- 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"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.springframework.boot : spring-boot-starter-web jar
org.springframework.boot : spring-boot-configuration-processor Необязательный jar

Модули Проекта

Данный проект не имеет модулей.

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.

Версии библиотеки

Версия
1.0.0