metrics

package
v0.0.0-...-9823ec8 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package metrics defines a set of basic building blocks for instrumenting Sonic gateways

Index

Constants

View Source
const Namespace = "github.com/starvn/sonic/telemetry/metrics"

Variables

This section is empty.

Functions

func ConfigGetter

func ConfigGetter(e config.ExtraConfig) interface{}

func NewDummyRegistry

func NewDummyRegistry() metrics.Registry

func NewProxyMiddleware

func NewProxyMiddleware(layer, name string, pm *ProxyMetrics) proxy.Middleware

Types

type Config

type Config struct {
	ProxyDisabled    bool
	RouterDisabled   bool
	BackendDisabled  bool
	CollectionTime   time.Duration
	ListenAddr       string
	EndpointDisabled bool
}

type DummyRegistry

type DummyRegistry struct{}

func (DummyRegistry) Each

func (r DummyRegistry) Each(_ func(string, interface{}))

func (DummyRegistry) Get

func (r DummyRegistry) Get(_ string) interface{}

func (DummyRegistry) GetAll

func (r DummyRegistry) GetAll() map[string]map[string]interface{}

func (DummyRegistry) GetOrRegister

func (r DummyRegistry) GetOrRegister(_ string, i interface{}) interface{}

func (DummyRegistry) Register

func (r DummyRegistry) Register(_ string, _ interface{}) error

func (DummyRegistry) RunHealthchecks

func (r DummyRegistry) RunHealthchecks()

func (DummyRegistry) Unregister

func (r DummyRegistry) Unregister(_ string)

func (DummyRegistry) UnregisterAll

func (r DummyRegistry) UnregisterAll()

type HistogramData

type HistogramData struct {
	Max         int64
	Min         int64
	Mean        float64
	Stddev      float64
	Variance    float64
	Percentiles []float64
}

type Metrics

type Metrics struct {
	Config   *Config
	Proxy    *ProxyMetrics
	Router   *RouterMetrics
	Registry *metrics.Registry
	// contains filtered or unexported fields
}

func New

func (*Metrics) BackendFactory

func (m *Metrics) BackendFactory(segmentName string, next proxy.BackendFactory) proxy.BackendFactory

func (*Metrics) DefaultBackendFactory

func (m *Metrics) DefaultBackendFactory() proxy.BackendFactory

func (*Metrics) NewProxyMiddleware

func (m *Metrics) NewProxyMiddleware(layer, name string) proxy.Middleware

func (*Metrics) ProxyFactory

func (m *Metrics) ProxyFactory(segmentName string, next proxy.Factory) proxy.FactoryFunc

func (*Metrics) Snapshot

func (m *Metrics) Snapshot() Stats

func (*Metrics) TakeSnapshot

func (m *Metrics) TakeSnapshot() Stats

type ProxyMetrics

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

func NewProxyMetrics

func NewProxyMetrics(parent *metrics.Registry) *ProxyMetrics

func (*ProxyMetrics) Counter

func (rm *ProxyMetrics) Counter(labels ...string) metrics.Counter

func (*ProxyMetrics) Histogram

func (rm *ProxyMetrics) Histogram(labels ...string) metrics.Histogram

type RouterMetrics

type RouterMetrics struct {
	ProxyMetrics
	// contains filtered or unexported fields
}

func NewRouterMetrics

func NewRouterMetrics(parent *metrics.Registry) *RouterMetrics

func (*RouterMetrics) Aggregate

func (rm *RouterMetrics) Aggregate()

func (*RouterMetrics) Connection

func (rm *RouterMetrics) Connection(TLS *tls.ConnectionState)

func (*RouterMetrics) Disconnection

func (rm *RouterMetrics) Disconnection()

func (*RouterMetrics) RegisterResponseWriterMetrics

func (rm *RouterMetrics) RegisterResponseWriterMetrics(name string)

type Stats

type Stats struct {
	Time       int64
	Counters   map[string]int64
	Gauges     map[string]int64
	Histograms map[string]HistogramData
}

func NewStats

func NewStats() Stats

Directories

Path Synopsis
Package gin defines a set of basic building blocks for instrumenting Sonic gateways built using the gin router
Package gin defines a set of basic building blocks for instrumenting Sonic gateways built using the gin router
Package mux defines a set of basic building blocks for instrumenting Sonic gateways built using the mux router
Package mux defines a set of basic building blocks for instrumenting Sonic gateways built using the mux router

Jump to

Keyboard shortcuts

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