gmetric

package module
v0.0.0-...-6d69d61 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

View Source
const (
	SLOPE_ZERO        = 0
	SLOPE_POSITIVE    = 1
	SLOPE_NEGATIVE    = 2
	SLOPE_BOTH        = 3
	SLOPE_UNSPECIFIED = 4

	VALUE_UNKNOWN        = 0
	VALUE_STRING         = 1
	VALUE_UNSIGNED_SHORT = 2
	VALUE_SHORT          = 3
	VALUE_UNSIGNED_INT   = 4
	VALUE_INT            = 5
	VALUE_FLOAT          = 6
	VALUE_DOUBLE         = 7

	PACKET_BOTH = 0
	PACKET_META = 1
	PACKET_DATA = 2

	GROUP      = "GROUP"
	SPOOF_HOST = "SPOOF_HOST"

	// MAX_PACKET_LENGTH is the maximum allocated length of packets.
	MAX_PACKET_LENGTH = 512
	// MAX_GMETRIC_SERVERS is the maximum number of Ganglia gmetric
	// receiving instances.
	MAX_GMETRIC_SERVERS = 16
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Gmetric

type Gmetric struct {
	Servers []Server
	Host    string
	Spoof   string
}

Gmetric base object, on which all library operations are based.

func (*Gmetric) AddServer

func (g *Gmetric) AddServer(s Server)

AddServer adds an additional server target

func (*Gmetric) CloseConnections

func (g *Gmetric) CloseConnections(conn []*net.UDPConn)

CloseConnections closes out the array of UDPConn specified

func (*Gmetric) DebugBuffer

func (g *Gmetric) DebugBuffer(buf []byte)

DebugBuffer produces logger data detailing the contents of the passed buffer.

func (*Gmetric) OpenConnections

func (g *Gmetric) OpenConnections() []*net.UDPConn

OpenConnections creates an array of UDPConn objects for the specified servers

func (*Gmetric) SendMetric

func (g *Gmetric) SendMetric(name string, value string, metricType uint32, units string, slope uint32, tmax uint32, dmax uint32, group string)

SendMetric is an API backwards-compatibility wrapper

func (*Gmetric) SendMetricPackets

func (g *Gmetric) SendMetricPackets(name string, value string, metricType uint32, units string, slope uint32, tmax uint32, dmax uint32, group string, packetType PacketType, conn []*net.UDPConn)

SendMetricPackets transmits metric packets using the specified connections.

func (*Gmetric) SetLogger

func (g *Gmetric) SetLogger(l *syslog.Writer)

SetLogger sets external syslog.Writer object.

func (*Gmetric) SetVerbose

func (g *Gmetric) SetVerbose(v bool)

SetVerbose sets verbosity of library.

func (*Gmetric) TypeToString

func (g *Gmetric) TypeToString(t uint32) string

TypeToString converts a type constant, like VALUE_UNKNOWN or VALUE_INT, to its string representation.

type GmetricServer

type GmetricServer Server

GmetricServer API compatibility type

type PacketType

type PacketType uint

PacketType represents the type of data being transmitted

type Server

type Server struct {
	Server net.IP
	Port   int
}

Server represents a single Ganglia gmetric receiver.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL