Documentation
¶
Index ¶
- func ApplyLibrdkafkaConf(config map[string]string, configMap *kafka.ConfigMap) error
- func AwaitCondition(cond Condition, period time.Duration, maxWait time.Duration) error
- func BuildInstanceID() string
- func GetCounterValue(counter prometheus.Counter) (float64, error)
- func GetCounterVecValue(counterVec *prometheus.CounterVec, lvs ...string) (float64, error)
- func GetGaugeValue(gauge prometheus.Gauge) (float64, error)
- func GetGaugeVecValue(gaugeVec *prometheus.GaugeVec, lvs ...string) (float64, error)
- func GetIPAddress() (string, error)
- func RandString(n int) string
- func WaitForPort(t *testing.T, port int) error
- type Condition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyLibrdkafkaConf ¶
ApplyLibrdkafkaConf overlays librdkafka config values from the provided firebolt config onto the consumer config; in the firebolt config these should be key prefixed with 'librdkafka.' and here we remove the prefix and pass 'em through https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
func AwaitCondition ¶
AwaitCondition runs the passed 'cond' function every period until it returns true, returning an error if maxWait is exceeded.
func BuildInstanceID ¶
func BuildInstanceID() string
BuildInstanceID creates a unique ID for this instance of the running application by appending the host IP address and a random string.
func GetCounterValue ¶
func GetCounterValue(counter prometheus.Counter) (float64, error)
GetCounterValue fetches the current value of a prometheus counter. This is inherently racy and intended for test use only.
func GetCounterVecValue ¶
func GetCounterVecValue(counterVec *prometheus.CounterVec, lvs ...string) (float64, error)
GetCounterVecValue fetches the current value of a prometheus contervec for the passed label values. This is inherently racy and intended for test use only.
func GetGaugeValue ¶
func GetGaugeValue(gauge prometheus.Gauge) (float64, error)
GetGaugeValue fetches the current value of a prometheus gauge. This is inherently racy and intended for test use only.
func GetGaugeVecValue ¶
func GetGaugeVecValue(gaugeVec *prometheus.GaugeVec, lvs ...string) (float64, error)
GetGaugeVecValue fetches the current value of a prometheus gaugevec for the passed label values. This is inherently racy and intended for test use only.
func GetIPAddress ¶
GetIPAddress finds and returns the first non-loopback IP address formatted as a string.
func RandString ¶
RandString creates and returns a pseudorandom string from randAlphabet of length n.
func WaitForPort ¶
WaitForPort waits for the passed port number to start accepting connections. This can be used in integration tests to ensure that infrastructure services are available before tests that depend on them start to run. It's necessary because docker-compose returns when the configured containers are created, which doesn't ensure that the services they run are ready.d