metrics

package
v0.38.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2018 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func NewProvider(calculateHints bool) Provider

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

func (s *Store) MeasureSince(key string, start time.Time)

MeasureSince adds a measurement for key to the metric store.

func (*Store) Reset

func (s *Store) Reset()

Reset clears the metrics store.

func (*Store) TrackValue

func (s *Store) TrackValue(key, value string)

TrackValue tracks the value for diff calculations etc.

func (*Store) WriteMetrics

func (s *Store) WriteMetrics(w io.Writer)

WriteMetrics writes a summary of the metrics to w.

Jump to

Keyboard shortcuts

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