metrics

package
v0.0.0-...-855f576 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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`

	BinanceBlockScanError MetricName = `biance_block_scan_error`
	BlockWithoutTx        MetricName = `block_no_tx`
	BlockWithTxIn         MetricName = `block_tx_in`
	BlockNoTxIn           MetricName = `block_no_tx_in`

	StateChainBlockScanError MetricName = `statechain_block_scan_error`
	BlockNoTxOut             MetricName = `block_no_txout`

	BlockDiscoveryDuration MetricName = `block_discovery_duration`
	SearchTxDuration       MetricName = `search_tx_duration`

	StateChainBridgeError    MetricName = `statechain_bridge_error`
	TxToStateChain           MetricName = `tx_to_statechain`
	TxToStateChainSigned     MetricName = `tx_to_statechain_signed`
	SignToStateChainDuration MetricName = `sign_to_statechain_duration`
	SendToStatechainDuration MetricName = `send_to_statechain_duration`

	ObserverError                     MetricName = `observer_error`
	SignerError                       MetricName = `signer_error`
	TxToBinanceSigned                 MetricName = `tx_to_binance_signed`
	TxToBinanceSignedBroadcast        MetricName = `tx_to_binance_broadcast`
	SignAndBroadcastToBinanceDuration MetricName = `sign_and_broadcast_to_binance_duration`

	PoolAddressManagerError MetricName = `pool_address_manager_error`
)

type Metrics

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

Metrics used to provide promethus metrics

func NewMetrics

func NewMetrics(cfg config.MetricConfiguration) (*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