metrics

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

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

func New

func New(port int) (*Metrics, error)

New creates a new Prometheus Metrics instance, with its HTTP server registered on the input port.

func (*Metrics) IncDeletesFailed

func (m *Metrics) IncDeletesFailed()

IncDeletesFailed increases the total count of failed delete requests.

func (*Metrics) IncDeletesTotal

func (m *Metrics) IncDeletesTotal()

IncDeletesTotal increases the total count of delete requests.

func (*Metrics) IncInsertsFailed

func (m *Metrics) IncInsertsFailed()

IncInsertsFailed increases the total count of failed insert requests.

func (*Metrics) IncInsertsTotal

func (m *Metrics) IncInsertsTotal()

IncInsertsTotal increases the total count of insert requests.

func (*Metrics) IncSearchesFailed

func (m *Metrics) IncSearchesFailed()

IncSearchesFailed increases the total count of failed search requests.

func (*Metrics) IncSearchesTotal

func (m *Metrics) IncSearchesTotal()

IncSearchesTotal increases the total count of search requests.

func (*Metrics) ObserveDeleteLatency

func (m *Metrics) ObserveDeleteLatency(ctx context.Context, dur time.Duration)

ObserveDeleteLatency observes the latency in handling a delete request, registering an exemplar with this latency if the input context carries a valid span.

func (*Metrics) ObserveInsertLatency

func (m *Metrics) ObserveInsertLatency(ctx context.Context, dur time.Duration)

ObserveInsertLatency observes the latency in handling an insert request, registering an exemplar with this latency if the input context carries a valid span.

func (*Metrics) ObserveSearchLatency

func (m *Metrics) ObserveSearchLatency(ctx context.Context, dur time.Duration)

ObserveSearchLatency observes the latency in handling a search request, registering an exemplar with this latency if the input context carries a valid span.

func (*Metrics) Registry

func (m *Metrics) Registry() (reg *prometheus.Registry, err error)

Registry returns a prometheus.Registry with all set-up collectors for this instance.

The default collectors include the Go collector, the process collector, and the different requests collectors as implemented in Metrics.

func (*Metrics) Shutdown

func (m *Metrics) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the Metrics HTTP server

Jump to

Keyboard shortcuts

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