metrics

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: MIT Imports: 11 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddChainMetrics

func AddChainMetrics(chain common.Chain, counters map[MetricName]prometheus.Counter, counterVecs map[MetricName]*prometheus.CounterVec, histograms map[MetricName]prometheus.Histogram)

Types

type MetricName

type MetricName string

MetricName

const (
	TotalBlockScanned       MetricName = `total_block_scanned`
	CurrentPosition         MetricName = `current_position`
	TotalRetryBlocks        MetricName = `total_retry_blocks`
	CommonBlockScannerError MetricName = `block_scanner_error`

	ThorchainBlockScannerError MetricName = `thorchain_block_scan_error`
	BlockDiscoveryDuration     MetricName = `block_discovery_duration`

	ThorchainClientError    MetricName = `thorchain_client_error`
	TxToThorchain           MetricName = `tx_to_thorchain`
	TxToThorchainSigned     MetricName = `tx_to_thorchain_signed`
	SignToThorchainDuration MetricName = `sign_to_thorchain_duration`
	SendToThorchainDuration MetricName = `send_to_thorchain_duration`

	ObserverError MetricName = `observer_error`
	SignerError   MetricName = `signer_error`

	PubKeyManagerError MetricName = `pubkey_manager_error`
)

func BlockNoTxIn

func BlockNoTxIn(chain common.Chain) MetricName

func BlockNoTxOut

func BlockNoTxOut(chain common.Chain) MetricName

func BlockScanError

func BlockScanError(chain common.Chain) MetricName

func BlockWithTxIn

func BlockWithTxIn(chain common.Chain) MetricName

func BlockWithTxOut

func BlockWithTxOut(chain common.Chain) MetricName

func BlockWithoutTx

func BlockWithoutTx(chain common.Chain) MetricName

func SearchTxDuration

func SearchTxDuration(chain common.Chain) MetricName

func SignAndBroadcastDuration

func SignAndBroadcastDuration(chain common.Chain) MetricName

func TxSigned

func TxSigned(chain common.Chain) MetricName

func TxSignedBroadcast

func TxSignedBroadcast(chain common.Chain) MetricName

type Metrics

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

Metrics used to provide promethus metrics

func NewMetrics

func NewMetrics(cfg config.MetricsConfiguration) (*Metrics, error)

NewMetrics create a new instance of Metrics

func (*Metrics) GetCounter

func (m *Metrics) GetCounter(name MetricName) prometheus.Counter

GetCounter return a counter by name, if it doesn't exist, then it return nil

func (*Metrics) GetCounterVec

func (m *Metrics) GetCounterVec(name MetricName) *prometheus.CounterVec

func (*Metrics) GetHistograms

func (m *Metrics) GetHistograms(name MetricName) prometheus.Histogram

GetHistograms return a histogram by name

func (*Metrics) Start

func (m *Metrics) Start() error

Start

func (*Metrics) Stop

func (m *Metrics) Stop() error

Stop

Jump to

Keyboard shortcuts

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