store

package
v5.2.0-beta2+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: LGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Round

func Round(f float64, n int) float64

Round Round

Types

type CacheMonitorMessageList

type CacheMonitorMessageList struct {
	UpdateTime time.Time
	// contains filtered or unexported fields
}

CacheMonitorMessageList 某个应用性能分析数据

func CreateCacheMonitorMessageList

func CreateCacheMonitorMessageList(eventID string) *CacheMonitorMessageList

CreateCacheMonitorMessageList 创建应用监控信息缓存器

func (*CacheMonitorMessageList) Gc

func (c *CacheMonitorMessageList) Gc()

Gc 清理数据

func (*CacheMonitorMessageList) Insert

func (c *CacheMonitorMessageList) Insert(mms ...MonitorMessage)

Insert 认为mms的hostname一致 每次收到消息进行gc

type EventBarrel

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

EventBarrel 事件桶 不能在此结构上起协程

type Manager

type Manager interface {
	ReceiveMessageChan() chan []byte
	SubMessageChan() chan [][]byte
	PubMessageChan() chan [][]byte
	DockerLogMessageChan() chan []byte
	GetDockerLogs(serviceID string, length int) []string
	MonitorMessageChan() chan [][]byte
	WebSocketMessageChan(mode, eventID, subID string) chan *db.EventLogMessage
	NewMonitorMessageChan() chan []byte
	RealseWebSocketMessageChan(mode, EventID, subID string)
	Run() error
	Stop()
	Monitor() []db.MonitorData
	Scrape(ch chan<- prometheus.Metric, namespace, exporter, from string) error
	Error() chan error
	HealthCheck() map[string]string
}

Manager 存储管理器

func NewManager

func NewManager(conf conf.EventStoreConf, log *logrus.Entry) (Manager, error)

NewManager 存储管理器

type MessageStore

type MessageStore interface {
	InsertMessage(*db.EventLogMessage)
	InsertGarbageMessage(...*db.EventLogMessage)
	GetHistoryMessage(eventID string, length int) []string
	SubChan(eventID, subID string) chan *db.EventLogMessage
	RealseSubChan(eventID, subID string)
	GetMonitorData() *db.MonitorData
	Run()
	Gc()

	Scrape(ch chan<- prometheus.Metric, namespace, exporter, from string) error
	// contains filtered or unexported methods
}

MessageStore store

func NewStore

func NewStore(storeType string, manager *storeManager) MessageStore

NewStore 创建

type MonitorMessage

type MonitorMessage struct {
	ServiceID   string
	Port        string
	HostName    string
	MessageType string //mysql,http ...
	Key         string
	//总时间
	CumulativeTime float64
	AverageTime    float64
	MaxTime        float64
	Count          uint64
	//异常请求次数
	AbnormalCount uint64
}

MonitorMessage 性能监控消息系统模型

type MonitorMessageList

type MonitorMessageList []MonitorMessage

MonitorMessageList 消息列表

func (*MonitorMessageList) Add

func (m *MonitorMessageList) Add(mm *MonitorMessage)

Add 添加

func (*MonitorMessageList) Len

func (m *MonitorMessageList) Len() int

Len 为集合内元素的总数

func (*MonitorMessageList) Less

func (m *MonitorMessageList) Less(i, j int) bool

Less 如果index为i的元素小于index为j的元素,则返回true,否则返回false

func (*MonitorMessageList) Pop

Pop Pop

func (*MonitorMessageList) String

func (m *MonitorMessageList) String() string

String json string

func (*MonitorMessageList) Swap

func (m *MonitorMessageList) Swap(i, j int)

Swap 交换索引为 i 和 j 的元素

Jump to

Keyboard shortcuts

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