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 ¶
- type Collector
- type EndWithClassification
- type Metrics
- func (m *Metrics) SetAccessKeyCount(value int64)
- func (m *Metrics) SetDestinationCount(value int64)
- func (m *Metrics) SetPaymailCount(value int64)
- func (m *Metrics) SetUtxoCount(value int64)
- func (m *Metrics) SetXPubCount(value int64)
- func (m *Metrics) TrackAddContact() EndWithClassification
- func (m *Metrics) TrackCron(name string) EndWithClassification
- func (m *Metrics) TrackQueryTransaction() EndWithClassification
- func (m *Metrics) TrackRecordTransaction(strategyName string) EndWithClassification
- func (m *Metrics) TrackVerifyMerkleRoots() EndWithClassification
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 RegisterCounterVec(name string, labels ...string) *prometheus.CounterVec }
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 ¶
NewMetrics is a constructor for the Metrics struct
func (*Metrics) SetAccessKeyCount ¶
SetAccessKeyCount adds a value to the stats gauge with the label "access_key
func (*Metrics) SetDestinationCount ¶
SetDestinationCount adds a value to the stats gauge with the label "destination"
func (*Metrics) SetPaymailCount ¶
SetPaymailCount adds a value to the stats gauge with the label "paymail"
func (*Metrics) SetUtxoCount ¶
SetUtxoCount adds a value to the stats gauge with the label "utxo"
func (*Metrics) SetXPubCount ¶
SetXPubCount adds a value to the stats gauge with the label "xpub"
func (*Metrics) TrackAddContact ¶
func (m *Metrics) TrackAddContact() EndWithClassification
TrackAddContact is used to track the time it takes to add PIKE contact
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