extkafka

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BrokerControllerChanged = "kafka controller changed"
	BrokerDowntime          = "kafka broker with downtime"
)
View Source
const (
	LeaderChanged          = "leader changed"
	ReplicasChanged        = "replicas changed"
	OfflineReplicasChanged = "offline replicas changed"
	InSyncReplicasChanged  = "in sync replicas changed"
)
View Source
const (
	LimitConnectionRate = "max.connection.creation.rate"
)
View Source
const (
	MessageMaxBytes = "message.max.bytes"
)
View Source
const (
	NumberIOThreads = "num.io.threads"
)
View Source
const (
	NumberNetworkThreads = "num.network.threads"
)

Variables

View Source
var (
	ExecutionRunDataMap = sync.Map{} //make(map[uuid.UUID]*ExecutionRunData)
)

Functions

func BrokerCheckStatus added in v1.0.6

func BrokerCheckStatus(ctx context.Context, state *CheckBrokersState) (*action_kit_api.StatusResult, error)

func ConsumerGroupCheckStatus

func ConsumerGroupCheckStatus(ctx context.Context, state *ConsumerGroupCheckState) (*action_kit_api.StatusResult, error)

func ConsumerGroupLagCheckStatus

func ConsumerGroupLagCheckStatus(ctx context.Context, state *ConsumerGroupLagCheckState) (*action_kit_api.StatusResult, error)

func NewAlterLimitConnectionCreateRateAttack

func NewAlterLimitConnectionCreateRateAttack() action_kit_sdk.Action[AlterState]

func NewAlterMaxMessageBytesAttack

func NewAlterMaxMessageBytesAttack() action_kit_sdk.Action[AlterState]

func NewAlterNumberIOThreadsAttack

func NewAlterNumberIOThreadsAttack() action_kit_sdk.Action[AlterState]

func NewAlterNumberNetworkThreadsAttack

func NewAlterNumberNetworkThreadsAttack() action_kit_sdk.Action[AlterState]

func NewBrokersCheckAction added in v1.0.6

func NewBrokersCheckAction() action_kit_sdk.Action[CheckBrokersState]

func NewDeleteRecordsAttack

func NewDeleteRecordsAttack() action_kit_sdk.Action[DeleteRecordsState]

func NewKafkaBrokerElectNewLeaderAttack

func NewKafkaBrokerElectNewLeaderAttack() action_kit_sdk.Action[KafkaBrokerAttackState]

func NewKafkaConsumerDenyAccessAttack

func NewKafkaConsumerDenyAccessAttack() action_kit_sdk.Action[KafkaDenyUserState]

func NewKafkaConsumerGroupDiscovery

func NewKafkaConsumerGroupDiscovery(ctx context.Context) discovery_kit_sdk.TargetDiscovery

func NewPartitionsCheckAction added in v1.0.4

func NewPartitionsCheckAction() action_kit_sdk.Action[PartitionsCheckState]

func NewProduceMessageActionFixedAmount

func NewProduceMessageActionFixedAmount() action_kit_sdk.Action[KafkaBrokerAttackState]

func NewProduceMessageActionPeriodically

func NewProduceMessageActionPeriodically() action_kit_sdk.Action[KafkaBrokerAttackState]

func TopicCheckStatus added in v1.0.4

func TopicCheckStatus(ctx context.Context, state *PartitionsCheckState) (*action_kit_api.StatusResult, error)

Types

type AlterLimitConnectionCreateRateAttack

type AlterLimitConnectionCreateRateAttack struct{}

func (*AlterLimitConnectionCreateRateAttack) Describe

func (k *AlterLimitConnectionCreateRateAttack) Describe() action_kit_api.ActionDescription

func (*AlterLimitConnectionCreateRateAttack) NewEmptyState

func (*AlterLimitConnectionCreateRateAttack) Prepare

func (k *AlterLimitConnectionCreateRateAttack) Prepare(_ context.Context, state *AlterState, request action_kit_api.PrepareActionRequestBody) (*action_kit_api.PrepareResult, error)

