Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DurationToString ¶
Returns a given duration in minutes formatted as a more human-readable string of hours and minutes.
func Enquote ¶ added in v0.9.0
Enquote takes a string and surrounds it with quotes, escaping any quotes already present in the given string.
func TruncateAt ¶
TODO: test and use in appropriate places
Types ¶
type MetricsGetter ¶
MetricsGetter allows access to tracked performance metrics.
type MetricsHandler ¶
type MetricsHandler struct {
// contains filtered or unexported fields
}
MetricsHandler takes care of storing and updating tracked performance metrics and computes a rolling average to give basic insight into program performance.
func (*MetricsHandler) Add ¶
func (h *MetricsHandler) Add(value uint64)
Add inserts a new performance value into the ring buffer.
func (*MetricsHandler) Avg ¶
func (h *MetricsHandler) Avg() uint64
Avg returns the average from the ring buffer. Note that this can be misleading before the ring buffer has been filled up.
func (*MetricsHandler) GetLast ¶
func (h *MetricsHandler) GetLast() uint64
GetLast returns the most recently added performance value.