metric

package
v0.0.0-...-887f819 Latest Latest
Warning

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

Go to latest
Published: May 4, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inc

func Inc(name string, i int64)

Inc increases specific counter metric.

func RecordTime

func RecordTime(name string, startTime time.Time)

RecordTime records time elapse from startTime for given metric.

func Register

func Register(name string, m interface{})

Register registers a new metric for observation.

func RunMetric

func RunMetric(interval time.Duration)

RunMetric reports metric result over a given time interval.

Types

type TPSMetrics

type TPSMetrics interface {
	// Add c transactions
	Add(c int64)
	// Get current tps
	Get() int64
}

TPSMetrics is the metrics for tps (Transaction Per Second)

func NewTPSMetrics

func NewTPSMetrics() TPSMetrics

NewTPSMetrics creates a tpsMetrics and starts its ticker.

Jump to

Keyboard shortcuts

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