Documentation ¶
Index ¶
- Constants
- Variables
- func DuPaths() []string
- func GetCurrPluginVersion() string
- func Hostname() (string, error)
- func IP() string
- func InitLocalIp()
- func InitLog(level string) (err error)
- func InitRootDir()
- func InitRpcClients()
- func IsTrustable(remoteAddr string) bool
- func ParseConfig(cfg string)
- func ReportPorts() []int64
- func ReportProcs() map[string]map[int]string
- func ReportUrls() map[string]string
- func SendMetrics(metrics []*model.MetricValue, resp *model.TransferResponse)
- func SendToTransfer(metrics []*model.MetricValue)
- func SetDuPaths(paths []string)
- func SetReportPorts(ports []int64)
- func SetReportProcs(procs map[string]map[int]string)
- func SetReportUrls(urls map[string]string)
- func SetTrustableIps(ipStr string)
- func TrustableIps() []string
- func VersionMsg() string
- type CollectorConfig
- type GlobalConfig
- type HeartbeatConfig
- type HttpConfig
- type PluginConfig
- type SingleConnRpcClient
- type TransferConfig
Constants ¶
View Source
const ( COLLECT_INTERVAL = time.Second URL_CHECK_HEALTH = "url.check.health" NET_PORT_LISTEN = "net.port.listen" DU_BS = "du.bs" PROC_NUM = "proc.num" )
Variables ¶
View Source
var ( BinaryName string Version string GitCommit string )
View Source
var ( TransferClientsLock *sync.RWMutex = new(sync.RWMutex) TransferClients map[string]*SingleConnRpcClient = map[string]*SingleConnRpcClient{} )
View Source
var (
ConfigFile string
)
View Source
var LocalIp string
View Source
var Root string
Functions ¶
func GetCurrPluginVersion ¶
func GetCurrPluginVersion() string
func InitLocalIp ¶
func InitLocalIp()
func InitRootDir ¶
func InitRootDir()
func InitRpcClients ¶
func InitRpcClients()
func IsTrustable ¶
func ParseConfig ¶
func ParseConfig(cfg string)
func ReportPorts ¶
func ReportPorts() []int64
func ReportProcs ¶
func ReportUrls ¶
func SendMetrics ¶
func SendMetrics(metrics []*model.MetricValue, resp *model.TransferResponse)
func SendToTransfer ¶
func SendToTransfer(metrics []*model.MetricValue)
func SetDuPaths ¶
func SetDuPaths(paths []string)
func SetReportPorts ¶
func SetReportPorts(ports []int64)
func SetReportProcs ¶
func SetReportUrls ¶
func SetTrustableIps ¶
func SetTrustableIps(ipStr string)
func TrustableIps ¶
func TrustableIps() []string
func VersionMsg ¶
func VersionMsg() string
Types ¶
type CollectorConfig ¶
type GlobalConfig ¶
type GlobalConfig struct { Debug bool `json:"debug"` Hostname string `json:"hostname"` IP string `json:"ip"` Plugin *PluginConfig `json:"plugin"` Heartbeat *HeartbeatConfig `json:"heartbeat"` Transfer *TransferConfig `json:"transfer"` Http *HttpConfig `json:"http"` Collector *CollectorConfig `json:"collector"` DefaultTags map[string]string `json:"default_tags"` IgnoreMetrics map[string]bool `json:"ignore"` }
func Config ¶
func Config() *GlobalConfig
type HeartbeatConfig ¶
type HttpConfig ¶
type PluginConfig ¶
type SingleConnRpcClient ¶
type SingleConnRpcClient struct { sync.Mutex RpcServer string Timeout time.Duration // contains filtered or unexported fields }
var (
HbsClient *SingleConnRpcClient
)
func (*SingleConnRpcClient) Call ¶
func (this *SingleConnRpcClient) Call(method string, args interface{}, reply interface{}) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.