common

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	Config Config
	Type   string
	// ProcessTags is called on a map of all tags for each metric and returns a slice representation
	// of those tags that should be sent. No tags are send in case of ProcessTags being null
	ProcessTags func(map[string]string) []string

	Logger logrus.FieldLogger
	// contains filtered or unexported fields
}

Collector sends result data to statsd daemons with the ability to send to datadog as well

func (*Collector) Collect

func (c *Collector) Collect(containers []stats.SampleContainer)

Collect metrics

func (*Collector) GetRequiredSystemTags

func (c *Collector) GetRequiredSystemTags() stats.SystemTagSet

GetRequiredSystemTags Return the required system sample tags for the specific collector

func (*Collector) Init

func (c *Collector) Init() (err error)

Init sets up the collector

func (c *Collector) Link() string

Link returns the address of the client

func (*Collector) Run

func (c *Collector) Run(ctx context.Context)

Run the collector

func (*Collector) SetRunStatus

func (c *Collector) SetRunStatus(status lib.RunStatus)

SetRunStatus does nothing in statsd collector

type Config

type Config interface {
	GetAddr() null.String
	GetBufferSize() null.Int
	GetNamespace() null.String
	GetPushInterval() types.NullDuration
}

Config is the common configuration interface for StatsD/Datadog.

type Sample

type Sample struct {
	Type   stats.MetricType  `json:"type"`
	Metric string            `json:"metric"`
	Time   time.Time         `json:"time"`
	Value  float64           `json:"value"`
	Tags   map[string]string `json:"tags,omitempty"`
}

Sample defines a sample type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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