store

package
v0.0.0-...-a3a5c94 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: MIT 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

Types

type CacheMonitorMessageList

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

CacheMonitorMessageList - An application performance analysis data

func CreateCacheMonitorMessageList

func CreateCacheMonitorMessageList(eventID string) *CacheMonitorMessageList

CreateCacheMonitorMessageList - Create application monitoring information buffer

func (*CacheMonitorMessageList) Gc

func (c *CacheMonitorMessageList) Gc()

Gc - Clean data

func (*CacheMonitorMessageList) Insert

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

Insert - Think that the hostname of mms is consistent Gc every time a message is received

type EventBarrel

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

EventBarrel Coroutine cannot be started on this structure

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
}

Storage 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
	//total time
	CumulativeTime float64
	AverageTime    float64
	MaxTime        float64
	Count          uint64
	//Number of abnormal requests
	AbnormalCount uint64
}

MonitorMessage - performance monitoring message system model

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 - Is the total number of elements in the collection

func (*MonitorMessageList) Less

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

Less - If the element with index i is smaller than the element with index j, return true, otherwise return false

func (*MonitorMessageList) Pop

Pop

func (*MonitorMessageList) String

func (m *MonitorMessageList) String() string

String json string

func (*MonitorMessageList) Swap

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

Swap - Swap elements with index i and j

Jump to

Keyboard shortcuts

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