...

Package jvmchaos

import "github.com/chaos-mesh/chaos-mesh/controllers/chaosimpl/jvmchaos"
Overview
Index

Overview ▾

Constants

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

    CompleteRuleTemplate = `
RULE {{.Name}}
CLASS {{.Class}}
METHOD {{.Method}}
HELPER {{.Helper}}
AT ENTRY
BIND {{.Bind}};
IF {{.Condition}}
DO
    {{.Do}};
ENDRULE
`

    // 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

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

func NewImpl

func NewImpl(c client.Client, decoder *utils.ContainerRecordDecoder, log logr.Logger) *impltypes.ChaosImplPair

Object would return the instance of chaos

type BytemanTemplateSpec

BytemanTemplateSpec is the template spec for byteman rule

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
}

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

JVMRuleParameter is only used to generate rule data

type JVMRuleParameter struct {
    v1alpha1.JVMParameter

    StressType      string
    StressValue     string
    StressValueName string
    Do              string
}