monitor

package
v0.0.0-...-cdc279e Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetMonitorOn

func SetMonitorOn(on bool)

设置监控是否开启

Types

type IMonitor

type IMonitor interface {
	Start()
	Stop()
	Monitor(c *okhttp.Context) // 暴露监控接口
	ConnInc()                  // 连接数量递增
	ConnDec()                  // 连接数递减
	ConnNums() []int           // 一定周期的连接数

	RetryQueueMsgInc() // 重试队列消息递增
	RetryQueueMsgDec() // 重试队列消息递减

	WebhookObserve(event string, v time.Duration) // webhook耗时记录

	// ---------- 上行 ----------
	UpstreamTrafficSample() []int
	UpstreamPackageSample() []int // 上行包数
	UpstreamPackageAdd(v int)     // 上行包
	UpstreamTrafficAdd(v int)     // 上行数据包流量

	SendSystemMsgInc() // 系统消息递增

	SendPacketInc(persist bool) // 发送包递增

	// ---------- 下行 ----------
	DownstreamTrafficSample() []int
	DownstreamPackageSample() []int // 下行包数
	DownstreamPackageAdd(v int)     // 下线包
	DownstreamTrafficAdd(v int)     // 下行数据包流量
	RecvPacketInc(persist bool)     // 接受包递增

	// ---------- db相关 ----------
	SlotCacheInc()
	SlotCacheDec()
	TopicCacheInc()
	TopicCacheDec()
	SegmentCacheInc()
	SegmentCacheDec()

	ConversationCacheSet(v int) // 最近会话缓存数量
	TmpChannelCacheCountInc()   // 临时频道缓存数量递增
	TmpChannelCacheCountDec()   // 临时频道缓存数量递减
	ChannelCacheCountInc()      // 频道缓存数量递增
	ChannelCacheCountDec()      // 频道缓存数量递减

	InFlightMessagesSet(v int) // 投递中的消息

	OnlineUserInc() // 在线用户递增
	OnlineUserDec() // 在线用户递减
}

func GetMonitor

func GetMonitor() IMonitor

获取监控

func NewMonitor

func NewMonitor(on bool) IMonitor

func NewPrometheus

func NewPrometheus() IMonitor

type Prometheus

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

func (*Prometheus) ChannelCacheCountDec

func (p *Prometheus) ChannelCacheCountDec()

func (*Prometheus) ChannelCacheCountInc

func (p *Prometheus) ChannelCacheCountInc()

func (*Prometheus) ConnDec

func (p *Prometheus) ConnDec()

func (*Prometheus) ConnInc

func (p *Prometheus) ConnInc()

func (*Prometheus) ConnNums

func (p *Prometheus) ConnNums() []int

func (*Prometheus) ConversationCacheSet

func (p *Prometheus) ConversationCacheSet(v int)

func (*Prometheus) DownstreamPackageAdd

func (p *Prometheus) DownstreamPackageAdd(v int)

func (*Prometheus) DownstreamPackageSample

func (p *Prometheus) DownstreamPackageSample() []int

func (*Prometheus) DownstreamTrafficAdd

func (p *Prometheus) DownstreamTrafficAdd(v int)

func (*Prometheus) DownstreamTrafficSample

func (p *Prometheus) DownstreamTrafficSample() []int

func (*Prometheus) InFlightMessagesSet

func (p *Prometheus) InFlightMessagesSet(v int)

func (*Prometheus) Monitor

func (p *Prometheus) Monitor(c *okhttp.Context)

func (*Prometheus) NodeGRPCConnPoolDec

func (p *Prometheus) NodeGRPCConnPoolDec(addr string)

func (*Prometheus) NodeGRPCConnPoolInc

func (p *Prometheus) NodeGRPCConnPoolInc(addr string)

func (*Prometheus) NodeGRPCConnPoolSet

func (p *Prometheus) NodeGRPCConnPoolSet(addr string, v int)

func (*Prometheus) NodeRetryQueueMsgDec

func (p *Prometheus) NodeRetryQueueMsgDec()

func (*Prometheus) NodeRetryQueueMsgInc

func (p *Prometheus) NodeRetryQueueMsgInc()

func (*Prometheus) NodeRetryQueueMsgSet

func (p *Prometheus) NodeRetryQueueMsgSet(v int)

func (*Prometheus) OnlineUserDec

func (p *Prometheus) OnlineUserDec()

func (*Prometheus) OnlineUserInc

func (p *Prometheus) OnlineUserInc()

func (*Prometheus) RecvPacketInc

func (p *Prometheus) RecvPacketInc(persist bool)

func (*Prometheus) RetryQueueMsgDec

func (p *Prometheus) RetryQueueMsgDec()

func (*Prometheus) RetryQueueMsgInc

func (p *Prometheus) RetryQueueMsgInc()

func (*Prometheus) SegmentCacheDec

func (p *Prometheus) SegmentCacheDec()

func (*Prometheus) SegmentCacheInc

func (p *Prometheus) SegmentCacheInc()

func (*Prometheus) SendPacketInc

func (p *Prometheus) SendPacketInc(persist bool)

func (*Prometheus) SendSystemMsgInc

func (p *Prometheus) SendSystemMsgInc()

func (*Prometheus) SlotCacheDec

func (p *Prometheus) SlotCacheDec()

func (*Prometheus) SlotCacheInc

func (p *Prometheus) SlotCacheInc()

func (*Prometheus) Start

func (p *Prometheus) Start()

func (*Prometheus) Stop

func (p *Prometheus) Stop()

func (*Prometheus) TmpChannelCacheCountDec

func (p *Prometheus) TmpChannelCacheCountDec()

func (*Prometheus) TmpChannelCacheCountInc

func (p *Prometheus) TmpChannelCacheCountInc()

func (*Prometheus) TopicCacheDec

func (p *Prometheus) TopicCacheDec()

func (*Prometheus) TopicCacheInc

func (p *Prometheus) TopicCacheInc()

func (*Prometheus) UpstreamAdd

func (p *Prometheus) UpstreamAdd(v int)

func (*Prometheus) UpstreamPackageAdd

func (p *Prometheus) UpstreamPackageAdd(v int)

func (*Prometheus) UpstreamPackageSample

func (p *Prometheus) UpstreamPackageSample() []int

func (*Prometheus) UpstreamTrafficAdd

func (p *Prometheus) UpstreamTrafficAdd(v int)

func (*Prometheus) UpstreamTrafficSample

func (p *Prometheus) UpstreamTrafficSample() []int

func (*Prometheus) WebhookObserve

func (p *Prometheus) WebhookObserve(event string, v time.Duration)

Jump to

Keyboard shortcuts

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