telemetry

package
v0.0.0-...-15325b8 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package telemetry provides monitoring utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler() http.Handler

Handler returns a HTTP handler for telemetry endpoints.

func ReportRuntime

func ReportRuntime(scope tally.Scope, interval time.Duration)

ReportRuntime starts a loop updating runtime metrics once every interval. Intended to be launched as a goroutine.

func Serve

func Serve(addr string, l log.Logger)

Serve launches a HTTP server for telemetry endpoints.

Types

type Bandwidth

type Bandwidth struct {
	tally.Counter
}

func NewBandwidth

func NewBandwidth(c tally.Counter) *Bandwidth

func (*Bandwidth) WrapReader

func (b *Bandwidth) WrapReader(r io.Reader) io.Reader

func (*Bandwidth) WrapWriter

func (b *Bandwidth) WrapWriter(w io.Writer) io.Writer

func (*Bandwidth) Write

func (b *Bandwidth) Write(d []byte) (int, error)

type ResourceGauge

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

ResourceGauge counts and logs the number of a specific resource.

func (*ResourceGauge) Alloc

func (r *ResourceGauge) Alloc()

Alloc records the addition of a resource.

func (*ResourceGauge) Free

func (r *ResourceGauge) Free()

Free records a resource being freed.

type ResourceMetric

type ResourceMetric interface {
	Alloc()
	Free()
}

ResourceMetric records allocation and freeing of a resource.

func NewResourceMetric

func NewResourceMetric(scope tally.Scope, l log.Logger, name string) ResourceMetric

NewResourceMetric builds a new ResourceMetric recording stats on scope and logging to l.

type Runtime

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

Runtime reports goroutine and memory statistics exposed by the runtime package.

func NewRuntime

func NewRuntime(scope tally.Scope) *Runtime

NewRuntime constructs runtime metrics from the given scope.

func (Runtime) Update

func (r Runtime) Update()

Update updates runtime stats.

Directories

Path Synopsis
Package expvar reports tally metrics to expvar.
Package expvar reports tally metrics to expvar.
Package logging reports tally metrics to a logger.
Package logging reports tally metrics to a logger.

Jump to

Keyboard shortcuts

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