Versions in this module Expand all Collapse all v1 v1.0.0 Nov 13, 2015 Changes in this version + const AuthTypeConfigToken + const AuthTypeNone + const ConnPoolTypeNone + const ConnPoolTypeTcp + const ConnPoolTypeUnix + const MaximumMetricLength + const Megabyte + const MetricTypeCounter + const MetricTypeGauge + const MetricTypeSet + const MetricTypeTimer + const MetricTypeUnknown + const MinimumLengthMessage + const NamespaceTypeCounter + const NamespaceTypeGauge + const NamespaceTypeRate + const NamespaceTypeSet + const NamespaceTypeTimer + const NilConnPanicMsg + const RelayTypeCarbon + const RelayTypeMock + const RuneAt + const RuneColon + const RuneNull + const RunePipe + const RuneSpace + const SeparatorNamespaceValue + const SeparatorTypeSample + const SeparatorValueType + const SocketTypeTcp + const SocketTypeUdp + const SocketTypeUnix + func AggregateMetric(metrics map[string]Metric, metric Metric) + func BlockForSocket(socket Socket, timeout time.Duration) + func GetHostname(defaultValue string) (hostname string) + func ListenForSignals(finishChannel chan int, config *ConfigValues, configFile *string, ...) + func ParseMetrics(parseChannel chan string, relayChannel chan *Metric, auth Auth, logger Logger, ...) + func PrepareFlushMetrics(metrics map[string]Metric, config *ConfigValues, flushStart time.Time, ...) + func PrepareRuntimeMetrics(metrics map[string]Metric, config *ConfigValues) + func ProcessMetric(metric *Metric, flushDuration time.Duration, quantiles []int, logger Logger) + func RelayAllMetrics(relay MetricRelay, metrics map[string]Metric, logger Logger) + func RelayMetrics(relay MetricRelay, relayChannel chan *Metric, logger Logger, ...) + type Auth interface + Authenticate func(metric *string) (bool, error) + func CreateAuth(config ConfigValues) Auth + type AuthConfigToken struct + Tokens map[string]bool + func (a AuthConfigToken) Authenticate(metric *string) (bool, error) + type AuthNone struct + func (a AuthNone) Authenticate(metric *string) (bool, error) + type CarbonRelay struct + ConnectionPool *ConnectionPool + FlushInterval time.Duration + Percentile []int + Prefixes map[int]string + Suffixes map[int]string + func (c *CarbonRelay) SetPrefixesAndSuffixes(config ConfigValues) + func (c CarbonRelay) ApplyPrefixAndSuffix(namespace string, metricType int) string + func (c CarbonRelay) Relay(metric Metric, logger Logger) bool + type ConfigValues struct + Carbon struct{ ... } + Connection struct{ ... } + Debug struct{ ... } + Namespace struct{ ... } + Relay struct{ ... } + Service struct{ ... } + Stats struct{ ... } + func CreateConfig(filePath string) (ConfigValues, error) + func (config *ConfigValues) LoadFile(filePath string) error + type ConnectionPool struct + Addr string + Connections chan net.Conn + ErrorCount int + Size int + Timeout time.Duration + Type int + func CreateConnectionPool(size int, addr string, connType int, timeout time.Duration, logger Logger) (*ConnectionPool, error) + func (pool *ConnectionPool) CreateConnection(logger Logger) (bool, error) + func (pool *ConnectionPool) GetConnection(logger Logger) (net.Conn, error) + func (pool *ConnectionPool) ReleaseConnection(conn net.Conn, recreate bool, logger Logger) (bool, error) + type Logger struct + Error *log.Logger + Info *log.Logger + Trace *log.Logger + Warning *log.Logger + func CreateLogger(traceHandle io.Writer, infoHandle io.Writer, warningHandle io.Writer, ...) *Logger + type Metric struct + AllValues ValueSlice + FlushTime int + Key string + LastFlushed int + LastValue float64 + MaxValue float64 + MeanValue float64 + MedianValue float64 + MetricType int + MinValue float64 + Quantiles []MetricQuantile + SampleRate float64 + TotalHits float64 + ValuesPerSecond float64 + func CreateSimpleMetric(key string, value float64, metricType int) *Metric + func ParseMetricString(metricString string) (*Metric, error) + type MetricQuantile struct + AllValues ValueSlice + Boundary float64 + Max float64 + Mean float64 + Median float64 + Quantile int + Sum float64 + type MetricRelay interface + Relay func(metric Metric, logger Logger) bool + func CreateRelay(config ConfigValues, logger Logger) MetricRelay + type MockRelay struct + FlushInterval time.Duration + Percentile []int + func (c MockRelay) Relay(metric Metric, logger Logger) bool + type NilConn struct + func (c NilConn) Close() error + func (c NilConn) LocalAddr() net.Addr + func (c NilConn) Read(b []byte) (n int, err error) + func (c NilConn) RemoteAddr() net.Addr + func (c NilConn) SetDeadline(t time.Time) error + func (c NilConn) SetReadDeadline(t time.Time) error + func (c NilConn) SetWriteDeadline(t time.Time) error + func (c NilConn) Write(b []byte) (n int, err error) + type Socket interface + Close func(logger Logger) + GetAddr func() string + Listen func(parseChannel chan string, logger Logger, config *ConfigValues) + SocketIsActive func() bool + func CreateSocket(socketType int, addr string) Socket + type SocketTcp struct + Addr string + Listener net.Listener + func (l *SocketTcp) Close(logger Logger) + func (l *SocketTcp) GetAddr() string + func (l *SocketTcp) Listen(parseChannel chan string, logger Logger, config *ConfigValues) + func (l *SocketTcp) SocketIsActive() bool + type SocketUdp struct + Addr string + Listener *net.UDPConn + func (l *SocketUdp) Close(logger Logger) + func (l *SocketUdp) GetAddr() string + func (l *SocketUdp) Listen(parseChannel chan string, logger Logger, config *ConfigValues) + func (l *SocketUdp) SocketIsActive() bool + type SocketUnix struct + Addr string + Listener net.Listener + func (l *SocketUnix) Close(logger Logger) + func (l *SocketUnix) GetAddr() string + func (l *SocketUnix) Listen(parseChannel chan string, logger Logger, config *ConfigValues) + func (l *SocketUnix) SocketIsActive() bool + type ValueSlice []float64 + func (values ValueSlice) Get(i int) float64 + func (values ValueSlice) Len() int + func (values ValueSlice) Less(i, j int) bool + func (values ValueSlice) Mean() (mean float64) + func (values ValueSlice) Median() (median float64) + func (values ValueSlice) Minmax() (min float64, max float64, err error) + func (values ValueSlice) Quantile(quantile float64) float64 + func (values ValueSlice) Sum() float64 + func (values ValueSlice) Swap(i, j int) + func (values ValueSlice) UniqueCount() int