Documentation ¶
Index ¶
- Constants
- func RegisterHandler(name string, ...)
- type BaseHandler
- func (base BaseHandler) Channel() chan metric.Metric
- func (base BaseHandler) CollectorBlackList() map[string]bool
- func (base BaseHandler) CollectorChannels() map[string]chan metric.Metric
- func (base BaseHandler) CollectorWhiteList() map[string]bool
- func (base BaseHandler) DefaultDimensions() map[string]string
- func (base *BaseHandler) InitListeners(globalConfig config.Config)
- func (base BaseHandler) InternalMetrics() metric.InternalMetrics
- func (base BaseHandler) Interval() int
- func (base BaseHandler) IsCollectorBlackListed(collectorName string) (bool, bool)
- func (base BaseHandler) IsCollectorWhiteListed(collectorName string) (bool, bool)
- func (base BaseHandler) KeepAliveInterval() int
- func (base BaseHandler) MaxBufferSize() int
- func (base BaseHandler) MaxIdleConnectionsPerHost() int
- func (base BaseHandler) Name() string
- func (base BaseHandler) Prefix() string
- func (base *BaseHandler) SetCollectorBlackList(blackList []string)
- func (base *BaseHandler) SetCollectorChannels(c map[string]chan metric.Metric)
- func (base *BaseHandler) SetCollectorWhiteList(whiteList []string)
- func (base *BaseHandler) SetDefaultDimensions(defaults map[string]string)
- func (base *BaseHandler) SetInterval(val int)
- func (base *BaseHandler) SetKeepAliveInterval(value int)
- func (base *BaseHandler) SetMaxBufferSize(size int)
- func (base *BaseHandler) SetMaxIdleConnectionsPerHost(value int)
- func (base *BaseHandler) SetPrefix(prefix string)
- func (base BaseHandler) String() string
- type Graphite
- type Handler
- type InfluxDB
- type Log
- type OpenTSDBHandler
- type Test
- type ZmqBUF
- func (h *ZmqBUF) Configure(configMap map[string]interface{})
- func (h *ZmqBUF) Enqueue(m metric.Metric)
- func (h *ZmqBUF) Filter(f metric.Filter) ([]metric.Metric, bool)
- func (h *ZmqBUF) Match(f metric.Filter) ([]metric.Metric, bool)
- func (h ZmqBUF) Port() string
- func (h ZmqBUF) Retention() int
- func (h *ZmqBUF) Run()
- func (h ZmqBUF) SweepInterval() time.Duration
- func (h *ZmqBUF) Values() ([]metric.Metric, bool)
- type ZmqPUB
Constants ¶
const ( DefaultBufferSize = 100 DefaultInterval = 10 DefaultTimeoutSec = 2 DefaultMaxIdleConnectionsPerHost = 2 DefaultKeepAliveInterval = 30 )
Some sane values to default things to
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseHandler ¶
type BaseHandler struct {
// contains filtered or unexported fields
}
BaseHandler is class to handle the boiler plate parts of the handlers
func (BaseHandler) Channel ¶
func (base BaseHandler) Channel() chan metric.Metric
Channel : the channel to handler listens for metrics on
func (BaseHandler) CollectorBlackList ¶
func (base BaseHandler) CollectorBlackList() map[string]bool
CollectorBlackList : return handler specific black listed collectors
func (BaseHandler) CollectorChannels ¶
func (base BaseHandler) CollectorChannels() map[string]chan metric.Metric
CollectorChannels : the channels to handler listens for metrics on
func (BaseHandler) CollectorWhiteList ¶
func (base BaseHandler) CollectorWhiteList() map[string]bool
CollectorWhiteList : return handler specific black listed collectors
func (BaseHandler) DefaultDimensions ¶
func (base BaseHandler) DefaultDimensions() map[string]string
DefaultDimensions : dimensions that should be included in any metric
func (*BaseHandler) InitListeners ¶
func (base *BaseHandler) InitListeners(globalConfig config.Config)
InitListeners - initiate listener channels for collectors
func (BaseHandler) InternalMetrics ¶
func (base BaseHandler) InternalMetrics() metric.InternalMetrics
InternalMetrics : Returns the internal metrics that are being collected by this handler
func (BaseHandler) Interval ¶
func (base BaseHandler) Interval() int
Interval : the maximum interval that the handler should buffer stats for
func (BaseHandler) IsCollectorBlackListed ¶
func (base BaseHandler) IsCollectorBlackListed(collectorName string) (bool, bool)
IsCollectorBlackListed : return true if collectorName is blacklisted in the handler
func (BaseHandler) IsCollectorWhiteListed ¶
func (base BaseHandler) IsCollectorWhiteListed(collectorName string) (bool, bool)
IsCollectorWhiteListed : return true if collectorName is blacklisted in the handler
func (BaseHandler) KeepAliveInterval ¶
func (base BaseHandler) KeepAliveInterval() int
KeepAliveInterval - return keep alive interval
func (BaseHandler) MaxBufferSize ¶
func (base BaseHandler) MaxBufferSize() int
MaxBufferSize : the maximum number of metrics that should be buffered before sending
func (BaseHandler) MaxIdleConnectionsPerHost ¶
func (base BaseHandler) MaxIdleConnectionsPerHost() int
MaxIdleConnectionsPerHost : return max idle connections per host
func (BaseHandler) Prefix ¶
func (base BaseHandler) Prefix() string
Prefix : the prefix (with punctuation) to use on each emitted metric
func (*BaseHandler) SetCollectorBlackList ¶
func (base *BaseHandler) SetCollectorBlackList(blackList []string)
SetCollectorBlackList : Add collectors mentioned in the handler config to blacklist
func (*BaseHandler) SetCollectorChannels ¶
func (base *BaseHandler) SetCollectorChannels(c map[string]chan metric.Metric)
SetCollectorChannels : the channels to handler listens for metrics on
func (*BaseHandler) SetCollectorWhiteList ¶
func (base *BaseHandler) SetCollectorWhiteList(whiteList []string)
SetCollectorWhiteList : Add collectors mentioned in the handler config to the whitelist
func (*BaseHandler) SetDefaultDimensions ¶
func (base *BaseHandler) SetDefaultDimensions(defaults map[string]string)
SetDefaultDimensions : set the defautl dimensions
func (*BaseHandler) SetInterval ¶
func (base *BaseHandler) SetInterval(val int)
SetInterval : set the interval
func (*BaseHandler) SetKeepAliveInterval ¶
func (base *BaseHandler) SetKeepAliveInterval(value int)
SetKeepAliveInterval : Set keep alive interval
func (*BaseHandler) SetMaxBufferSize ¶
func (base *BaseHandler) SetMaxBufferSize(size int)
SetMaxBufferSize : set the buffer size
func (*BaseHandler) SetMaxIdleConnectionsPerHost ¶
func (base *BaseHandler) SetMaxIdleConnectionsPerHost(value int)
SetMaxIdleConnectionsPerHost : Set maximum idle connections per host
func (*BaseHandler) SetPrefix ¶
func (base *BaseHandler) SetPrefix(prefix string)
SetPrefix : any prefix that should be applied to the metrics name as they're sent it is appended without any punctuation, include your own
func (BaseHandler) String ¶
func (base BaseHandler) String() string
String returns the handler name in a printable format.
type Graphite ¶
type Graphite struct { BaseHandler // contains filtered or unexported fields }
Graphite type
func (*Graphite) Configure ¶
Configure accepts the different configuration options for the Graphite handler
type Handler ¶
type Handler interface { Run() Configure(map[string]interface{}) InitListeners(config.Config) // InternalMetrics is to publish a set of values // that are relevant to the handler itself. InternalMetrics() metric.InternalMetrics // taken care of by the base Name() string String() string Channel() chan metric.Metric CollectorChannels() map[string]chan metric.Metric SetCollectorChannels(map[string]chan metric.Metric) Interval() int SetInterval(int) MaxBufferSize() int SetMaxBufferSize(int) Prefix() string SetPrefix(string) DefaultDimensions() map[string]string SetDefaultDimensions(map[string]string) MaxIdleConnectionsPerHost() int SetMaxIdleConnectionsPerHost(int) KeepAliveInterval() int SetKeepAliveInterval(int) // Return true if collector // is blacklisted in the handler SetCollectorBlackList([]string) CollectorBlackList() map[string]bool IsCollectorBlackListed(string) (bool, bool) // Return true if collector // is whitelisted in the handler SetCollectorWhiteList([]string) CollectorWhiteList() map[string]bool IsCollectorWhiteListed(string) (bool, bool) }
Handler defines the interface of a generic handler.
type InfluxDB ¶
type InfluxDB struct { BaseHandler // contains filtered or unexported fields }
InfluxDB type
func (*InfluxDB) Configure ¶
Configure accepts the different configuration options for the InfluxDB handler
type Log ¶
type Log struct {
BaseHandler
}
Log type
type OpenTSDBHandler ¶
type OpenTSDBHandler struct { BaseHandler // contains filtered or unexported fields }
OpenTSDBHandler type
func (*OpenTSDBHandler) Configure ¶
func (h *OpenTSDBHandler) Configure(configMap map[string]interface{})
Configure accepts the different configuration options for the OpenTSDBHandler handler
func (OpenTSDBHandler) Port ¶
func (h OpenTSDBHandler) Port() string
Port returns the Graphite server's port number
func (OpenTSDBHandler) Server ¶
func (h OpenTSDBHandler) Server() string
Server returns the OpenTSDBHandler server's name or IP
type Test ¶
type Test struct {
BaseHandler
}
Test type
type ZmqBUF ¶
type ZmqBUF struct { BaseHandler // contains filtered or unexported fields }
ZmqBUF implements a simple way of reusing http connections
func (*ZmqBUF) Configure ¶
Configure accepts the different configuration options for the InfluxDB handler
func (ZmqBUF) SweepInterval ¶
SweepInterval returns the rings retention time (in nanosec)
type ZmqPUB ¶
type ZmqPUB struct { BaseHandler // contains filtered or unexported fields }
ZmqPUB implements a simple way of reusing http connections