package metrics
import "github.com/coreos/etcd/pkg/metrics"
Package metrics provides metrics view of variables which is exposed through expvar package.
Naming conventions: 1. volatile path components should be kept as deep into the hierarchy as possible 2. each path component should have a clear and well-defined purpose 3. components.separated.with.dot, and put package prefix at the head 4. words_separated_with_underscore, and put clarifiers last, e.g., requests_total
Index ¶
- func Do(f func(expvar.KeyValue))
- func Get(name string) expvar.Var
- func Publish(name string, v expvar.Var)
- type Counter
- func NewCounter(name string) *Counter
- func (c *Counter) Add()
- func (c *Counter) AddBy(delta int64)
- func (c *Counter) String() string
- type Gauge
- type Map
Functions ¶
func Do ¶
Do calls f for each exported variable. The global variable map is locked during the iteration, but existing entries may be concurrently updated.
func Get ¶
Get retrieves a named exported variable.
func Publish ¶
Publish declares a named exported variable. If the name is already registered then this will overwrite the old one.
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter is a number that increases over time monotonically.
func NewCounter ¶
Convenience functions for creating new exported variables.
func (*Counter) Add ¶
func (c *Counter) Add()
func (*Counter) AddBy ¶
func (*Counter) String ¶
type Gauge ¶
type Gauge struct {
// contains filtered or unexported fields
}
Gauge returns instantaneous value that is expected to fluctuate over time.
func NewGauge ¶
func (*Gauge) Set ¶
func (*Gauge) String ¶
type Map ¶
Map aggregates Counters and Gauges.
func GetMap ¶
GetMap returns the map if it exists, or inits the given name map if it does not exist.
func NewMap ¶
func (*Map) Delete ¶
TODO: remove the var from the map to avoid memory boom
func (*Map) NewCounter ¶
func (*Map) NewGauge ¶
func (*Map) String ¶
String returns JSON format string that represents the group. It does not print out nilVar.
Source Files ¶
- Version
- v2.0.12+incompatible
- Published
- Jun 16, 2015
- Platform
- js/wasm
- Imports
- 5 packages
- Last checked
- 14 minutes ago –
Tools for package owners.