Documentation
¶
Index ¶
- type ChanMonitor
- func (cm *ChanMonitor) AddChan(channame string, c interface{}) error
- func (cm *ChanMonitor) GetOverFlowSnapshot() []Chaninfo
- func (cm *ChanMonitor) GetSnapshot() []Chaninfo
- func (cm *ChanMonitor) SnapshotToJSON(snap []Chaninfo) ([]byte, error)
- func (cm *ChanMonitor) SnapshotToString(snap []Chaninfo) []string
- func (cm *ChanMonitor) Stop()
- type Chaninfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChanMonitor ¶
type ChanMonitor struct {
// contains filtered or unexported fields
}
ChanMonitor is monitor struce
func NewChanMonitor ¶
func NewChanMonitor(threshold int) *ChanMonitor
NewChanMonitor return a new chanMonitor with threshold value adn default interval 10s
func NewChanMonitorWithInterval ¶
func NewChanMonitorWithInterval(threshold int, interval int) *ChanMonitor
NewChanMonitorWithInterval return a new chanMonitor with threshold value and interval
func (*ChanMonitor) AddChan ¶
func (cm *ChanMonitor) AddChan(channame string, c interface{}) error
AddChan is used to add a channel to monitor
func (*ChanMonitor) GetOverFlowSnapshot ¶
func (cm *ChanMonitor) GetOverFlowSnapshot() []Chaninfo
GetOverFlowSnapshot get over flow snapshot
func (*ChanMonitor) GetSnapshot ¶
func (cm *ChanMonitor) GetSnapshot() []Chaninfo
GetSnapshot get the snapshot of the chan monitor
func (*ChanMonitor) SnapshotToJSON ¶
func (cm *ChanMonitor) SnapshotToJSON(snap []Chaninfo) ([]byte, error)
SnapshotToJSON make ChainInfo array to json format
func (*ChanMonitor) SnapshotToString ¶
func (cm *ChanMonitor) SnapshotToString(snap []Chaninfo) []string
SnapshotToString make Chaninfo array to string array
Click to show internal directories.
Click to hide internal directories.