metrics

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 12 Imported by: 0

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, gauges map[MetricName]prometheus.Gauge, 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 BlockWithoutTx

func BlockWithoutTx(chain common.Chain) MetricName

func GasPrice

func GasPrice(chain common.Chain) MetricName

func GasPriceChange

func GasPriceChange(chain common.Chain) MetricName

func GasPriceSuggested

func GasPriceSuggested(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.BifrostMetricsConfiguration) (*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) GetGauge

func (m *Metrics) GetGauge(name MetricName) prometheus.Gauge

GetGauges return a gauge by name

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

type TssKeysignMetricMgr

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

TssKeysignMetricMgr is a struct to manage tss keysign metric in memory

func NewTssKeysignMetricMgr

func NewTssKeysignMetricMgr() *TssKeysignMetricMgr

NewTssKeysignMetricMgr create a new instance of TssKeysignMetricMgr

func (*TssKeysignMetricMgr) GetTssKeysignMetric

func (m *TssKeysignMetricMgr) GetTssKeysignMetric(hash string) int64

GetTssKeysignMetric get the metric of the given hash , and delete it after

func (*TssKeysignMetricMgr) SetTssKeysignMetric

func (m *TssKeysignMetricMgr) SetTssKeysignMetric(hash string, elapseInMs int64)

SetTssKeysignMetric save the tss keysign time metric against the given hash

Jump to

Keyboard shortcuts

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