Documentation ¶
Index ¶
- Constants
- Variables
- func Demultiplex(items []*cmodel.MetaData) ([]*cmodel.MetaData, []*cmodel.MetaData, []*cmodel.MetaData, []*cmodel.MetaData)
- func DestroyConnPools()
- func KeysOfMap(m map[string]string) []string
- func Push2GraphSendQueue(items []*cmodel.MetaData)
- func Push2InfluxdbSendQueue(items []*cmodel.MetaData)
- func Push2JudgeSendQueue(items []*cmodel.MetaData)
- func Push2NqmIcmpSendQueue(pingItems []*cmodel.MetaData)
- func Push2NqmTcpSendQueue(pingItems []*cmodel.MetaData)
- func Push2NqmTcpconnSendQueue(connItems []*cmodel.MetaData)
- func Push2StagingSendQueue(items []*cmodel.MetricValue)
- func Push2TsdbSendQueue(items []*cmodel.MetaData)
- func SetNodeRings(judgeConfig *g.JudgeConfig, graphConfig *g.GraphConfig)
- func Start()
- type ConsistentHashNodeRing
Constants ¶
View Source
const ( DefaultProcCronPeriod = time.Duration(5) * time.Second //ProcCron的周期,默认1s DefaultLogCronPeriod = time.Duration(3600) * time.Second //LogCron的周期,默认300s )
View Source
const (
DefaultSendQueueMaxSize = 102400 //10.24w
)
View Source
const (
DefaultSendTaskSleepInterval = time.Millisecond * 50 //默认睡眠间隔为50ms
)
send
Variables ¶
View Source
var ( TsdbQueue *nlist.SafeListLimited JudgeQueues = make(map[string]*nlist.SafeListLimited) GraphQueues = make(map[string]*nlist.SafeListLimited) InfluxdbQueues = make(map[string]*nlist.SafeListLimited) NqmIcmpQueue *nlist.SafeListLimited NqmTcpQueue *nlist.SafeListLimited NqmTcpconnQueue *nlist.SafeListLimited StagingQueue *nlist.SafeListLimited )
发送缓存队列 node -> queue_of_data
View Source
var ( JudgeConnPools *cpool.SafeRpcConnPools TsdbConnPoolHelper *cpool.TsdbConnPoolHelper GraphConnPools *cpool.SafeRpcConnPools InfluxdbConnPools *cpool.InfluxdbConnPools StagingConnPoolHelper *cpool.StagingConnPoolHelper )
连接池 node_address -> connection_pool
View Source
var (
MinStep int //最小上报周期,单位sec
)
默认参数
Functions ¶
func Demultiplex ¶
func DestroyConnPools ¶
func DestroyConnPools()
func Push2GraphSendQueue ¶
将数据 打入 某个Graph的发送缓存队列, 具体是哪一个Graph 由一致性哈希 决定
func Push2InfluxdbSendQueue ¶
Push data to 3rd-party database
func Push2JudgeSendQueue ¶
将数据 打入 某个Judge的发送缓存队列, 具体是哪一个Judge 由一致性哈希 决定
func Push2NqmIcmpSendQueue ¶
Push metrics from fping to the queue for RESTful API
func Push2NqmTcpSendQueue ¶
Push metrics from tcpping to the queue for RESTful API
func Push2NqmTcpconnSendQueue ¶
Push metrics from tcpconn to the queue for RESTful API
func Push2StagingSendQueue ¶
func Push2StagingSendQueue(items []*cmodel.MetricValue)
Push data from endpoint in filters to Staging
func SetNodeRings ¶
func SetNodeRings( judgeConfig *g.JudgeConfig, graphConfig *g.GraphConfig, )
Types ¶
type ConsistentHashNodeRing ¶
type ConsistentHashNodeRing struct {
// contains filtered or unexported fields
}
一致性哈希环,用于管理服务器节点.
var ( JudgeNodeRing *ConsistentHashNodeRing GraphNodeRing *ConsistentHashNodeRing )
服务节点的一致性哈希环 pk -> node
func (*ConsistentHashNodeRing) GetNode ¶
func (this *ConsistentHashNodeRing) GetNode(pk string) (string, error)
根据pk,获取node节点. chash(pk) -> node
func (*ConsistentHashNodeRing) SetNodes ¶
func (this *ConsistentHashNodeRing) SetNodes(nodes []string)
func (*ConsistentHashNodeRing) SetNumberOfReplicas ¶
func (this *ConsistentHashNodeRing) SetNumberOfReplicas(num int)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.