Documentation ¶
Index ¶
- Variables
- type PromClientMap
- func (pc *PromClientMap) Del(datasourceId int64)
- func (pc *PromClientMap) GetCli(datasourceId int64) prom.API
- func (pc *PromClientMap) GetDatasourceIds() []int64
- func (pc *PromClientMap) GetWriterCli(datasourceId int64) prom.WriterType
- func (pc *PromClientMap) Hit(datasourceIds []int64) []int64
- func (pc *PromClientMap) InitReader() error
- func (pc *PromClientMap) IsNil(datasourceId int64) bool
- func (pc *PromClientMap) Reset()
- func (pc *PromClientMap) Set(datasourceId int64, r prom.API, w prom.WriterType)
- type PromOption
- type PromOptionsStruct
- type PromSetting
Constants ¶
This section is empty.
Variables ¶
View Source
var PromOptions = &PromOptionsStruct{Data: make(map[int64]PromOption)}
Data key is cluster name
Functions ¶
This section is empty.
Types ¶
type PromClientMap ¶
type PromClientMap struct { sync.RWMutex ReaderClients map[int64]prom.API WriterClients map[int64]prom.WriterType // contains filtered or unexported fields }
func NewPromClient ¶
func NewPromClient(ctx *ctx.Context, heartbeat aconf.HeartbeatConfig) *PromClientMap
func (*PromClientMap) Del ¶
func (pc *PromClientMap) Del(datasourceId int64)
func (*PromClientMap) GetDatasourceIds ¶
func (pc *PromClientMap) GetDatasourceIds() []int64
func (*PromClientMap) GetWriterCli ¶
func (pc *PromClientMap) GetWriterCli(datasourceId int64) prom.WriterType
func (*PromClientMap) Hit ¶
func (pc *PromClientMap) Hit(datasourceIds []int64) []int64
Hit 根据当前有效的 datasourceId 和规则的 datasourceId 配置计算有效的cluster列表
func (*PromClientMap) InitReader ¶
func (pc *PromClientMap) InitReader() error
func (*PromClientMap) IsNil ¶
func (pc *PromClientMap) IsNil(datasourceId int64) bool
func (*PromClientMap) Reset ¶
func (pc *PromClientMap) Reset()
func (*PromClientMap) Set ¶
func (pc *PromClientMap) Set(datasourceId int64, r prom.API, w prom.WriterType)
type PromOption ¶
type PromOption struct { ClusterName string Url string WriteAddr string BasicAuthUser string BasicAuthPass string Timeout int64 DialTimeout int64 MaxIdleConnsPerHost int Headers []string }
func (*PromOption) Equal ¶
func (po *PromOption) Equal(target PromOption) bool
type PromOptionsStruct ¶
type PromOptionsStruct struct { Data map[int64]PromOption sync.RWMutex }
func (*PromOptionsStruct) Del ¶
func (pos *PromOptionsStruct) Del(datasourceId int64)
func (*PromOptionsStruct) Get ¶
func (pos *PromOptionsStruct) Get(datasourceId int64) (PromOption, bool)
func (*PromOptionsStruct) Set ¶
func (pos *PromOptionsStruct) Set(datasourceId int64, po PromOption)
type PromSetting ¶
type PromSetting struct {
WriterAddr string `json:"write_addr"`
}
Click to show internal directories.
Click to hide internal directories.