Documentation ¶
Overview ¶
Package metrics provides simple metrics tracking features.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface { // MeasureSince adds a measurement for key to the metric store. // Used with defer and time.Now(). MeasureSince(key string, start time.Time) // WriteMetrics will write a summary of the metrics to w. WriteMetrics(w io.Writer) // TrackValue tracks the value for diff calculations etc. TrackValue(key, value string) // Reset clears the metric store. Reset() }
The Provider interface defines an interface for measuring metrics.
func NewProvider ¶
NewProvider returns a new instance of a metric store.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides storage for a set of metrics.
func (*Store) MeasureSince ¶
MeasureSince adds a measurement for key to the metric store.
func (*Store) TrackValue ¶
TrackValue tracks the value for diff calculations etc.
func (*Store) WriteMetrics ¶
WriteMetrics writes a summary of the metrics to w.
Click to show internal directories.
Click to hide internal directories.