utils

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AntsPool added in v0.24.0

func AntsPool(maxInFlight int) (*ants.Pool, error)

func CalculateEndToEndLatency

func CalculateEndToEndLatency(payload *[]byte) (time.Time, time.Duration)

func FormatTimestamp added in v0.7.0

func FormatTimestamp(timestamp uint64) time.Time

func GetEndpoints added in v0.21.0

func GetEndpoints(serviceName string) ([]string, error)

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 InjectId added in v0.13.0

func InjectId(s string, id int) string

func MessageBody

func MessageBody(size int) []byte

func ParseURI added in v0.7.0

func ParseURI(rawURI string, defaultScheme string, defaultPort string) uri

func Rate added in v0.14.0

func Rate(rate float32) string

func RateLimiter added in v0.24.0

func RateLimiter(publishRate float32) *rate.Limiter

func UpdatePayload

func UpdatePayload(useMillis bool, payload *[]byte) *[]byte

func WrappedSequence added in v0.7.1

func WrappedSequence(len int, start int) []int

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.

Jump to

Keyboard shortcuts

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