func (*AlterLimitConnectionCreateRateAttack) Start

func (k *AlterLimitConnectionCreateRateAttack) Start(ctx context.Context, state *AlterState) (*action_kit_api.StartResult, error)

func (*AlterLimitConnectionCreateRateAttack) Stop

func (k *AlterLimitConnectionCreateRateAttack) Stop(ctx context.Context, state *AlterState) (*action_kit_api.StopResult, error)

type AlterMessageMaxBytesAttack

type AlterMessageMaxBytesAttack struct{}

func (*AlterMessageMaxBytesAttack) Describe

func (k *AlterMessageMaxBytesAttack) Describe() action_kit_api.ActionDescription

func (*AlterMessageMaxBytesAttack) NewEmptyState

func (k *AlterMessageMaxBytesAttack) NewEmptyState() AlterState

func (*AlterMessageMaxBytesAttack) Prepare

func (k *AlterMessageMaxBytesAttack) Prepare(_ context.Context, state *AlterState, request action_kit_api.PrepareActionRequestBody) (*action_kit_api.PrepareResult, error)

func (*AlterMessageMaxBytesAttack) Start

func (k *AlterMessageMaxBytesAttack) Start(ctx context.Context, state *AlterState) (*action_kit_api.StartResult, error)

func (*AlterMessageMaxBytesAttack) Stop

func (k *AlterMessageMaxBytesAttack) Stop(ctx context.Context, state *AlterState) (*action_kit_api.StopResult, error)

type AlterNumberIOThreadsAttack

type AlterNumberIOThreadsAttack struct{}

func (*AlterNumberIOThreadsAttack) Describe

func (k *AlterNumberIOThreadsAttack) Describe() action_kit_api.ActionDescription

func (*AlterNumberIOThreadsAttack) NewEmptyState

func (k *AlterNumberIOThreadsAttack) NewEmptyState() AlterState

func (*AlterNumberIOThreadsAttack) Prepare

func (k *AlterNumberIOThreadsAttack) Prepare(_ context.Context, state *AlterState, request action_kit_api.PrepareActionRequestBody) (*action_kit_api.PrepareResult, error)

func (*AlterNumberIOThreadsAttack) Start

func (k *AlterNumberIOThreadsAttack) Start(ctx context.Context, state *AlterState) (*action_kit_api.StartResult, error)

func (*AlterNumberIOThreadsAttack) Stop

func (k *AlterNumberIOThreadsAttack) Stop(ctx context.Context, state *AlterState) (*action_kit_api.StopResult, error)

type AlterNumberNetworkThreadsAttack

type AlterNumberNetworkThreadsAttack struct{}

func (*AlterNumberNetworkThreadsAttack) Describe

func (k *AlterNumberNetworkThreadsAttack) Describe() action_kit_api.ActionDescription

func (*AlterNumberNetworkThreadsAttack) NewEmptyState

func (k *AlterNumberNetworkThreadsAttack) NewEmptyState() AlterState

func (*AlterNumberNetworkThreadsAttack) Prepare

func (k *AlterNumberNetworkThreadsAttack) Prepare(_ context.Context, state *AlterState, request action_kit_api.PrepareActionRequestBody) (*action_kit_api.PrepareResult, error)

func (*AlterNumberNetworkThreadsAttack) Start

func (k *AlterNumberNetworkThreadsAttack) Start(ctx context.Context, state *AlterState) (*action_kit_api.StartResult, error)

func (*AlterNumberNetworkThreadsAttack) Stop

func (k *AlterNumberNetworkThreadsAttack) Stop(ctx context.Context, state *AlterState) (*action_kit_api.StopResult, error)

type AlterState added in v1.0.5

type AlterState struct {
	BrokerConfigValue        string
	BrokerID                 int32
	InitialBrokerConfigValue string
	BrokerHosts              []string
}

type CheckBrokersAction added in v1.0.8

type CheckBrokersAction struct{}

func (*CheckBrokersAction) Describe added in v1.0.8

