connmetrics

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package connmetrics provides listener and connection metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnMetrics

type ConnMetrics struct {
	Requests  *prometheus.CounterVec
	Responses *prometheus.CounterVec
}

ConnMetrics represents metrics of an individual conn or a collection of conns.

func (*ConnMetrics) Collect

func (cm *ConnMetrics) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.

func (*ConnMetrics) Describe

func (cm *ConnMetrics) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector.

func (*ConnMetrics) GetResponses

func (cm *ConnMetrics) GetResponses() map[string]map[string]map[string]commandMetrics

GetResponses returns a map with all response metrics:

opcode (e.g. "OP_MSG", "OP_QUERY") -> command (e.g. "find", "aggregate") -> argument that caused an error (e.g. "sort", "$count (stage)"; or "unknown") -> result (e.g. "NotImplemented", "InternalError"; or "ok") -> count.

type ListenerMetrics

type ListenerMetrics struct {
	Accepts     *prometheus.CounterVec
	Durations   *prometheus.HistogramVec
	ConnMetrics *ConnMetrics
}

ListenerMetrics represents listener metrics.

func NewListenerMetrics

func NewListenerMetrics() *ListenerMetrics

NewListenerMetrics creates new listener metrics.

func (*ListenerMetrics) Collect

func (lm *ListenerMetrics) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.

func (*ListenerMetrics) Describe

func (lm *ListenerMetrics) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector.

Jump to

Keyboard shortcuts

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