metrics

package
v2.33.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateMetrics added in v2.25.0

func GenerateMetrics(metricsCollections Collections) []*proto.StatsEntity

func GenerateMetricsReportBundle added in v2.25.0

func GenerateMetricsReportBundle(entities []*StatsEntityWrapper) core.Payload

func GetCalculationMap added in v2.20.0

func GetCalculationMap() map[string]string

func GetTimeMetrics added in v2.24.0

func GetTimeMetrics(times []float64, metricType string) float64

func NewStatsEntity

func NewStatsEntity(dims []*proto.Dimension, samples []*proto.SimpleMetric) *proto.StatsEntity

Types

type Collections

type Collections struct {
	Count int // this is the number of collections run.  Will use this to calculate the average.
	Data  map[string]PerDimension
}

func SaveCollections

func SaveCollections(metricsCollections Collections, reports ...*proto.MetricsReport) Collections

SaveCollections loops through one or more reports and get all the raw metrics for the Collections Note this function operate on the Collections struct data directly.

type Collector

type Collector interface {
	Collect(ctx context.Context, wg *sync.WaitGroup, m chan<- *StatsEntityWrapper)
	UpdateConfig(config *config.Config)
}

type CommonDim

type CommonDim struct {
	SystemId, Hostname, InstanceTags, InstanceGroup,
	DisplayName, NginxId string

	PublishedAPI, NginxType, NginxBuild, NginxVersion,
	NginxBinPath, NginxConfPath string

	NginxAccessLogPaths []string
}

CommonDim is the set of dimensions that apply to all metrics

func NewCommonDim

func NewCommonDim(hostInfo *proto.HostInfo, conf *config.Config, nginxId string) *CommonDim

func (*CommonDim) ToDimensions

func (c *CommonDim) ToDimensions() []*proto.Dimension

ToDimensions returns the set of common agent dimensions Ensures dimensions are generated in the same order every time, as required by control plane

type MetricsHandler

type MetricsHandler func(float64, int) float64

type MetricsReportBundle added in v2.25.0

type MetricsReportBundle struct {
	Data []*proto.MetricsReport
}

type NginxCollectorConfig

type NginxCollectorConfig struct {
	NginxId            string
	StubStatus         string
	PlusAPI            string
	BinPath            string
	ConfPath           string
	CollectionInterval time.Duration
	AccessLogs         []string
	ErrorLogs          []string
	ClientVersion      int
}

type NginxSource

type NginxSource interface {
	Collect(ctx context.Context, wg *sync.WaitGroup, m chan<- *StatsEntityWrapper)
	Update(dimensions *CommonDim, collectorConf *NginxCollectorConfig)
	Stop()
}

type PerDimension

type PerDimension struct {
	Dimensions    []*proto.Dimension
	RunningSumMap map[string]float64
}

type Source

type Source interface {
	Collect(ctx context.Context, wg *sync.WaitGroup, m chan<- *StatsEntityWrapper)
}

type StatsEntityWrapper added in v2.25.0

type StatsEntityWrapper struct {
	Type proto.MetricsReport_Type
	Data *proto.StatsEntity
}

func NewStatsEntityWrapper added in v2.25.0

func NewStatsEntityWrapper(dims []*proto.Dimension, samples []*proto.SimpleMetric, seType proto.MetricsReport_Type) *StatsEntityWrapper

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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