Documentation ¶
Overview ¶
Package trimetrics contains routines to facilitate exposing metrics in tricorder.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter represents a single counter metric.
func NewCounter ¶
NewCounter creates a new count metric. path is the path of the new metric; desc is the description of the metric.
type Duration ¶
type Duration struct {
// contains filtered or unexported fields
}
Duration stores a time.Duration behind a mutex
type WriterMetrics ¶
type WriterMetrics struct {
// contains filtered or unexported fields
}
WriterMetrics instances allow modules writing data to easily expose performance metrics about the writes.
func NewWriterMetrics ¶
func NewWriterMetrics(parentPath string) (*WriterMetrics, error)
NewWriterMetrics creates a new WriterMetric instance. parentPath is the parent path of the metrics. NewWriterMetrics returns an error if the path of the metrics it publishes collide with the path of some existing metric.
func (*WriterMetrics) LogError ¶
func (w *WriterMetrics) LogError( elapsed time.Duration, numToWrite uint64, err error)
LogError logs a write failure. elapsed is the time elapsed during the write. numToWrite is the number of records to be written. err is the resulting write error.
func (*WriterMetrics) LogSuccess ¶
func (w *WriterMetrics) LogSuccess(elapsed time.Duration, numWritten uint64)
LogSuccess logs a write success. elapsed is the time elapsed during the write. numToWrite is the number of records to be written.