log

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalMetricsPrefix string
View Source
var Logger *log.Logger

Logger ...

Functions

func CreateGauge

func CreateGauge(metricName string, value func() int64)

CreateGauge creates a new gauge that reports values returned by the given function.

func CreateMetricsRegistry

func CreateMetricsRegistry() metrics.Registry

CreateMetricsRegistry creates a Child Registry with the hostname as prefix

func CreateTopicMeterMap

func CreateTopicMeterMap(fmtString string, topics []string) map[string]metrics.Meter

CreateTopicMeterMap creates a map of Meters (topic -> Meter).

func GetCounter

func GetCounter(metricsName string) metrics.Counter

GetCounter creates a new counter or returns the existing counter with the given name from the default registry.

func GetGauge

func GetGauge(metricName string) metrics.Gauge

CreateGauge creates a new gauge or returns the existing gauge with the given name from the default registry.

func GetHistogram

func GetHistogram(metricName string) metrics.Histogram

GetHistogram creates a new histogram (or returns an existing one with the given name) with an exponential decay sample with default parameters.

func GetHostAddr

func GetHostAddr(host string) *net.TCPAddr

GetHostAddr returns the TCPAddr for the given host

func GetHostname

func GetHostname() string

GetHostname returns the machine's host name, either as determined by the system, or by using the first IP address of the first non-loopback network interface. If the hostname can not be determined, “unkown-ip-address” is returned.

func GetMeter

func GetMeter(metricName string) metrics.Meter

GetMeter creates a new meter or returns the existing meter with the given name from the default registry.

func InitGraylog

func InitGraylog(ip, port, facility string)

func MeterMapToSlice

func MeterMapToSlice(meterMap map[string]metrics.Meter) []metrics.Meter

func SetGlobalMetricsPrefix

func SetGlobalMetricsPrefix(name string)

SetGlobalMetricsPrefix set prefix for graphite metrics Should be called on application init phase

func StartReporter

func StartReporter(graphiteHost string, appName string)

StartReporter starts the graphite reporter

Types

This section is empty.

Jump to

Keyboard shortcuts

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