Documentation ¶
Index ¶
- func AddAuthFlags(fs *flag.FlagSet) func() (*azservicebus.Client, *admin.Client, error)
- func ConstantlyUpdateQueue(ctx context.Context, adminClient *admin.Client, queue string, ...) error
- func ForceQueueDetach(ctx context.Context, adminClient *admin.Client, queue string) error
- func LoadEnvironment() error
- func MustCreateAutoDeletingQueue(sc *StressContext, queueName string, qp *admin.QueueProperties)
- func MustCreateSubscriptions(sc *StressContext, topicName string, subscriptionNames []string) func()
- func MustGenerateMessages(sc *StressContext, sender *azservicebus.Sender, messageLimit int, ...)
- func NewCtrlCContext() (context.Context, context.CancelFunc)
- type Stats
- type StreamingMessageBatch
- type StressContext
- func (tracker *StressContext) Assert(condition bool, message string)
- func (sc *StressContext) End()
- func (sc *StressContext) LogIfFailed(message string, err error, stats *Stats)
- func (sp StressContext) NewStat(name string) *Stats
- func (tracker *StressContext) PanicOnError(message string, err error)
- func (sp StressContext) PrintStats()
- func (sc *StressContext) Start(entityName string, attributes map[string]string)
- type TestContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAuthFlags ¶
AddAuthFlags adds the flags needed for authenticating to Service Bus. Returns a function that can be called after the flags have been parsed, which will create the an *azservicebus.Client.
func ConstantlyUpdateQueue ¶
func ConstantlyUpdateQueue(ctx context.Context, adminClient *admin.Client, queue string, updateInterval time.Duration) error
ConstantlyUpdateQueue updates queue, changing the MaxDeliveryCount properly between 11 and 10, every `updateInterval` This will cause Service Bus to issue force-detaches to our links, allowing us to exercise our recovery logic.
func ForceQueueDetach ¶ added in v0.3.3
func LoadEnvironment ¶
func LoadEnvironment() error
LoadEnvironment loads an .env file. If the env var `ENV_FILE` exists, we assume the value is a path to an .env file Otherwise we fall back to loading from the current directory.
func MustCreateAutoDeletingQueue ¶
func MustCreateAutoDeletingQueue(sc *StressContext, queueName string, qp *admin.QueueProperties)
MustCreateAutoDeletingQueue creates a queue that will auto-delete 10 minutes after activity has ceased.
func MustCreateSubscriptions ¶
func MustCreateSubscriptions(sc *StressContext, topicName string, subscriptionNames []string) func()
func MustGenerateMessages ¶
func MustGenerateMessages(sc *StressContext, sender *azservicebus.Sender, messageLimit int, numExtraBytes int, stats *Stats)
func NewCtrlCContext ¶
func NewCtrlCContext() (context.Context, context.CancelFunc)
NewCtrlCContext creates a context that cancels if the user hits ctrl+c.
Types ¶
type Stats ¶
type Stats struct { Sent int32 Received int32 Errors int32 // contains filtered or unexported fields }
func (*Stats) AddReceived ¶
type StreamingMessageBatch ¶
type StreamingMessageBatch struct {
// contains filtered or unexported fields
}
func NewStreamingMessageBatch ¶
func NewStreamingMessageBatch(ctx context.Context, sender internalBatchSender, stats *Stats) (*StreamingMessageBatch, error)
func (*StreamingMessageBatch) Add ¶
func (sb *StreamingMessageBatch) Add(ctx context.Context, msg *azservicebus.Message) error
Add appends to the current batch. If it's full it'll send it, allocate a new one.
type StressContext ¶
type StressContext struct { appinsights.TelemetryClient context.Context // TestRunID represents the test run and can be used to tie into other container metrics generated within the test cluster. TestRunID string // Nano is the nanoseconds start time for the stress test run Nano string // ConnectionString represents the value of the environment variable SERVICEBUS_CONNECTION_STRING. ConnectionString string // contains filtered or unexported fields }
StressContext holds onto some common useful state for stress tests, including some simple stats tracking, a telemetry client and a context that represents the lifetime of the test itself (and will be cancelled if the user quits out of the stress)
func MustCreateStressContext ¶
func MustCreateStressContext(testName string) *StressContext
func (*StressContext) Assert ¶ added in v0.3.4
func (tracker *StressContext) Assert(condition bool, message string)
func (*StressContext) End ¶
func (sc *StressContext) End()
func (*StressContext) LogIfFailed ¶
func (sc *StressContext) LogIfFailed(message string, err error, stats *Stats)
func (StressContext) NewStat ¶
NewStat creates a new stat with `name` and adds it to the list of statistics that will be printed and reported regularly.
func (*StressContext) PanicOnError ¶
func (tracker *StressContext) PanicOnError(message string, err error)
PanicOnError logs, sends telemetry and then closes on error
func (StressContext) PrintStats ¶ added in v0.3.4
func (sp StressContext) PrintStats()
type TestContext ¶
type TestContext struct { *StressContext Client *azservicebus.Client }
func (TestContext) NewStat ¶
NewStat creates a new stat with `name` and adds it to the list of statistics that will be printed and reported regularly.
func (TestContext) PrintStats ¶ added in v0.3.4
func (sp TestContext) PrintStats()