func (m *CheckBrokersAction) Describe() action_kit_api.ActionDescription

func (*CheckBrokersAction) NewEmptyState added in v1.0.8

func (m *CheckBrokersAction) NewEmptyState() CheckBrokersState

func (*CheckBrokersAction) Prepare added in v1.0.8

func (m *CheckBrokersAction) Prepare(ctx context.Context, state *CheckBrokersState, request action_kit_api.PrepareActionRequestBody) (*action_kit_api.PrepareResult, error)

func (*CheckBrokersAction) Start added in v1.0.8

func (m *CheckBrokersAction) Start(_ context.Context, _ *CheckBrokersState) (*action_kit_api.StartResult, error)

func (*CheckBrokersAction) Status added in v1.0.8

func (m *CheckBrokersAction) Status(ctx context.Context, state *CheckBrokersState) (*action_kit_api.StatusResult, error)

type CheckBrokersState added in v1.0.8

type CheckBrokersState struct {
	PreviousController int32
	BrokerNodes        []int32
	End                time.Time
	ExpectedChanges    []string
	StateCheckMode     string
	StateCheckFailure  bool
	BrokerHosts        []string
}

type ConsumerGroupCheckAction

type ConsumerGroupCheckAction struct{}

func (*ConsumerGroupCheckAction) Describe

func (m *ConsumerGroupCheckAction) Describe() action_kit_api.ActionDescription

func (*ConsumerGroupCheckAction) NewEmptyState

func (*ConsumerGroupCheckAction) Prepare

func (m *ConsumerGroupCheckAction) Prepare(_ context.Context, state *ConsumerGroupCheckState, request action_kit_api.PrepareActionRequestBody) (*action_kit_api.PrepareResult, error)

func (*ConsumerGroupCheckAction) Start

func (m *ConsumerGroupCheckAction) Start(_ context.Context, _ *ConsumerGroupCheckState) (*action_kit_api.StartResult, error)

func (*ConsumerGroupCheckAction) Status

func (m *ConsumerGroupCheckAction) Status(ctx context.Context, state *ConsumerGroupCheckState) (*action_kit_api.StatusResult, error)

type ConsumerGroupCheckState

type ConsumerGroupCheckState struct {
	ConsumerGroupName string
	TopicName         string
	End               time.Time
	ExpectedState     []string
	StateCheckMode    string
	StateCheckSuccess bool
	BrokerHosts       []string
}

type ConsumerGroupLagCheckAction

type ConsumerGroupLagCheckAction struct{}

func (*ConsumerGroupLagCheckAction) Describe

func (m *ConsumerGroupLagCheckAction) Describe() action_kit_api.ActionDescription

func (*ConsumerGroupLagCheckAction) NewEmptyState

func (*ConsumerGroupLagCheckAction) Prepare

func (m *ConsumerGroupLagCheckAction) Prepare(_ context.Context, state *ConsumerGroupLagCheckState, request action_kit_api.PrepareActionRequestBody) (*action_kit_api.PrepareResult, error)

func (*ConsumerGroupLagCheckAction) Start

func (m *ConsumerGroupLagCheckAction) Start(_ context.Context, _ *ConsumerGroupLagCheckState) (*action_kit_api.StartResult, error)

func (*ConsumerGroupLagCheckAction) Status

func (m *ConsumerGroupLagCheckAction) Status(ctx context.Context, state *ConsumerGroupLagCheckState) (*action_kit_api.StatusResult, error)

type ConsumerGroupLagCheckState

type ConsumerGroupLagCheckState struct {
	ConsumerGroupName string
	Topic             string
	End               time.Time
	AcceptableLag     int64
	StateCheckSuccess bool
	StateCheckFailed  bool
	BrokerHosts       []string
}

type DeleteRecordsAttack

type DeleteRecordsAttack struct{}

func (*DeleteRecordsAttack) Describe

func (k *DeleteRecordsAttack) Describe() action_kit_api.ActionDescription

func (*DeleteRecordsAttack) NewEmptyState

