metrics

package
v1.4.5-testnet Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAll

func GetAll() map[string]map[string]interface{}

func Unregister

func Unregister(nameFormat string, nameArgs ...interface{})

func UpdateCfxRpcLogFilter

func UpdateCfxRpcLogFilter(method string, cfx sdk.ClientOperator, filter *types.LogFilter)

func UpdateEthRpcLogFilter

func UpdateEthRpcLogFilter(method string, eth *client.RpcEthClient, filter *w3types.FilterQuery)

Types

type InputBlockMetric

type InputBlockMetric struct{}

InputBlockMetric is used to add metrics for input block parameter.

func (*InputBlockMetric) Update1

func (metric *InputBlockMetric) Update1(blockNum *types.BlockNumber, method string, eth *client.RpcEthClient)

func (*InputBlockMetric) Update2

func (metric *InputBlockMetric) Update2(blockNumOrHash *types.BlockNumberOrHash, method string, eth *client.RpcEthClient)

type InputEpochMetric

type InputEpochMetric struct{}

InputEpochMetric is used to add metrics for input epoch parameter.

func (*InputEpochMetric) Update

func (metric *InputEpochMetric) Update(epoch *types.Epoch, method string, cfx sdk.ClientOperator)

Update marks the percentage for different epochs. If epoch number specified, add statistic for epoch gap against latest mined.

func (*InputEpochMetric) Update2

func (metric *InputEpochMetric) Update2(ebh *types.EpochOrBlockHash, method string, cfx sdk.ClientOperator)

type Metrics

type Metrics struct {
	RPC           RpcMetrics
	PubSub        PubSubMetrics
	Sync          SyncMetrics
	Store         StoreMetrics
	Nodes         NodeManagerMetrics
	VirtualFilter VirtualFilterMetrics
}
var Registry Metrics

type NodeManagerMetrics

type NodeManagerMetrics struct{}

Node manager metrics

func (*NodeManagerMetrics) NodeAvailability

func (*NodeManagerMetrics) NodeAvailability(space, group, node string) string

func (*NodeManagerMetrics) NodeLatency

func (*NodeManagerMetrics) NodeLatency(space, group, node string) string

func (*NodeManagerMetrics) Routes

func (*NodeManagerMetrics) Routes(space, group, node string) metrics.Meter

type PubSubMetrics

type PubSubMetrics struct{}

PubSub metrics

func (*PubSubMetrics) InputLogFilter

func (*PubSubMetrics) InputLogFilter(space string) metricUtil.Percentage

func (*PubSubMetrics) Sessions

func (*PubSubMetrics) Sessions(space, topic, node string) metrics.Gauge

type RpcMetrics

type RpcMetrics struct{}

RPC metrics

func (*RpcMetrics) BatchLatency

func (*RpcMetrics) BatchLatency() metrics.Histogram

func (*RpcMetrics) BatchSize

func (*RpcMetrics) BatchSize() metrics.Histogram

func (*RpcMetrics) FullnodeErrorRate

func (*RpcMetrics) FullnodeErrorRate(node ...string) metricUtil.Percentage

func (*RpcMetrics) FullnodeNonRpcErrorRate

func (*RpcMetrics) FullnodeNonRpcErrorRate(node ...string) metricUtil.Percentage

func (*RpcMetrics) FullnodeQps

func (*RpcMetrics) FullnodeQps(node, space, method string, err error) metrics.Timer

func (*RpcMetrics) InputBlock

func (*RpcMetrics) InputBlock(method, block string) metricUtil.Percentage

func (*RpcMetrics) InputBlockGap

func (*RpcMetrics) InputBlockGap(method string) metrics.Histogram

func (*RpcMetrics) InputBlockHash

func (*RpcMetrics) InputBlockHash(method string) metricUtil.Percentage

func (*RpcMetrics) InputEpoch

func (*RpcMetrics) InputEpoch(method, epoch string) metricUtil.Percentage

func (*RpcMetrics) InputEpochGap

func (*RpcMetrics) InputEpochGap(method string) metrics.Histogram

func (*RpcMetrics) LogFilterSplit

func (*RpcMetrics) LogFilterSplit(method, name string) metrics.Histogram

func (*RpcMetrics) Percentage

func (*RpcMetrics) Percentage(method, name string) metricUtil.Percentage

func (*RpcMetrics) StoreHit

func (*RpcMetrics) StoreHit(method, storeName string) metricUtil.Percentage

func (*RpcMetrics) UpdateDuration

func (*RpcMetrics) UpdateDuration(method string, err error, start time.Time)

type StoreMetrics

type StoreMetrics struct{}

Store metrics

func (*StoreMetrics) GetLogs

func (*StoreMetrics) GetLogs() metrics.Timer

func (*StoreMetrics) Pop

func (*StoreMetrics) Pop(storeName string) metrics.Timer

func (*StoreMetrics) Push

func (*StoreMetrics) Push(storeName string) metrics.Timer

type SyncMetrics

type SyncMetrics struct{}

Sync service metrics

func (*SyncMetrics) QueryEpochData

func (*SyncMetrics) QueryEpochData(space string) metrics.Timer

func (*SyncMetrics) QueryEpochDataAvailability

func (*SyncMetrics) QueryEpochDataAvailability(space string) metricUtil.Percentage

func (*SyncMetrics) SyncOnceQps

func (*SyncMetrics) SyncOnceQps(space, storeName string, err error) metrics.Timer

func (*SyncMetrics) SyncOnceSize

func (*SyncMetrics) SyncOnceSize(space, storeName string) metrics.Histogram

type TrafficCollector

type TrafficCollector interface {
	MarkHit(source string)
	TopkVisitors(k int) []Visitor
}

TrafficCollector collects traffic hits and calculate topK stats.

func DefaultTrafficCollector

func DefaultTrafficCollector() TrafficCollector

type VirtualFilterMetrics

type VirtualFilterMetrics struct{}

Virtual filter metrics

func (*VirtualFilterMetrics) PersistFilterChanges

func (*VirtualFilterMetrics) PersistFilterChanges(space, node, store string) metrics.Timer

func (*VirtualFilterMetrics) PollOnceQps

func (*VirtualFilterMetrics) PollOnceQps(space, node string, err error) metrics.Timer

func (*VirtualFilterMetrics) PollOnceSize

func (*VirtualFilterMetrics) PollOnceSize(space, node string) metrics.Histogram

func (*VirtualFilterMetrics) QueryFilterChanges

func (*VirtualFilterMetrics) QueryFilterChanges(space, node, store string) metrics.Timer

func (*VirtualFilterMetrics) Sessions

func (*VirtualFilterMetrics) Sessions(space string, filterType, node string) metrics.Gauge

func (*VirtualFilterMetrics) StoreQueryPercentage

func (*VirtualFilterMetrics) StoreQueryPercentage(space string, node, store string) metricUtil.Percentage

type Visitor

type Visitor struct {
	Source string // visitor source
	Hits   int    // visitor hit count
}

Visitor visitor traffic such as vistor source and hit count

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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