metrics

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package metrics provides a way to track metrics in the application. Functionality is strictly tailored to the needs of the package and is not meant to be a general purpose metrics library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector interface {
	RegisterGauge(name string) prometheus.Gauge
	RegisterGaugeVec(name string, labels ...string) *prometheus.GaugeVec
	RegisterHistogramVec(name string, labels ...string) *prometheus.HistogramVec
}

Collector is an interface that is used to register metrics

type EndWithClassification

type EndWithClassification func(success bool)

EndWithClassification is a function returned by Track* methods that should be called when the tracked operation is finished

type Metrics

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

Metrics is a struct that contains all the metrics that are used to track in the package

func NewMetrics

func NewMetrics(collector Collector) *Metrics

NewMetrics is a constructor for the Metrics struct

func (*Metrics) SetAccessKeyCount

func (m *Metrics) SetAccessKeyCount(value int64)

SetAccessKeyCount adds a value to the stats gauge with the label "access_key

func (*Metrics) SetDestinationCount

func (m *Metrics) SetDestinationCount(value int64)

SetDestinationCount adds a value to the stats gauge with the label "destination"

func (*Metrics) SetPaymailCount

func (m *Metrics) SetPaymailCount(value int64)

SetPaymailCount adds a value to the stats gauge with the label "paymail"

func (*Metrics) SetUtxoCount

func (m *Metrics) SetUtxoCount(value int64)

SetUtxoCount adds a value to the stats gauge with the label "utxo"

func (*Metrics) SetXPubCount

func (m *Metrics) SetXPubCount(value int64)

SetXPubCount adds a value to the stats gauge with the label "xpub"

func (*Metrics) TrackCron

func (m *Metrics) TrackCron(name string) EndWithClassification

TrackCron is used to track the time it takes to execute a cron job

func (*Metrics) TrackQueryTransaction

func (m *Metrics) TrackQueryTransaction() EndWithClassification

TrackQueryTransaction is used to track the time it takes to query a transaction

func (*Metrics) TrackRecordTransaction

func (m *Metrics) TrackRecordTransaction(strategyName string) EndWithClassification

TrackRecordTransaction is used to track the time it takes to record a transaction

func (*Metrics) TrackVerifyMerkleRoots

func (m *Metrics) TrackVerifyMerkleRoots() EndWithClassification

TrackVerifyMerkleRoots is used to track the time it takes to verify merkle roots

Jump to

Keyboard shortcuts

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