cpu

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CController

type CController struct {
	// contains filtered or unexported fields
}

func NewCPUController

func NewCPUController(
	jobs map[string]*config.Job,
	connections *network.Connections,
	cache *cache.Manager,
	logger log.Logger,
) *CController

func (*CController) CPUAction

func (c *CController) CPUAction(w http.ResponseWriter, r *http.Request)

CalcExample godoc @Summary Inject CPU failures @Description Perform CPU spike injection. Provide a percentage that is proportionate to your logical CPUs. E.g. With 4 logical CPUs if you want to inject 40% CPU failure we calculate that as ( numCpu * percentage / 100 ) so we will block 1 CPU, effectively injecting failure 25% @Tags Failure injections @Accept json @Produce json @Param action query string true "Specify to perform a start or a stop for the CPU injection" @Param requestPayload body RequestPayload true "Specify the job name, percentage and target" @Success 200 {object} response.Payload @Failure 400 {object} response.Payload @Failure 500 {object} response.Payload @Router /cpu [post]

type RequestPayload

type RequestPayload struct {
	Job        string `json:"job"`
	Percentage int32  `json:"percentage"`
	Target     string `json:"target"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL