jvmchaos

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// byteman rule template
	SimpleRuleTemplate = `
RULE {{.Name}}
CLASS {{.Class}}
METHOD {{.Method}}
AT ENTRY
IF true
DO
	{{.Do}};
ENDRULE
`

	CompleteRuleTemplate = `` /* 135-byte string literal not displayed */

	// for action 'mysql', 'gc' and 'stress'
	SQLHelper    = "org.chaos_mesh.byteman.helper.SQLHelper"
	GCHelper     = "org.chaos_mesh.byteman.helper.GCHelper"
	StressHelper = "org.chaos_mesh.byteman.helper.StressHelper"

	// the trigger point for 'gc' and 'stress'
	TriggerClass  = "org.chaos_mesh.chaos_agent.TriggerThread"
	TriggerMethod = "triggerFunc"

	MySQL5InjectClass  = "com.mysql.jdbc.MysqlIO"
	MySQL5InjectMethod = "sqlQueryDirect"
	MySQL5Exception    = "java.sql.SQLException(\"%s\")"

	MySQL8InjectClass  = "com.mysql.cj.NativeSession"
	MySQL8InjectMethod = "execSQL"
	MySQL8Exception    = "com.mysql.cj.exceptions.CJException(\"%s\")"
)

Variables

View Source
var Module = fx.Provide(
	fx.Annotated{
		Group:  "impl",
		Target: NewImpl,
	},
)

Functions

func NewImpl

Object would return the instance of chaos

Types

type BytemanTemplateSpec

type BytemanTemplateSpec struct {
	Name      string
	Class     string
	Method    string
	Helper    string
	Bind      string
	Condition string
	Do        string

	// below is only used for stress template
	StressType      string
	StressValueName string
	StressValue     string
}

BytemanTemplateSpec is the template spec for byteman rule

type Impl

type Impl struct {
	client.Client
	Log logr.Logger
	// contains filtered or unexported fields
}

func (*Impl) Apply

func (impl *Impl) Apply(ctx context.Context, index int, records []*v1alpha1.Record, obj v1alpha1.InnerObject) (v1alpha1.Phase, error)

Apply applies jvm-chaos

func (*Impl) Recover

func (impl *Impl) Recover(ctx context.Context, index int, records []*v1alpha1.Record, obj v1alpha1.InnerObject) (v1alpha1.Phase, error)

Recover means the reconciler recovers the chaos action

type JVMRuleParameter

type JVMRuleParameter struct {
	v1alpha1.JVMParameter

	StressType      string
	StressValue     string
	StressValueName string
	Do              string
}

JVMRuleParameter is only used to generate rule data

Jump to

Keyboard shortcuts

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