Documentation
¶
Index ¶
- func Annotate(err error, format string, args ...any) error
- func DoWork(work func(m *monitoring.Metrics), rate int, pauseMs int, m *monitoring.Metrics)
- func Fail(err error, format string, args ...any)
- func GenString(n int) string
- func Random(min int, max int) int
- func Sleep(n int)
- func ValidateStr(key string, keys []string)
- func Warn(err error, format string, args ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoWork ¶ added in v0.1.6
func DoWork(work func(m *monitoring.Metrics), rate int, pauseMs int, m *monitoring.Metrics)
DoWork enables rate-limiting of client-provided work and accepts a random interval to pause between executions of the provided function, as well as a rate argument that defines the allowed number of operations per second.
func Sleep ¶
func Sleep(n int)
Sleep pauses the execution of the program for the generated number of microsecond. Interval is generated randomly with the upper bound limit provided by you.
func ValidateStr ¶
ValidateStr checks if the string is allowed. Example:
ValidateStr("redis", []string{"redis", "memcached"}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.