Documentation
¶
Index ¶
- Constants
- func InjectGoperfStat(s *GoperfStat)
- func InjectGostatInfo(s *GostatInfo)
- func InjectTriggerStatDto(s *TriggerStatDto)
- func LoadGoperfStat() baseiface.ISingleton
- func LoadGostatInfo() baseiface.ISingleton
- func LoadTriggerStatDto() baseiface.ISingleton
- func TimerLog()
- func TriggerEsApi(topic string, ok bool, t int64) error
- type GoperfStat
- func (self *GoperfStat) Enable2Out() bool
- func (self *GoperfStat) GoperfStatDefault()
- func (self *GoperfStat) SetEnable2Out(enable2Out bool)
- func (self *GoperfStat) StartStats(interval ...int)
- func (self *GoperfStat) Stat(g *GostatInfo) error
- func (self *GoperfStat) ToStat() map[string]*GostatInfo
- func (self *GoperfStat) ToStatInf() string
- func (self *GoperfStat) TopicType(topic string) (string, error)
- func (self *GoperfStat) Trigger(topic string, ok bool) error
- func (self *GoperfStat) TriggerEsApi(topic string, ok bool, t int64) error
- func (self *GoperfStat) TriggerStat(statDto *TriggerStatDto) error
- func (self *GoperfStat) TriggerTime(msgType string, topic string, ok bool, mtime int64) error
- type GostatInfo
- type TriggerStatDto
Constants ¶
View Source
const ( STAT_CHANNEL_LEN = 300 STAT_KEY_ALL = "TOPIC_ALL" STAT_LOG_INTERVAL time.Duration = 60 //* time.Second )
View Source
const STAT_MSG_TYPE_ESAPI = "esapi"
View Source
const STAT_MSG_TYPE_NATS = "nats"
Variables ¶
This section is empty.
Functions ¶
func InjectGoperfStat ¶
func InjectGoperfStat(s *GoperfStat)
func InjectGostatInfo ¶
func InjectGostatInfo(s *GostatInfo)
func InjectTriggerStatDto ¶
func InjectTriggerStatDto(s *TriggerStatDto)
func LoadGoperfStat ¶
func LoadGoperfStat() baseiface.ISingleton
func LoadGostatInfo ¶
func LoadGostatInfo() baseiface.ISingleton
func LoadTriggerStatDto ¶
func LoadTriggerStatDto() baseiface.ISingleton
Types ¶
type GoperfStat ¶
type GoperfStat struct {
basedto.BaseEntitySingle
StatMap map[string]*GostatInfo
StatChannel chan *GostatInfo
Lock sync.RWMutex
// contains filtered or unexported fields
}
func NewGoperfStat ¶
func NewGoperfStat() *GoperfStat
func (*GoperfStat) Enable2Out ¶
func (self *GoperfStat) Enable2Out() bool
func (*GoperfStat) GoperfStatDefault ¶
func (self *GoperfStat) GoperfStatDefault()
func (*GoperfStat) SetEnable2Out ¶
func (self *GoperfStat) SetEnable2Out(enable2Out bool)
func (*GoperfStat) StartStats ¶
func (self *GoperfStat) StartStats(interval ...int)
func (*GoperfStat) Stat ¶
func (self *GoperfStat) Stat(g *GostatInfo) error
func (*GoperfStat) ToStat ¶
func (self *GoperfStat) ToStat() map[string]*GostatInfo
func (*GoperfStat) ToStatInf ¶
func (self *GoperfStat) ToStatInf() string
func (*GoperfStat) TriggerEsApi ¶
func (self *GoperfStat) TriggerEsApi(topic string, ok bool, t int64) error
func (*GoperfStat) TriggerStat ¶
func (self *GoperfStat) TriggerStat(statDto *TriggerStatDto) error
func (*GoperfStat) TriggerTime ¶
type GostatInfo ¶
type GostatInfo struct {
basedto.BaseEntity
Domain string `json:"domain"`
MsgType string `json:"msgtype"`
Topic string `json:"topic"`
Totalnum int64 `json:"totalnum"`
Avg int `json:"avg"`
Max int64
Min int64
Oknum int64 `json:"oknum"`
OkAvg int `json:"okAvg"`
OkTimes int64 `json:"oktimes"`
Failnum int64 `json:"failnum"`
FailTimes int64 `json:"failTimes"`
FailAvg int `json:"failAvg"`
// contains filtered or unexported fields
}
func NewGostatInfo ¶
func NewGostatInfo() *GostatInfo
func (*GostatInfo) CheckTopicType ¶
func (self *GostatInfo) CheckTopicType() (string, error)
func (*GostatInfo) IfOk ¶
func (self *GostatInfo) IfOk() bool
type TriggerStatDto ¶
type TriggerStatDto struct {
basedto.BaseEntity
MsgType string
Topic string
Ok bool // ok
Mstime int64 //ms
}
func NewTriggerStatDto ¶
func NewTriggerStatDto() *TriggerStatDto
Click to show internal directories.
Click to hide internal directories.