func (k *DeleteRecordsAttack) NewEmptyState() DeleteRecordsState

func (*DeleteRecordsAttack) Prepare

func (k *DeleteRecordsAttack) Prepare(_ context.Context, state *DeleteRecordsState, request action_kit_api.PrepareActionRequestBody) (*action_kit_api.PrepareResult, error)

func (*DeleteRecordsAttack) Start

func (k *DeleteRecordsAttack) Start(ctx context.Context, state *DeleteRecordsState) (*action_kit_api.StartResult, error)

type DeleteRecordsState

type DeleteRecordsState struct {
	TopicName   string
	Partitions  []string
	Offset      int64
	BrokerHosts []string
}

type ExecutionRunData

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

type KafkaBrokerAttackState

type KafkaBrokerAttackState struct {
	Topic                    string
	Partition                int32
	Offset                   int64
	DelayBetweenRequestsInMS int64
	SuccessRate              int
	Timeout                  time.Time
	MaxConcurrent            int
	RecordKey                string
	RecordValue              string
	RecordPartition          int
	NumberOfRecords          uint64
	ExecutionID              uuid.UUID
	RecordHeaders            map[string]string
	ConsumerGroup            string
	BrokerHosts              []string
}

type KafkaConsumerDenyAccessAttack

type KafkaConsumerDenyAccessAttack struct{}

func (*KafkaConsumerDenyAccessAttack) Describe

func (k *KafkaConsumerDenyAccessAttack) Describe() action_kit_api.ActionDescription

func (*KafkaConsumerDenyAccessAttack) NewEmptyState

func (*KafkaConsumerDenyAccessAttack) Prepare

func (k *KafkaConsumerDenyAccessAttack) Prepare(_ context.Context, state *KafkaDenyUserState, request action_kit_api.PrepareActionRequestBody) (*action_kit_api.PrepareResult, error)

func (*KafkaConsumerDenyAccessAttack) Start

func (k *KafkaConsumerDenyAccessAttack) Start(ctx context.Context, state *KafkaDenyUserState) (*action_kit_api.StartResult, error)

func (*KafkaConsumerDenyAccessAttack) Stop

func (k *KafkaConsumerDenyAccessAttack) Stop(ctx context.Context, state *KafkaDenyUserState) (*action_kit_api.StopResult, error)

type KafkaDenyUserState

type KafkaDenyUserState struct {
	ConsumerGroup string
	Topic         string
	User          string
	BrokerHosts   []string
}

type PartitionsCheckAction added in v1.0.4

type PartitionsCheckAction struct{}

func (*PartitionsCheckAction) Describe added in v1.0.4

func (m *PartitionsCheckAction) Describe() action_kit_api.ActionDescription

func (*PartitionsCheckAction) NewEmptyState added in v1.0.4

func (m *PartitionsCheckAction) NewEmptyState() PartitionsCheckState

func (*PartitionsCheckAction) Prepare added in v1.0.4

func (m *PartitionsCheckAction) Prepare(_ context.Context, state *PartitionsCheckState, request action_kit_api.PrepareActionRequestBody) (*action_kit_api.PrepareResult, error)

func (*PartitionsCheckAction) Start added in v1.0.4

func (m *PartitionsCheckAction) Start(_ context.Context, _ *PartitionsCheckState) (*action_kit_api.StartResult, error)

func (*PartitionsCheckAction) Status added in v1.0.4

func (m *PartitionsCheckAction) Status(ctx context.Context, state *PartitionsCheckState) (*action_kit_api.StatusResult, error)

type PartitionsCheckState added in v1.0.4

type PartitionsCheckState struct {
	TopicName               string
	PreviousReplicas        map[int32][]int32
	PreviousInSyncReplicas  map[int32][]int32
	PreviousOfflineReplicas map[int32][]int32
	PreviousLeader          map[int32]int32
	End                     time.Time
	ExpectedChanges         []string
	StateCheckMode          string
	StateCheckSuccess       bool
	BrokerHosts             []string
}

Jump to

Keyboard shortcuts

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