coordinator

package
v0.0.0-...-d436db8 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GorpcClient *gorpc.Client

Functions

func ChatRoomMsg

func ChatRoomMsg(appid uint16, roomid, sender, content string, msgtype, priority int, msgid uint, traceid string) error

发送消息到coordinator 由于可能需要在业务层指定发送往的coordinator,所以加了一个addr参数 msgid是为了以后做多个中心时使用

func DegradeChatRoom

func DegradeChatRoom(appid uint16, roomid string, degrade bool) error

func GetAdapterStat

func GetAdapterStat(addr string) (map[string]map[string]*AdapterStat, error)

func GetDegradedChatRoomList

func GetDegradedChatRoomList(appid uint16) ([]string, error)

func LiveNotify

func LiveNotify(appid uint16, roomid string, start bool) error

Types

type AdapterStat

type AdapterStat struct {
	RecordTime     time.Time // 这条记录创建时间
	PushInterval   int       // push间隔(毫秒)
	TotalPushCount int       // 发到这个聊天室的消息量,普通规则之前
	RealPushCount  int       // 真正发到这个聊天室消息,普通规则之后
	RealPushPerS   int       // 化成每秒push多少条
	SendInterval   int       // 发送间隔
	GetCount       int       // 向消息服务里要多少条
	RealGetCount   int       // 实际取到多少条
	RealGetPerS    int       // 实际取到条数化成每秒多少条
	MemCount       int       // 这个机房有多少人
	TotalMemCount  int       // 总人数
	LastAdjust     time.Time // 最近一次调整发消息次数
	FlowCount      uint64    // 当前的流量
	FlowHum        string    // 可读的流量大小
	OverFlow       float32
	Host           string // 当前的聊天室映射到哪一个coordinator上面
}

type DegradeRequest

type DegradeRequest struct {
	AppId   uint16
	RoomId  string
	Degrade bool
}

type LiveNotifyRequest

type LiveNotifyRequest struct {
	AppId  uint16
	RoomId string
	Start  bool
}

Jump to

Keyboard shortcuts

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