metrics

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TrimPort added in v1.6.2

func TrimPort(addr string) string

Types

type Matrix

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

A Matrix defines matrix for both gRPC server and gRPC client

func NewServerMatrix

func NewServerMatrix(subsystem string, labels prometheus.Labels) *Matrix

NewServerMatrix creates a new matrix for gRPC server

func (*Matrix) Collect

func (m *Matrix) Collect(in chan<- prometheus.Metric)

Collect implements prometheus Collector interface.

func (*Matrix) Describe

func (m *Matrix) Describe(in chan<- *prometheus.Desc)

Describe implements prometheus Collector interface.

type Metrics

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

Metrics implements prometheus Collector interface for server and handler.

func NewMetrics

func NewMetrics(opts Options) *Metrics

NewMetrics creates a new metrics of grpc interceptor for shared usage.

func (*Metrics) Collect

func (m *Metrics) Collect(in chan<- prometheus.Metric)

Collect implements prometheus Collector interface.

func (*Metrics) Counter

func (m *Metrics) Counter(name, help string, labels []string) *prometheus.CounterVec

Counter ...

func (*Metrics) DecCommands

func (m *Metrics) DecCommands(remoteAddr, localAddr string, cmds []string)

func (*Metrics) DecConnection

func (m *Metrics) DecConnection(remoteAddr, localAddr string)

func (*Metrics) DecRequest

func (m *Metrics) DecRequest(remoteAddr, localAddr string)

func (*Metrics) Describe

func (m *Metrics) Describe(in chan<- *prometheus.Desc)

Describe implements prometheus Collector interface.

func (*Metrics) Dialer

func (m *Metrics) Dialer(localAddr, remoteAddr string)

func (*Metrics) Enabled added in v1.6.1

func (m *Metrics) Enabled() bool

func (*Metrics) Gauge

func (m *Metrics) Gauge(name, help string, labels []string) *prometheus.GaugeVec

Gauge ...

func (*Metrics) Histogram

func (m *Metrics) Histogram(name, help string, labels []string) *prometheus.HistogramVec

Histogram ...

func (*Metrics) IncBytesRead added in v1.6.1

func (m *Metrics) IncBytesRead(localAddr, remoteAddr string, size float64)

func (*Metrics) IncBytesReceived added in v1.6.1

func (m *Metrics) IncBytesReceived(remoteAddr, localAddr string, size float64)

func (*Metrics) IncBytesSend added in v1.6.1

func (m *Metrics) IncBytesSend(remoteAddr, localAddr string, size float64)

func (*Metrics) IncBytesWrite added in v1.6.1

func (m *Metrics) IncBytesWrite(localAddr, remoteAddr string, size float64)

func (*Metrics) IncCommands

func (m *Metrics) IncCommands(remoteAddr, localAddr string, cmds []string)

func (*Metrics) IncConnection

func (m *Metrics) IncConnection(remoteAddr, localAddr string)

func (*Metrics) IncErrors

func (m *Metrics) IncErrors(remoteAddr, localAddr string, cmds []string)

func (*Metrics) IncRequest

func (m *Metrics) IncRequest(remoteAddr, localAddr string)

func (*Metrics) ObserveProxy added in v1.6.2

func (m *Metrics) ObserveProxy(remoteAddr, localAddr string, issuedAt time.Time)

func (*Metrics) ObserveRedis added in v1.6.2

func (m *Metrics) ObserveRedis(remoteAddr, localAddr string, issuedAt time.Time)

func (*Metrics) ObserveRequest

func (m *Metrics) ObserveRequest(remoteAddr, localAddr string, issuedAt time.Time)

type Monitor

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

A Monitor defines metrics for gRPC

func NewMonitor

func NewMonitor(subsystem string, labels prometheus.Labels) *Monitor

NewMonitor creates Monitor for starting

func (*Monitor) Collect

func (m *Monitor) Collect(in chan<- prometheus.Metric)

Collect implements prometheus Collector interface.

func (*Monitor) Describe

func (m *Monitor) Describe(in chan<- *prometheus.Desc)

Describe implements prometheus Collector interface.

type Options added in v1.6.2

type Options struct {
	Subsystem           string
	Labels              prometheus.Labels
	EnableServerMetrics bool
}

Options wraps settings of metrics.

func (Options) Enabled added in v1.6.2

func (opts Options) Enabled() bool

func (Options) FillWithDefaults added in v1.6.2

func (opts Options) FillWithDefaults()

FillWithDefaults setups default values of options.

Jump to

Keyboard shortcuts

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