metric

package
v1.3.17 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const AGGREGATION_SPAN = 10 * time.Minute
View Source
const ROTATE_INTERVAL = 30 * time.Second

Variables

This section is empty.

Functions

func NewRegistry

func NewRegistry() *inMemoryRegistry

Types

type Factory

type Factory interface {
	NewHistogram(name string, maxValue int64) *Histogram
	NewLatency(name string, maxDuration time.Duration) *Histogram
	NewGauge(name string) *Gauge
	NewRate(name string) *Rate
	NewText(name string, defaultValue ...string) *Text
}

type Gauge

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

func (*Gauge) Add

func (g *Gauge) Add(i int64)

func (*Gauge) AddUint32

func (g *Gauge) AddUint32(i uint32)

func (*Gauge) Dec

func (g *Gauge) Dec()

func (*Gauge) Export

func (g *Gauge) Export() exportedMetric

func (*Gauge) Inc

func (g *Gauge) Inc()

func (*Gauge) IntValue added in v1.3.17

func (g *Gauge) IntValue() int64

func (*Gauge) Name

func (g *Gauge) Name() string

func (*Gauge) SubUint32

func (g *Gauge) SubUint32(size uint32)

func (*Gauge) Update

func (g *Gauge) Update(i int64)

func (*Gauge) UpdateUInt32

func (g *Gauge) UpdateUInt32(i int32)

func (*Gauge) Value

func (g *Gauge) Value() interface{}

type Histogram

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

func (*Histogram) CurrentSamples added in v1.3.17

func (h *Histogram) CurrentSamples() int64

func (*Histogram) Export

func (h *Histogram) Export() exportedMetric

func (*Histogram) Name

func (h *Histogram) Name() string

func (*Histogram) Record added in v0.7.11

func (h *Histogram) Record(measurement int64)

func (*Histogram) RecordSince

func (h *Histogram) RecordSince(t time.Time)

func (*Histogram) Rotate

func (h *Histogram) Rotate()

func (*Histogram) Value added in v1.3.17

func (h *Histogram) Value() interface{}

type Rate

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

func (*Rate) Export

func (r *Rate) Export() exportedMetric

func (*Rate) Measure

func (r *Rate) Measure(eventCount int64)

func (*Rate) Name

func (r *Rate) Name() string

func (*Rate) Rate added in v1.3.17

func (r *Rate) Rate() float64

func (*Rate) Reset

func (r *Rate) Reset()

func (*Rate) Value added in v1.3.17

func (r *Rate) Value() interface{}

type Registry

type Registry interface {
	Factory
	WithVirtualChainId(id primitives.VirtualChainId) Registry
	WithNodeAddress(nodeAddress primitives.NodeAddress) Registry
	Remove(metric metric)
	Get(metricName string) metric
	PeriodicallyRotate(ctx context.Context, logger log.Logger) govnr.ShutdownWaiter
	ExportAll() map[string]exportedMetric
	ExportPrometheus() string
}

type Text added in v0.7.1

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

func (*Text) Export added in v0.7.1

func (t *Text) Export() exportedMetric

func (*Text) Name added in v0.7.1

func (t *Text) Name() string

func (*Text) Update added in v0.7.1

func (t *Text) Update(value string)

func (*Text) Value added in v0.7.1

func (t *Text) Value() interface{}

Jump to

Keyboard shortcuts

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