metrics

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AvgCounter

type AvgCounter struct {
	Value float64
	Times int
}

func NewAvgCounter

func NewAvgCounter() *AvgCounter

func (*AvgCounter) AppendMeter

func (a *AvgCounter) AppendMeter(list []*v3.MeterData, name string, labels []*v3.Label) []*v3.MeterData

func (*AvgCounter) Calculate

func (a *AvgCounter) Calculate() float64

func (*AvgCounter) CusHalfOfMetrics

func (a *AvgCounter) CusHalfOfMetrics() Metrics

func (*AvgCounter) Increase

func (a *AvgCounter) Increase(val float64)

func (*AvgCounter) MergeAndClean

func (a *AvgCounter) MergeAndClean(other *AvgCounter)

type Counter

type Counter struct {
	Value int
}

func NewCounter

func NewCounter() *Counter

func (*Counter) AppendMeter

func (c *Counter) AppendMeter(list []*v3.MeterData, name string, labels []*v3.Label) []*v3.MeterData

func (*Counter) CusHalfOfMetrics

func (c *Counter) CusHalfOfMetrics() Metrics

func (*Counter) Get

func (c *Counter) Get() int

func (*Counter) Increase

func (c *Counter) Increase()

func (*Counter) MergeAndClean

func (c *Counter) MergeAndClean(other *Counter)

func (*Counter) String

func (c *Counter) String() string

type Histogram

type Histogram struct {
	Buckets []float64
	Values  []int
}

func NewHistogram

func NewHistogram(buckets []float64) *Histogram

func (*Histogram) AppendMeter

func (h *Histogram) AppendMeter(list []*v3.MeterData, name string, labels []*v3.Label) []*v3.MeterData

func (*Histogram) CusHalfOfMetrics

func (h *Histogram) CusHalfOfMetrics() Metrics

func (*Histogram) Increase

func (h *Histogram) Increase(val float64)

func (*Histogram) MergeAndClean

func (h *Histogram) MergeAndClean(other *Histogram)

type Metrics

type Metrics interface {
	AppendMeter(list []*agentv3.MeterData, name string, labels []*agentv3.Label) []*agentv3.MeterData
}

type Records

type Records interface {
	AppendLog(list []*logv3.LogData) []*logv3.LogData
}

type TopN

type TopN struct {
	MaxLength int
	List      *list.List
}

func NewTopN

func NewTopN(length int) *TopN

func (*TopN) AddRecord

func (t *TopN) AddRecord(data TopNData, duration int64)

func (*TopN) AppendData

func (t *TopN) AppendData(process api.ProcessInterface, traffic *base.ProcessTraffic, metricsBuilder *base.MetricsBuilder) int

func (*TopN) MergeAndClean

func (t *TopN) MergeAndClean(other *TopN)

type TopNData

type TopNData interface {
	Flush(duration int64, process api.ProcessInterface, traffic *base.ProcessTraffic, metricsBuilder *base.MetricsBuilder)
}

type TopNRecord

type TopNRecord struct {
	Duration int64
	Data     TopNData
}

Jump to

Keyboard shortcuts

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