Documentation
¶
Index ¶
- Variables
- func DebugLog(msg string, v ...interface{})
- func GetExportMetric() []byte
- func GetIpList() []string
- func GetSourceGuidMap() map[string][]string
- func HandleTransferResult(result map[string]PingResultObj, successCount int)
- func InitSourceList()
- func InitTransfer()
- func ParseConfig(cfg string) error
- func SendMetrics(metrics []*MetricValue, resp *TransferResponse)
- func UpdateHttpCheckExportMetric(result []*HttpCheckObj, successCount int)
- func UpdateIpList(ips []string, sourceType int)
- func UpdateLossPingExportMetric(result map[string]PingResultObj)
- func UpdatePingExportMetric(result map[string]PingResultObj, successCount int)
- func UpdateSourceRemoteData(input []*PingExportSourceObj)
- func UpdateTelnetExportMetric(result []*TelnetObj, successCount int)
- func Uuid() string
- type GlobalConfig
- type HttpCheckObj
- type MetricConfig
- type MetricValue
- type OpenFalconConfig
- type PingExportSourceObj
- type PingResultObj
- type PrometheusCOnfig
- type RemoteResponse
- type Response
- type SingleConnRpcClient
- type SourceConfig
- type SourceConstConfig
- type SourceFileConfig
- type SourceListenConfig
- type SourceRemoteConfig
- type TelnetObj
- type TransferConfig
- type TransferResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TransferClientsLock = new(sync.RWMutex) TClients *SingleConnRpcClient Hosts = make(map[string]string) // 存储主机IP和UUID对应关系 )
View Source
var (
ConfigFile string
)
Functions ¶
func GetExportMetric ¶
func GetExportMetric() []byte
func GetSourceGuidMap ¶
func HandleTransferResult ¶
func HandleTransferResult(result map[string]PingResultObj, successCount int)
func InitSourceList ¶
func InitSourceList()
Note: weight参数是为了在众多数据源中识别当前数据源的数据并更新,weight越小权重越高,各数据源之间的关系是并集 Note: 比如说remote的weight是3,file的weight是2,remote数据更新后不会覆盖file的数据
func InitTransfer ¶
func InitTransfer()
func ParseConfig ¶
func SendMetrics ¶
func SendMetrics(metrics []*MetricValue, resp *TransferResponse)
func UpdateHttpCheckExportMetric ¶ added in v1.5.0
func UpdateHttpCheckExportMetric(result []*HttpCheckObj, successCount int)
func UpdateIpList ¶
func UpdateLossPingExportMetric ¶
func UpdateLossPingExportMetric(result map[string]PingResultObj)
func UpdatePingExportMetric ¶
func UpdatePingExportMetric(result map[string]PingResultObj, successCount int)
func UpdateSourceRemoteData ¶ added in v1.7.0
func UpdateSourceRemoteData(input []*PingExportSourceObj)
Types ¶
type GlobalConfig ¶
type GlobalConfig struct {
Debug bool `json:"debug"`
Interval int `json:"interval"`
PingEnable bool `json:"ping_enable"`
TelnetEnable bool `json:"telnet_enable"`
HttpCheckEnable bool `json:"http_check_enable"`
HttpProxyEnable bool `json:"http_proxy_enable"`
HttpProxyAddress string `json:"http_proxy"`
OpenFalcon OpenFalconConfig `json:"open-falcon"`
Prometheus PrometheusCOnfig `json:"prometheus"`
Source SourceConfig `json:"source"`
Metrics MetricConfig `json:"metrics"`
HttpCheckTimeout int `json:"http_check_timeout"`
}
func Config ¶
func Config() *GlobalConfig
type HttpCheckObj ¶ added in v1.5.0
func GetHttpCheckList ¶ added in v1.5.0
func GetHttpCheckList() []*HttpCheckObj
type MetricConfig ¶
type MetricConfig struct {
Ping string `json:"ping"`
PingUseTime string `json:"ping_use_time"`
PingCountNum string `json:"ping_count_num"`
PingCountSuccess string `json:"ping_count_success"`
PingCountFail string `json:"ping_count_fail"`
Telnet string `json:"telnet"`
TelnetCountNum string `json:"telnet_count_num"`
TelnetCountSuccess string `json:"telnet_count_success"`
TelnetCountFail string `json:"telnet_count_fail"`
HttpCheck string `json:"http_check"`
HttpCheckCountNum string `json:"http_check_count_num"`
HttpCheckCountSuccess string `json:"http_check_count_success"`
HttpCheckCountFail string `json:"http_check_count_fail"`
PingLossPercent string `json:"ping_loss_percent"`
}
type MetricValue ¶
type MetricValue struct {
Endpoint string `json:"endpoint"`
Metric string `json:"metric"`
Value interface{} `json:"value"`
Step int64 `json:"step"`
Type string `json:"counterType"`
Tags string `json:"tags"`
Timestamp int64 `json:"timestamp"`
}
func (*MetricValue) String ¶
func (this *MetricValue) String() string
type OpenFalconConfig ¶
type OpenFalconConfig struct {
Enabled bool `json:"enabled"`
Transfer *TransferConfig `json:"transfer"`
}
type PingExportSourceObj ¶
type PingResultObj ¶ added in v1.5.1
type PrometheusCOnfig ¶
type RemoteResponse ¶ added in v1.7.0
type RemoteResponse struct {
Config []*PingExportSourceObj `json:"config"`
}
type SingleConnRpcClient ¶
type SingleConnRpcClient struct {
sync.Mutex
RpcServer string
Timeout time.Duration
// contains filtered or unexported fields
}
func (*SingleConnRpcClient) Call ¶
func (this *SingleConnRpcClient) Call(method string, args interface{}, reply interface{}) error
type SourceConfig ¶
type SourceConfig struct {
Const SourceConstConfig `json:"const"`
File SourceFileConfig `json:"file"`
Remote SourceRemoteConfig `json:"remote"`
Listen SourceListenConfig `json:"listen"`
}
type SourceConstConfig ¶
type SourceFileConfig ¶
type SourceListenConfig ¶
type SourceRemoteConfig ¶
type TelnetObj ¶
func GetTelnetList ¶
func GetTelnetList() []*TelnetObj
type TransferConfig ¶
type TransferResponse ¶
func (*TransferResponse) String ¶
func (this *TransferResponse) String() string
Click to show internal directories.
Click to hide internal directories.