common

package
v0.0.0-...-f5e6093 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 64 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKSMLatencyMeasurement

func CreateKSMLatencyMeasurement() measurement.Measurement

CreateKSMLatencyMeasurement creates a new Kube State Metrics Measurement.

func CreatePrometheusMeasurement

func CreatePrometheusMeasurement(gatherer Gatherer) measurement.Measurement

func HistogramSub

func HistogramSub(finalHist, initialHist *measurementutil.Histogram) *measurementutil.Histogram

HistogramSub is a helper function to substract two histograms

func SetQuantileFromHistogram

func SetQuantileFromHistogram(metric *measurementutil.LatencyMetric, hist *measurementutil.Histogram) error

SetQuantileFromHistogram sets quantile of LatencyMetric from Histogram

Types

type ContainerInfo

type ContainerInfo struct {
	Container string `yaml:"container"`
	Pod       string `yaml:"pod"`
	Namespace string `yaml:"namespace"`
}

type ContainerRestartsInfo

type ContainerRestartsInfo struct {
	ContainerInfo `yaml:",inline"`
	RestartCount  int `yaml:"restartCount"`
}

type Gatherer

type Gatherer interface {
	Configure(config *measurement.Config) error
	Gather(executor QueryExecutor, startTime, endTime time.Time, config *measurement.Config) ([]measurement.Summary, error)
	IsEnabled(config *measurement.Config) bool
	String() string
}

Gatherer is an interface for measurements based on Prometheus metrics. Those measurments don't require any preparation. It's assumed Prometheus is up, running and instructed to scrape required metrics in the test cluster (please see clusterloader2/pkg/prometheus/manifests).

type GenericQuery

type GenericQuery struct {
	Name           string
	Query          string
	Threshold      *float64
	LowerBound     bool
	RequireSamples bool
}

func (*GenericQuery) Validate

func (q *GenericQuery) Validate() error

type LoadBalancerNodeSyncMeasurement

type LoadBalancerNodeSyncMeasurement struct {
	// contains filtered or unexported fields
}

func (*LoadBalancerNodeSyncMeasurement) Dispose

func (s *LoadBalancerNodeSyncMeasurement) Dispose()

func (*LoadBalancerNodeSyncMeasurement) Execute

LoadBalancerNodeSyncMeasurement takes measurement of node sync latency for selected lb type services. This measurement only works for K8s 1.19 as it depends on the ExcludeNodeForLoadbalancer label. Services can be specified by field and/or label selectors. If namespace is not passed by parameter, all LoadBalancer type service with all-namespace scope is assumed. "measure" action triggers nodesync and observation of nodesync completion for selected LB services. "gather" returns node sync latency summary.

func (*LoadBalancerNodeSyncMeasurement) String

type QueryExecutor

type QueryExecutor interface {
	Query(query string, queryTime time.Time) ([]*model.Sample, error)
}

QueryExecutor is an interface for queryning Prometheus server.

type StartParams

type StartParams struct {
	MetricName    string
	MetricVersion string
	Queries       []GenericQuery
	Unit          string
	Dimensions    []string
}

StartParams represents configuration that can be passed as params with action: start.

func (*StartParams) Validate

func (p *StartParams) Validate() error

TODO(mborsz): github.com/go-playground/validator or similar project?

Directories

Path Synopsis
Package network captures network performance metrics for protocol TCP,UDP,HTTP etc.
Package network captures network performance metrics for protocol TCP,UDP,HTTP etc.

Jump to

Keyboard shortcuts

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