statsd

package
v0.0.0-...-9634a1a Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricInc    = "Inc"
	MetricTiming = "Timing"
)

Variables

This section is empty.

Functions

func GetResCount

func GetResCount[T model.Resource | k8sgathermodel.KubernetesGatherResource](res T) map[string][]int

func NewStatsdMonitor

func NewStatsdMonitor(cfg config.StatsdConfig) error

Types

type CloudStatsd

type CloudStatsd struct {
	APICount map[string][]int
	APICost  map[string][]int
	ResCount map[string][]int
}

func NewCloudStatsd

func NewCloudStatsd() CloudStatsd

func (*CloudStatsd) RefreshAPICost

func (c *CloudStatsd) RefreshAPICost(key string, start time.Time)

func (*CloudStatsd) RefreshAPICount

func (c *CloudStatsd) RefreshAPICount(key string, count int)

func (*CloudStatsd) RefreshResCount

func (c *CloudStatsd) RefreshResCount(resource model.Resource)

type CloudTaskStatsd

type CloudTaskStatsd struct {
	TaskCost map[string][]int
}

type GenesisStatsd

type GenesisStatsd struct {
	K8SInfoDelay map[string][]int
}

type StatsdElement

type StatsdElement struct {
	// metric type (specified by a constant)
	MetricType string
	// influxdb measurement name (if there is a configuration prefix, the prefix must be added)
	MetricName string
	// the default value is 1.0, usually no modification is required
	Rate float32
	// use global tags
	UseGlobalTag bool
	// private tag key
	PrivateTagKey string
	// private tag value to count
	// when the type is Timing,unit is: ms
	// since this is a map, concurrent writing is not supported and locks can be used if required.
	// future: it might be useful sync.Map
	PrivateTagValueToCount map[string][]int
}

func GetCloudStatsd

func GetCloudStatsd(cloud CloudStatsd) []StatsdElement

func GetCloudTaskStatsd

func GetCloudTaskStatsd(cloud CloudTaskStatsd) []StatsdElement

func GetGenesisStatsd

func GetGenesisStatsd(genesis GenesisStatsd) []StatsdElement

type StatsdMonitor

type StatsdMonitor struct {
	// contains filtered or unexported fields
}
var MetaStatsd *StatsdMonitor

func (*StatsdMonitor) RegisterStatsdTable

func (s *StatsdMonitor) RegisterStatsdTable(statter Statsdtable)

type StatsdStatter

type StatsdStatter struct {
	Element    []StatsdElement
	GlobalTags map[string]string
}

type Statsdtable

type Statsdtable interface {
	GetStatter() StatsdStatter
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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