Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metric ¶
type Metric struct { Host string `json:"host"` Key string `json:"key"` Value string `json:"value"` Clock int64 `json:"clock"` }
Metric class.
type Packet ¶
type Packet struct { Request string `json:"request"` Data []*Metric `json:"data"` Clock int64 `json:"clock"` }
Packet class.
type Sender ¶
Sender class.
func NewBufferedSender ¶
func NewBufferedSender(host, port, defaultTechnicalHostname string, bufferSend time.Duration, bufferSize int) *Sender
Creates a buffered Sender with sendBuffer started, is intended for continous sending
func NewConfiguredSender ¶
Creates a Buffered sender using default configuration file, optionally the technical hostname can be set if technical hostname not given will try to load the FQDN from `hostname -f` will use technical name "localhost" if everything fails current defaults if configuration file is not found (default zabbix trapper port is 10051) ServerActive = zabbix BufferSend = 5 (seconds) BufferSize = 100 (metrics)
func (*Sender) SendMetric ¶
SendMetric adds the metric defined by key, value and optionally the UNIX epoch using the default technical hostname, to the Buffered Sender will return error if the Sender is not a Buffered Sender or if the buffer is at maximum capacity, the function should return as soon as possible