metric

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TxTypePatch  = "patch"
	TxTypeNormal = "normal"
)

Variables

View Source
var (
	MetricKeyHostname = NewMetricKey("hostname")
	MetricKeyChain    = NewMetricKey("channel")
)

metric common tag key

Functions

func DefaultMetricContext

func DefaultMetricContext() context.Context

func GetMetricContext

func GetMetricContext(p context.Context, mk *tag.Key, v string) context.Context

func GetMetricContextByCID

func GetMetricContextByCID(cid int) context.Context

func Initialize

func Initialize(w module.Wallet)

func Inspect

func Inspect(c module.Chain, informal bool) map[string]interface{}

func NewMetricKey

func NewMetricKey(k string) tag.Key

func ParseMetricData

func ParseMetricData(r *view.Row, prev interface{}, cnt int) interface{}

func PrometheusExporter

func PrometheusExporter() *prometheus.Exporter

func RegisterConsensus

func RegisterConsensus()

func RegisterMetricView

func RegisterMetricView(m stats.Measure, a *view.Aggregation, tks []tag.Key) *view.View

func RegisterNetwork

func RegisterNetwork()

func RegisterTransaction

func RegisterTransaction()

func RemoveMetricContext

func RemoveMetricContext(mk *tag.Key, v string)

func RemoveMetricContextByCID

func RemoveMetricContextByCID(cid int)

func ResetMetricViews

func ResetMetricViews()

Types

type ConsensusMetric

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

func NewConsensusMetric

func NewConsensusMetric(ctx context.Context) *ConsensusMetric

func (*ConsensusMetric) OnHeight

func (m *ConsensusMetric) OnHeight(height int64)

func (*ConsensusMetric) OnRound

func (m *ConsensusMetric) OnRound(round int32)

type NetworkMetric

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

func NewNetworkMetric

func NewNetworkMetric(ctx context.Context) *NetworkMetric

func (*NetworkMetric) OnRecv

func (m *NetworkMetric) OnRecv(dest byte, ttl byte, hint byte, protocol uint16, pktLen uint32)

func (*NetworkMetric) OnSend

func (m *NetworkMetric) OnSend(dest byte, ttl byte, hint byte, protocol uint16, pktLen uint32)

type TxMetric

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

func NewTransactionMetric

func NewTransactionMetric(ctx context.Context, t string) *TxMetric

func (*TxMetric) OnAddTx

func (c *TxMetric) OnAddTx(n int, user bool)

func (*TxMetric) OnCommit

func (c *TxMetric) OnCommit(hash []byte, ts time.Time, d time.Duration)

func (*TxMetric) OnDropTx

func (c *TxMetric) OnDropTx(n int, user bool)

func (*TxMetric) OnFinalize

func (c *TxMetric) OnFinalize(hash []byte, ts time.Time)

func (*TxMetric) OnRemoveTx

func (c *TxMetric) OnRemoveTx(n int, user bool)

Jump to

Keyboard shortcuts

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