goperfstat

package
v1.0.1-rel-02 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: AFL-3.0 Imports: 11 Imported by: 0

Documentation

Index

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

func TimerLog

func TimerLog()

func TriggerEsApi

func TriggerEsApi(topic string, ok bool, t int64) error

Types

type GoperfStat

type GoperfStat struct {
	basedto.BaseEntitySingle

	StatMap map[string]*GostatInfo

	StatChannel chan *GostatInfo

	Lock sync.RWMutex
	// contains filtered or unexported fields
}

func FindBeanGoperfStat

func FindBeanGoperfStat() *GoperfStat

FindBeanGoperfStat

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) TopicType

func (self *GoperfStat) TopicType(topic string) (string, error)

func (*GoperfStat) Trigger

func (self *GoperfStat) Trigger(topic string, ok bool) error

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

func (self *GoperfStat) TriggerTime(msgType string, topic string, ok bool, mtime int64) error

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 FindBeanGostatInfo

func FindBeanGostatInfo() *GostatInfo

FindBeanGostatInfo

func NewGostatInfo

func NewGostatInfo() *GostatInfo

func (*GostatInfo) CheckTopicType

func (self *GostatInfo) CheckTopicType() (string, error)

func (*GostatInfo) IfOk

func (self *GostatInfo) IfOk() bool

func (*GostatInfo) Stat

func (self *GostatInfo) Stat(topic string, ok bool, times int64)

type TriggerStatDto

type TriggerStatDto struct {
	basedto.BaseEntity
	MsgType string
	Topic   string
	Ok      bool  // ok
	Mstime  int64 //ms
}

func FindBeanTriggerStatDto

func FindBeanTriggerStatDto() *TriggerStatDto

FindBeanTriggerStatDto

func NewTriggerStatDto

func NewTriggerStatDto() *TriggerStatDto

Jump to

Keyboard shortcuts

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