monitor

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: Apache-2.0 Imports: 5 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 *wkhttp.Context) // 暴露监控接口
	ConnInc()                  // 连接数量递增
	ConnDec()                  // 连接数递减

	RetryQueueMsgInc()          // 重试队列消息递增
	RetryQueueMsgDec()          // 重试队列消息递减
	NodeRetryQueueMsgInc()      // 节点消息重试队列递增
	NodeRetryQueueMsgDec()      // 节点消息重试队列递减
	NodeRetryQueueMsgSet(v int) // 节点消息重试队列设置

	NodeGRPCConnPoolInc(addr string)        // 节点之间grpc连接池的连接递增
	NodeGRPCConnPoolDec(addr string)        // 节点之间gprc连接池的连接递减
	NodeGRPCConnPoolSet(addr string, v int) // 节点之间的grpc连接池的连接数设置

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

	// ---------- 上行 ----------
	UpstreamAdd(v int)               // 上行流量监控
	UpstreamPackageTrafficAdd(v int) // 上行数据包流量
	UpstreamPacketInc()              // 上行数据包数量

	SendSystemMsgInc() // 系统消息递增

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

	// ---------- 下行 ----------
	DownstreamAdd(v int)               // 下线流量
	DownstreamPackageTrafficAdd(v int) // 下行数据包流量
	DownstreamPacketInc()              // 下行数据包数量
	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) ConversationCacheSet

func (p *Prometheus) ConversationCacheSet(v int)

func (*Prometheus) DownstreamAdd

func (p *Prometheus) DownstreamAdd(v int)

func (*Prometheus) DownstreamPackageTrafficAdd

func (p *Prometheus) DownstreamPackageTrafficAdd(v int)

func (*Prometheus) DownstreamPacketInc

func (p *Prometheus) DownstreamPacketInc()

func (*Prometheus) InFlightMessagesSet

func (p *Prometheus) InFlightMessagesSet(v int)

func (*Prometheus) Monitor

func (p *Prometheus) Monitor(c *wkhttp.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) UpstreamPackageTrafficAdd

func (p *Prometheus) UpstreamPackageTrafficAdd(v int)

func (*Prometheus) UpstreamPacketInc

func (p *Prometheus) UpstreamPacketInc()

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