sqmetrics

package module
v0.0.0-...-ae72f33 Latest Latest
Warning

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

Go to latest
Published: May 31, 2017 License: Apache-2.0 Imports: 11 Imported by: 12

README

Metrics

Shared metrics collection package for square/ghostunnel and square/keywhiz-fs.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SquareMetrics

type SquareMetrics struct {
	Registry metrics.Registry
	// contains filtered or unexported fields
}

SquareMetrics posts metrics to an HTTP/JSON bridge endpoint

func NewMetrics

func NewMetrics(metricsURL, metricsPrefix string, client *http.Client, interval time.Duration, registry metrics.Registry, logger *log.Logger) *SquareMetrics

NewMetrics is the entry point for this code

func (*SquareMetrics) AddGauge

func (mb *SquareMetrics) AddGauge(name string, callback func() int64)

AddGauge installs a callback for a gauge with the given name. The callback will be called every metrics collection interval, and should provide an updated value for the gauge.

func (*SquareMetrics) SerializeMetrics

func (mb *SquareMetrics) SerializeMetrics() []map[string]interface{}

SerializeMetrics returns a map of the collected metrics, suitable for JSON marshalling

func (*SquareMetrics) ServeHTTP

func (mb *SquareMetrics) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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