monitor

package
v0.19.9 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XNameSpace = xNameSpace
)

const

Variables

This section is empty.

Functions

func CombineMonitorsRes

func CombineMonitorsRes(res ...string) string

CombineMonitorsRes combines all the monitors' results

func DefaultPrometheusConfig

func DefaultPrometheusConfig() *prometheusConfig

DefaultPrometheusConfig returns a default PrometheusConfig pointer

func ParsePort

func ParsePort(inputStr string) uint64

ParsePort parses port into uint from a string

Types

type OrderMetric

type OrderMetric struct {
	FullFilledNum    metrics.Gauge
	PendingNum       metrics.Gauge
	CanceledNum      metrics.Gauge
	ExpiredNum       metrics.Gauge
	PartialFilledNum metrics.Gauge
}

OrderMetric is the struct of metric in order module

func DefaultOrderMetrics

func DefaultOrderMetrics(config *prometheusConfig) *OrderMetric

DefaultOrderMetrics returns Metrics build using Prometheus client library if Prometheus is enabled Otherwise, it returns no-op Metrics

func NewOrderMetrics

func NewOrderMetrics(labelsAndValues ...string) *OrderMetric

NewOrderMetrics returns a pointer of a new OrderMetric object

func NopOrderMetrics

func NopOrderMetrics() *OrderMetric

NopOrderMetrics returns a pointer of a no-op Metrics

type PortMetrics

type PortMetrics struct {
	ConnectingNums metrics.Gauge
}

PortMetrics monitors connecting number

func GetPortMetrics

func GetPortMetrics() *PortMetrics

GetPortMetrics returns Metrics build using Prometheus client library if Prometheus is enabled Otherwise, it returns no-op Metrics

func NewPortMetrics

func NewPortMetrics(labelsAndValues ...string) *PortMetrics

NewPortMetrics returns a pointer of a new PortMetrics object

func NopPortMetrics

func NopPortMetrics() *PortMetrics

NopPortMetrics returns a pointer of a no-op Metrics

func (*PortMetrics) SetConnectingNums

func (portMetrics *PortMetrics) SetConnectingNums(connectingMap map[uint64]int)

SetConnectingNums sets connectingNums by connecting number of each port

type PortMonitor

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

PortMonitor - structure of monitor for ports

func GetPortMonitor

func GetPortMonitor() *PortMonitor

GetPortMonitor gets the global instance of PortMonitor

func NewPortMonitor

func NewPortMonitor(ports []string) *PortMonitor

NewPortMonitor creates a new instance of PortMonitor

func (*PortMonitor) GetConnectingMap

func (pm *PortMonitor) GetConnectingMap() map[uint64]int

GetConnectingMap gets connectingMap

func (*PortMonitor) GetResultString

func (pm *PortMonitor) GetResultString() string

GetResultString gets the format string result

func (*PortMonitor) Run

func (pm *PortMonitor) Run() error

Run starts monitoring

type StreamMetrics

type StreamMetrics struct {
	CacheSize metrics.Gauge
}

StreamMetrics is the struct of metric in stream module

func DefaultStreamMetrics

func DefaultStreamMetrics(config *prometheusConfig) *StreamMetrics

DefaultStreamMetrics returns Metrics build using Prometheus client library if Prometheus is enabled Otherwise, it returns no-op Metrics

func NewStreamMetrics

func NewStreamMetrics(labelsAndValues ...string) *StreamMetrics

NewStreamMetrics returns a pointer of a new StreamMetrics object

func NopStreamMetrics

func NopStreamMetrics() *StreamMetrics

NopStreamMetrics returns a pointer of no-op Metrics

type TendermintMonitor

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

TendermintMonitor - structure of monitor for block/mempool monitoring

func GetTendermintMonitor

func GetTendermintMonitor() *TendermintMonitor

GetTendermintMonitor gets the global instance of TendermintMonitor

func NewTendermintMonitor

func NewTendermintMonitor(portInput string) *TendermintMonitor

NewTendermintMonitor creates a new instance of TendermintMonitor

func (*TendermintMonitor) GetResultString

func (tm *TendermintMonitor) GetResultString() string

GetResultString gets the format string result

func (*TendermintMonitor) Run

func (tm *TendermintMonitor) Run(height int64) error

Run starts monitoring

Jump to

Keyboard shortcuts

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