Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterCountable(module string, countable Countable, opts ...Option) error
- func RegisterCountableWithModulePrefix(modulePrefix, module string, countable Countable, opts ...Option) error
- func RegisterGcMonitor()
- func RegisterPreHook(hook func())
- func ReleaseDFStats(s *DFStats)
- func SetDFRemote(addr string)
- func SetHostname(name string)
- func SetMinInterval(interval time.Duration)
- func SetProcessName(name string)
- func SetProcessNameJoiner(joiner string)
- func SetRemoteType(t RemoteType)
- func SetRemotes(addrs ...string)
- type Countable
- type DFStats
- type Field
- type GcMonitor
- type Option
- type OptionInterval
- type OptionStatTags
- type RemoteType
- type StatItem
- type StatSource
- type Tag
- type UDPClient
- type UDPConfig
- type ValueType
Constants ¶
View Source
const (
DATABASE = "telegraf"
)
View Source
const (
TICK_CYCLE = 10 * time.Second
)
View Source
const ( // UDPPayloadSize is a reasonable default payload size for UDP packets that // could be travelling over the internet. UDPPayloadSize = 1024 )
Variables ¶
View Source
var (
MinInterval = TICK_CYCLE
)
Functions ¶
func RegisterCountable ¶
func RegisterGcMonitor ¶
func RegisterGcMonitor()
func RegisterPreHook ¶
func RegisterPreHook(hook func())
func ReleaseDFStats ¶
func ReleaseDFStats(s *DFStats)
func SetHostname ¶
func SetHostname(name string)
func SetMinInterval ¶
限定stats的最少interval,也就是不论注册Countable时 指定的Interval是多少,只要比此值低就优先使用此值
func SetProcessName ¶
func SetProcessName(name string)
func SetProcessNameJoiner ¶
func SetProcessNameJoiner(joiner string)
func SetRemotes ¶
func SetRemotes(addrs ...string)
指定influxdb远程服务器 只会有其中一个远程服务器会收到统计数据 addr格式: "192.168.1.1:20033"
Types ¶
type Countable ¶
type Countable interface { // needs to be thread-safe, clear is required after read // accept struct or []StatItem GetCounter() interface{} // once closed, countable will be removed from stats Closed() bool }
type DFStats ¶
func AcquireDFStats ¶
func AcquireDFStats() *DFStats
func (*DFStats) Encode ¶
func (s *DFStats) Encode(encoder *codec.SimpleEncoder)
type GcMonitor ¶
func (*GcMonitor) GetCounter ¶
func (t *GcMonitor) GetCounter() interface{}
type OptionInterval ¶
type OptionStatTags ¶
type RemoteType ¶
type RemoteType = uint8
const ( REMOTE_TYPE_INFLUXDB RemoteType = 1 << iota REMOTE_TYPE_STATSD REMOTE_TYPE_DFSTATSD )
type StatSource ¶
type StatSource struct {
// contains filtered or unexported fields
}
func (*StatSource) Equal ¶
func (s *StatSource) Equal(other *StatSource) bool
func (*StatSource) String ¶
func (s *StatSource) String() string
type UDPClient ¶
type UDPClient struct {
// contains filtered or unexported fields
}
func NewUDPClient ¶
NewUDPClient returns a client interface for writing to an InfluxDB UDP service from the given config.
type UDPConfig ¶
type UDPConfig struct { // Addr should be of the form "host:port" // or "[ipv6-host%zone]:port". Addr string // PayloadSize is the maximum size of a UDP client message, optional // Tune this based on your network. Defaults to UDPPayloadSize. PayloadSize int }
UDPConfig is the config data needed to create a UDP Client.
Click to show internal directories.
Click to hide internal directories.