Documentation ¶
Index ¶
- Constants
- type Number
- type RunningStats
- func (rs *RunningStats) AddValue(v float64)
- func (rs *RunningStats) Count() int64
- func (rs *RunningStats) Lower() float64
- func (rs *RunningStats) Mean() float64
- func (rs *RunningStats) Median() float64
- func (rs *RunningStats) Percentile(n float64) float64
- func (rs *RunningStats) Stddev() float64
- func (rs *RunningStats) Sum() float64
- func (rs *RunningStats) Upper() float64
- func (rs *RunningStats) Variance() float64
- type Statsd
Constants ¶
View Source
const ( // UDPMaxPacketSize is the UDP packet limit, see // https://en.wikipedia.org/wiki/User_Datagram_Protocol#Packet_structure UDPMaxPacketSize int = 64 * 1024 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Number ¶ added in v1.19.2
type Number float64
Number will get parsed as an int or float depending on what is passed
func (*Number) UnmarshalTOML ¶ added in v1.19.2
type RunningStats ¶
type RunningStats struct { PercLimit int // cache if we have sorted the list so that we never re-sort a sorted list, // which can have very bad performance. SortedPerc bool MedLimit int MedInsertIndex int // contains filtered or unexported fields }
RunningStats calculates a running mean, variance, standard deviation, lower bound, upper bound, count, and can calculate estimated percentiles. It is based on the incremental algorithm described here:
https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
func (*RunningStats) AddValue ¶
func (rs *RunningStats) AddValue(v float64)
func (*RunningStats) Count ¶
func (rs *RunningStats) Count() int64
func (*RunningStats) Lower ¶
func (rs *RunningStats) Lower() float64
func (*RunningStats) Mean ¶
func (rs *RunningStats) Mean() float64
func (*RunningStats) Median ¶ added in v1.24.0
func (rs *RunningStats) Median() float64
func (*RunningStats) Percentile ¶
func (rs *RunningStats) Percentile(n float64) float64
func (*RunningStats) Stddev ¶
func (rs *RunningStats) Stddev() float64
func (*RunningStats) Sum ¶ added in v1.14.0
func (rs *RunningStats) Sum() float64
func (*RunningStats) Upper ¶
func (rs *RunningStats) Upper() float64
func (*RunningStats) Variance ¶
func (rs *RunningStats) Variance() float64
type Statsd ¶
type Statsd struct { // Protocol used on listener - udp or tcp Protocol string `toml:"protocol"` // Address & Port to serve from ServiceAddress string `toml:"service_address"` // Number of messages allowed to queue up in between calls to Gather. If this // fills up, packets will get dropped until the next Gather interval is ran. AllowedPendingMessages int `toml:"allowed_pending_messages"` NumberWorkerThreads int `toml:"number_workers_threads"` // Percentiles specifies the percentiles that will be calculated for timing // and histogram stats. Percentiles []Number `toml:"percentiles"` PercentileLimit int `toml:"percentile_limit"` DeleteGauges bool `toml:"delete_gauges"` DeleteCounters bool `toml:"delete_counters"` DeleteSets bool `toml:"delete_sets"` DeleteTimings bool `toml:"delete_timings"` ConvertNames bool `toml:"convert_names"` FloatCounters bool `toml:"float_counters"` FloatTimings bool `toml:"float_timings"` FloatSets bool `toml:"float_sets"` EnableAggregationTemporality bool `toml:"enable_aggregation_temporality"` // MetricSeparator is the separator between parts of the metric name. MetricSeparator string `toml:"metric_separator"` // This flag enables parsing of tags in the dogstatsd extension to the // statsd protocol (http://docs.datadoghq.com/guides/dogstatsd/) ParseDataDogTags bool `toml:"parse_data_dog_tags" deprecated:"1.10.0;1.35.0;use 'datadog_extensions' instead"` // Parses extensions to statsd in the datadog statsd format // currently supports metrics and datadog tags. // http://docs.datadoghq.com/guides/dogstatsd/ DataDogExtensions bool `toml:"datadog_extensions"` // Parses distribution metrics in the datadog statsd format. // Requires the DataDogExtension flag to be enabled. // https://docs.datadoghq.com/developers/metrics/types/?tab=distribution#definition DataDogDistributions bool `toml:"datadog_distributions"` // Either to keep or drop the container id as tag. // Requires the DataDogExtension flag to be enabled. // https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/?tab=metrics#dogstatsd-protocol-v12 DataDogKeepContainerTag bool `toml:"datadog_keep_container_tag"` // UDPPacketSize is deprecated, it's only here for legacy support // we now always create 1 max size buffer and then copy only what we need // into the in channel // see https://github.com/influxdata/telegraf/pull/992 UDPPacketSize int `toml:"udp_packet_size" deprecated:"0.12.1;1.35.0;option is ignored"` ReadBufferSize int `toml:"read_buffer_size"` SanitizeNamesMethod string `toml:"sanitize_name_method"` Templates []string `toml:"templates"` // bucket -> influx templates MaxTCPConnections int `toml:"max_tcp_connections"` TCPKeepAlive bool `toml:"tcp_keep_alive"` TCPKeepAlivePeriod *config.Duration `toml:"tcp_keep_alive_period"` // Max duration for each metric to stay cached without being updated. MaxTTL config.Duration `toml:"max_ttl"` Log telegraf.Logger `toml:"-"` sync.Mutex // Protocol listeners UDPlistener *net.UDPConn TCPlistener *net.TCPListener // Internal statistics counters MaxConnections selfstat.Stat CurrentConnections selfstat.Stat TotalConnections selfstat.Stat TCPPacketsRecv selfstat.Stat TCPBytesRecv selfstat.Stat UDPPacketsRecv selfstat.Stat UDPPacketsDrop selfstat.Stat UDPBytesRecv selfstat.Stat ParseTimeNS selfstat.Stat PendingMessages selfstat.Stat MaxPendingMessages selfstat.Stat // contains filtered or unexported fields }
Statsd allows the importing of statsd and dogstatsd data.
func (*Statsd) SampleConfig ¶
Click to show internal directories.
Click to hide internal directories.