Skip to content

Commit

Permalink
fix: conversion error
Browse files Browse the repository at this point in the history
  • Loading branch information
achoimet committed Nov 12, 2024
1 parent 1901faf commit ac884e7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion extkafka/alter_limit_connection_create_rate.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (k *AlterLimitConnectionCreateRateAttack) Describe() action_kit_api.ActionD

func (k *AlterLimitConnectionCreateRateAttack) Prepare(_ context.Context, state *AlterLimitConnectionCreateRateState, request action_kit_api.PrepareActionRequestBody) (*action_kit_api.PrepareResult, error) {
state.BrokerID = extutil.ToInt32(request.Target.Attributes["kafka.broker.node-id"][0])
state.BrokerConfigValue = fmt.Sprintf("%d", int(extutil.ToInt64(request.Config["connection_rate"])))
state.BrokerConfigValue = fmt.Sprintf("%.0f", request.Config["connection_rate"])

return nil, nil
}
Expand Down
2 changes: 1 addition & 1 deletion extkafka/alter_max_message_bytes.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (k *AlterMessageMaxBytesAttack) Describe() action_kit_api.ActionDescription

func (k *AlterMessageMaxBytesAttack) Prepare(_ context.Context, state *AlterMessageMaxBytesState, request action_kit_api.PrepareActionRequestBody) (*action_kit_api.PrepareResult, error) {
state.BrokerID = extutil.ToInt32(request.Target.Attributes["kafka.broker.node-id"][0])
state.BrokerConfigValue = fmt.Sprintf("%f", request.Config["max_bytes"])
state.BrokerConfigValue = fmt.Sprintf("%.0f", request.Config["max_bytes"])

return nil, nil
}
Expand Down
2 changes: 1 addition & 1 deletion extkafka/alter_num_io_threads.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (k *AlterNumberIOThreadsAttack) Describe() action_kit_api.ActionDescription

func (k *AlterNumberIOThreadsAttack) Prepare(_ context.Context, state *AlterNumberIOThreadsState, request action_kit_api.PrepareActionRequestBody) (*action_kit_api.PrepareResult, error) {
state.BrokerID = extutil.ToInt32(request.Target.Attributes["kafka.broker.node-id"][0])
state.BrokerConfigValue = fmt.Sprintf("%f", request.Config["io_threads"])
state.BrokerConfigValue = fmt.Sprintf("%.0f", request.Config["io_threads"])

return nil, nil
}
Expand Down
2 changes: 1 addition & 1 deletion extkafka/alter_num_network_threads.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (k *AlterNumberNetworkThreadsAttack) Describe() action_kit_api.ActionDescri

func (k *AlterNumberNetworkThreadsAttack) Prepare(_ context.Context, state *AlterNumberNetworkThreadsState, request action_kit_api.PrepareActionRequestBody) (*action_kit_api.PrepareResult, error) {
state.BrokerID = extutil.ToInt32(request.Target.Attributes["kafka.broker.node-id"][0])
state.BrokerConfigValue = fmt.Sprintf("%f", request.Config["io_networks"])
state.BrokerConfigValue = fmt.Sprintf("%.0f", request.Config["io_networks"])

return nil, nil
}
Expand Down

0 comments on commit ac884e7

Please sign in to comment.