metric

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

package metric provides a collection of useful/built-in metrics.

Index

Constants

This section is empty.

Variables

View Source
var (
	// CommandLine metric.
	CommandLine = expvar.CommandLine

	// MemoryStats metric.
	MemoryStats = expvar.MemoryStats
)

Functions

func Server

func Server(address, name string, pid int) expvar.Func

Server information.

Types

type Metric

type Metric struct {
	// Name of the metric.
	Name string `json:"name" validate:"required"`

	// Var is a valid ExpVar.
	Var expvar.Var `json:"var" validate:"required"`
}

Metric definition.

func New

func New(name string, v expvar.Var) (*Metric, error)

New is the Metric factory.

Jump to

Keyboard shortcuts

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