metrics

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TxTypeTx           = "tx"
	TxTypeSwap         = "swap"
	TxTypeMultiSwap    = "mswap"
	TxTypeSwapKey      = "swapkey"
	TxTypeMultiSwapKey = "mswapkey"
)

Variables

This section is empty.

Functions

func NewContext

func NewContext(parent context.Context, m Metrics) context.Context

NewContext adds Metrics to the Context.

Types

type LabelNames

type LabelNames struct {
	TxType          basemetrics.LabelName
	RobotChannel    basemetrics.LabelName
	Channel         basemetrics.LabelName
	AppVer          basemetrics.LabelName
	AppSdkFabricVer basemetrics.LabelName
	ErrType         basemetrics.LabelName
	Component       basemetrics.LabelName
	IsErr           basemetrics.LabelName
	IsFirstAttempt  basemetrics.LabelName
	IsSrcChClosed   basemetrics.LabelName
	IsTimeout       basemetrics.LabelName
}

func Labels

func Labels() LabelNames

type Metrics

type Metrics interface {
	TotalBatchExecuted() basemetrics.Counter
	TotalExecutedTx() basemetrics.Counter
	AppInfo() basemetrics.Counter
	TotalRobotStarted() basemetrics.Counter
	TotalRobotStopped() basemetrics.Counter
	TotalBatchSize() basemetrics.Counter
	TotalOrderingReqSizeExceeded() basemetrics.Counter
	TotalSrcChErrors() basemetrics.Counter

	BatchExecuteInvokeTime() basemetrics.Histogram
	BatchSize() basemetrics.Histogram
	BatchItemsCount() basemetrics.Histogram
	BatchCollectTime() basemetrics.Histogram
	BatchSizeEstimatedDiff() basemetrics.Histogram
	BlockTxCount() basemetrics.Histogram

	AppInitDuration() basemetrics.Gauge
	TxWaitingCount() basemetrics.Gauge
	HeightLedgerBlocks() basemetrics.Gauge
	CollectorProcessBlockNum() basemetrics.Gauge

	CreateChild(labels ...basemetrics.Label) Metrics
}

func FromContext

func FromContext(ctx context.Context) Metrics

FromContext gets Logger from the Context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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