Documentation
¶
Index ¶
- func AntsPool(maxInFlight int) (*ants.Pool, error)
- func CalculateDelayAccuracy(payload *[]byte, delayMs int64) (time.Duration, bool)
- func CalculateEndToEndLatency(payload *[]byte) (time.Time, time.Duration)
- func ExecuteTemplate(tmpl *template.Template, id int) string
- func FormatTimestamp(timestamp uint64) time.Time
- func GetEndpoints(serviceName string) ([]string, error)
- func InjectId(s string, id int) string
- func MessageBody(staticSize int, sizeTemplate *template.Template, id int) []byte
- func ParseHeaders(headerStrings []string) map[string]any
- func ParseHeadersWithTemplates(headerStrings []string) (map[string]any, map[string]*template.Template, error)
- func ParseSize(sizeStr string) (int, error)
- func ParseURI(rawURI string, defaultScheme string, defaultPort string) uri
- func Rate(rate float32) string
- func RateLimiter(publishRate float32) *rate.Limiter
- func ReorderUrls(urls []*url.URL, spreadConnections bool, clientId int) []*url.URL
- func ResolveTerminus(destination string, template *template.Template, id int, cfg config.Config) string
- func UpdatePayload(useMillis bool, payload *[]byte) *[]byte
- func WrappedSequence(len int, start int) []int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateDelayAccuracy ¶ added in v0.29.0
CalculateDelayAccuracy calculates the accuracy of delayed message delivery. It compares the expected delivery time (timeSent + delay) with the actual delivery time. Returns the delay accuracy (negative means early, positive means late) and whether the message was delayed.
func ExecuteTemplate ¶ added in v0.32.0
func FormatTimestamp ¶ added in v0.7.0
func GetEndpoints ¶ added in v0.21.0
K8sGet performs a GET request on the Kubernetes API with the given URL; We only need 1 GET on a simple REST endpoint, and this way we avoid importing go-client with lots of dependencies
func ParseHeaders ¶ added in v0.30.0
ParseHeaders parses header strings in the format "key1=value1,key2=value2" and converts numeric values to appropriate types (int64 or float64)
func ParseHeadersWithTemplates ¶ added in v0.31.0
func ParseHeadersWithTemplates(headerStrings []string) (map[string]any, map[string]*template.Template, error)
ParseHeadersWithTemplates parses header strings as templates. Non-template strings will return as-is when executed.
func ParseSize ¶ added in v0.33.0
ParseSize parses a size string that may include units (e.g., "10mb", "1kb", "100") Supported units: b, kb, mb (case-insensitive) If no unit is specified, assumes bytes
func RateLimiter ¶ added in v0.24.0
func ReorderUrls ¶ added in v0.35.0
ReorderUrls reorders URLs based on SpreadConnections setting and client ID.
func ResolveTerminus ¶ added in v0.32.0
func UpdatePayload ¶
func WrappedSequence ¶ added in v0.7.1
generate a sequence of `len` integres starting with `start` and wrapped, so that it contains all values from 0 to len-1
Types ¶
This section is empty.