metrics

package
v0.0.0-...-7107d2d Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TxTypeTx is a type of transaction
	TxTypeTx = "tx"
	// TxTypeSwap is a type of swap transaction
	TxTypeSwap = "swap"
	// TxTypeMultiSwap is a type of multi swap transaction
	TxTypeMultiSwap = "mswap"
	// TxTypeSwapKey is a type of swap key transaction
	TxTypeSwapKey = "swapkey"
	// TxTypeMultiSwapKey is a type of multi swap key transaction
	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
}

LabelNames is a struct with label names

func Labels

func Labels() LabelNames

Labels returns all label names

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
}

Metrics is a metrics interface for robot

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