trimetrics

package
v0.0.0-...-fe13f99 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

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

func NewCounter(path, desc string) (*Counter, error)

NewCounter creates a new count metric. path is the path of the new metric; desc is the description of the metric.

func (*Counter) Inc

func (c *Counter) Inc(x uint64)

Inc increments the value of this metric by x.

type Duration

type Duration struct {
	// contains filtered or unexported fields
}

Duration stores a time.Duration behind a mutex

func (*Duration) Get

func (d *Duration) Get() time.Duration

Get retrieves the duration.

func (*Duration) Set

func (d *Duration) Set(x time.Duration)

Set sets the duration

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL