rainbond: github.com/goodrain/rainbond/eventlog/store Index | Files

package store

import "github.com/goodrain/rainbond/eventlog/store"

Index

Package Files

barrel.go docker_log_store.go handle_message_store.go manager.go monitor_message_store.go new_monitor_message_store.go read_message_store.go store.go

func Round Uses

func Round(f float64, n int) float64

Round Round

type CacheMonitorMessageList Uses

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

CacheMonitorMessageList 某个应用性能分析数据

func CreateCacheMonitorMessageList Uses

func CreateCacheMonitorMessageList(eventID string) *CacheMonitorMessageList

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

func (*CacheMonitorMessageList) Gc Uses

func (c *CacheMonitorMessageList) Gc()

Gc 清理数据

func (*CacheMonitorMessageList) Insert Uses

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

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

type EventBarrel Uses

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

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

type Manager Uses

type Manager interface {
    ReceiveMessageChan() chan []byte
    SubMessageChan() chan [][]byte
    PubMessageChan() chan [][]byte
    DockerLogMessageChan() chan []byte
    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 Uses

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

NewManager 存储管理器

type MessageStore Uses

type MessageStore interface {
    InsertMessage(*db.EventLogMessage)
    InsertGarbageMessage(...*db.EventLogMessage)
    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 Uses

func NewStore(storeType string, manager *storeManager) MessageStore

NewStore 创建

type MonitorMessage Uses

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 Uses

type MonitorMessageList []MonitorMessage

MonitorMessageList 消息列表

func (*MonitorMessageList) Add Uses

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

Add 添加

func (*MonitorMessageList) Len Uses

func (m *MonitorMessageList) Len() int

Len 为集合内元素的总数

func (*MonitorMessageList) Less Uses

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

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

func (*MonitorMessageList) Pop Uses

func (m *MonitorMessageList) Pop(i int) *MonitorMessageList

Pop Pop

func (*MonitorMessageList) String Uses

func (m *MonitorMessageList) String() string

String json string

func (*MonitorMessageList) Swap Uses

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

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

Package store imports 24 packages (graph) and is imported by 7 packages. Updated 2019-04-17. Refresh now. Tools for package owners.