wf

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Centroid added in v1.12.0

type Centroid struct {
	Value float64
	Count float64
}

func CentroidRate added in v1.12.0

func CentroidRate(curr, prev []Centroid, duration time.Duration) []Centroid

type Distribution added in v1.12.0

type Distribution struct {
	Cumulative bool

	Source    string
	Centroids []Centroid
	Timestamp time.Time
	// contains filtered or unexported fields
}

func NewCumulativeDistribution added in v1.12.0

func NewCumulativeDistribution(name string, source string, tags map[string]string, centroids []Centroid, timestamp time.Time) *Distribution

NewCumulativeDistribution encodes prometheus style distribution.

func NewFrequencyDistribution added in v1.12.0

func NewFrequencyDistribution(name string, source string, tags map[string]string, centroids []Centroid, timestamp time.Time) *Distribution

NewFrequencyDistribution encodes a WF style distribution.

func (*Distribution) AddTags added in v1.12.0

func (d *Distribution) AddTags(tags map[string]string)

func (*Distribution) Clone added in v1.12.0

func (d *Distribution) Clone() *Distribution

func (*Distribution) Equals added in v1.12.0

func (d *Distribution) Equals(b *Distribution) bool

func (*Distribution) FilterTags added in v1.12.0

func (d *Distribution) FilterTags(pred func(string) bool)

func (*Distribution) Key added in v1.12.0

func (d *Distribution) Key() DistributionHash

func (*Distribution) Name added in v1.12.0

func (d *Distribution) Name() string

func (*Distribution) OverrideTag added in v1.12.0

func (d *Distribution) OverrideTag(name, value string)

func (*Distribution) Points added in v1.12.0

func (d *Distribution) Points() int

func (*Distribution) Rate added in v1.12.0

func (d *Distribution) Rate(prev *Distribution) *Distribution

func (*Distribution) Send added in v1.12.0

func (d *Distribution) Send(to Sender) error

func (*Distribution) SetSource added in v1.12.0

func (d *Distribution) SetSource(source string)

func (*Distribution) Tags added in v1.12.0

func (d *Distribution) Tags() map[string]string

func (*Distribution) ToFrequency added in v1.12.0

func (d *Distribution) ToFrequency() *Distribution

type DistributionHash added in v1.12.0

type DistributionHash [32]byte

type Incrementer

type Incrementer interface {
	Inc(int642 int64)
}

type LabelPair

type LabelPair struct {
	Name  *string
	Value *string
}

type Metric added in v1.12.0

type Metric interface {
	Name() string
	Tags() map[string]string
	FilterTags(pred func(string) bool)
	OverrideTag(name, value string)
	AddTags(tags map[string]string)
	SetSource(source string)
	Send(to Sender) error
	Points() int
}

func Filter

func Filter(filter filter.Filter, filtered Incrementer, point Metric) Metric

Filter returns nil when it does not match the supplied filter.Filter. Filter increments the Incrementor when filtering. Filter filters the tags on a matched point.

func FilterAppend

func FilterAppend(filter filter.Filter, filtered Incrementer, points []Metric, point Metric) []Metric

FilterAppend appends the point to points when Filter does not return nil

type Point

type Point struct {
	Metric    string
	Value     float64
	Timestamp int64
	Source    string
	// contains filtered or unexported fields
}

Point is a single point in Wavefront metric format.

func NewPoint

func NewPoint(metric string, value float64, timestamp int64, source string, tags map[string]string) *Point

func (*Point) AddTag

func (m *Point) AddTag(name, value string)

AddTag adds a tag if it does not already exist

func (*Point) AddTags

func (m *Point) AddTags(tags map[string]string)

AddTags adds any tags that do not already exist

func (*Point) FilterTags

func (m *Point) FilterTags(pred func(string) bool)

func (*Point) Name added in v1.12.0

func (m *Point) Name() string

func (*Point) OverrideTag

func (m *Point) OverrideTag(name, value string)

OverrideTag sets a tag regardless of whether it already exists

func (*Point) Points added in v1.12.0

func (m *Point) Points() int

func (*Point) Send added in v1.12.0

func (m *Point) Send(to Sender) error

func (*Point) SetLabelPairs

func (m *Point) SetLabelPairs(pairs []LabelPair)

func (*Point) SetSource added in v1.12.0

func (m *Point) SetSource(source string)

func (*Point) SetTags

func (m *Point) SetTags(tags map[string]string)

func (*Point) Tags

func (m *Point) Tags() map[string]string

type Sender added in v1.12.0

type Sender interface {
	SendMetric(name string, value float64, ts int64, source string, tags map[string]string) error
	SendDistribution(name string, centroids []histogram.Centroid, hgs map[histogram.Granularity]bool, ts int64, source string, tags map[string]string) error
}

Jump to

Keyboard shortcuts

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