metric

package
v0.5.1-pp-node Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const CName = "common.metric"

Variables

This section is empty.

Functions

func App

func App(app string) zap.Field

func Cid

func Cid(cid string) zap.Field

func FileId

func FileId(fileId string) zap.Field

func Identity

func Identity(val string) zap.Field

func Method

func Method(val string) zap.Field

func ObjectId

func ObjectId(val string) zap.Field

func PeerId

func PeerId(val string) zap.Field

func PeerVersion added in v0.2.2

func PeerVersion(val string) zap.Field

func QueueDur

func QueueDur(val time.Duration) zap.Field

func Size

func Size(size int) zap.Field

func SpaceId

func SpaceId(val string) zap.Field

func TotalDur

func TotalDur(val time.Duration) zap.Field

Types

type Config

type Config struct {
	Addr string `yaml:"addr"`
}

type Metric

type Metric interface {
	Registry() *prometheus.Registry
	WrapDRPCHandler(h drpc.Handler) drpc.Handler
	RequestLog(ctx context.Context, rpc string, fields ...zap.Field)
	RegisterSyncMetric(spaceId string, syncMetric SyncMetric)
	UnregisterSyncMetric(spaceId string)
	RegisterStreamPoolSyncMetric(mtr StreamPoolMetric)
	UnregisterStreamPoolSyncMetric()
	app.ComponentRunnable
}

func New

func New() Metric

type StreamPoolMetric added in v0.5.0

type StreamPoolMetric interface {
	OutgoingMsg() (count uint32, size uint64)
}

type SyncMetric added in v0.5.0

type SyncMetric interface {
	SyncMetricState() SyncMetricState
}

type SyncMetricState added in v0.5.0

type SyncMetricState struct {
	IncomingMsgCount  uint32
	IncomingMsgSize   uint64
	OutgoingMsgCount  uint32
	OutgoingMsgSize   uint64
	IncomingReqCount  uint32
	IncomingReqSize   uint64
	OutgoingReqCount  uint32
	OutgoingReqSize   uint64
	ReceivedRespCount uint32
	ReceivedRespSize  uint64
	SentRespCount     uint32
	SentRespSize      uint64
	TotalSize         uint64
}

func (*SyncMetricState) Append added in v0.5.0

func (st *SyncMetricState) Append(other SyncMetricState)

Jump to

Keyboard shortcuts

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