metrics

package
v1.15.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MinioDesc = "Minio disk usage"
View Source
const NFSDesc = "NFS disk usage"
View Source
const PodMetricsTimeout = 5 * time.Minute
View Source
const PodResourceDesc = "Resource consumption"
View Source
const TimeCaseDesc = "Time cost"

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric

type Metric interface {
	Update() error
	GetMetricsName() string
	GetMetrics() map[string]string
}

Metric is an interface for metrics that test needs.

type MetricsCollector

type MetricsCollector struct {
	Metrics        []Metric   // metrics need update periodically
	OneTimeMetrics []Metric   // OneTimeMetrics just update one time
	Mu             sync.Mutex // mutex for protecting shared resources
}

MetricsCollector is a singleton struct for collecting metrics.

func GetMetricsCollector

func GetMetricsCollector() *MetricsCollector

GetMetricsCollector returns the singleton instance of MetricsCollector

func (*MetricsCollector) GetMetrics

func (m *MetricsCollector) GetMetrics() map[string]interface{}

GetMetrics returns the metrics from all metrics

func (*MetricsCollector) RegisterMetric

func (m *MetricsCollector) RegisterMetric(metric Metric)

RegisterMetric adds a metric to the MetricsCollector

func (*MetricsCollector) RegisterOneTimeMetric

func (m *MetricsCollector) RegisterOneTimeMetric(metric Metric)

RegisterOneTimeMetric adds a one-time metric to the MetricsCollector

func (*MetricsCollector) UpdateMetrics

func (m *MetricsCollector) UpdateMetrics()

UpdateMetrics periodically updates the metrics for all metrics

func (*MetricsCollector) UpdateOneTimeMetrics

func (m *MetricsCollector) UpdateOneTimeMetrics()

UpdateOneTimeMetrics periodically updates the one-time metrics for all metrics

type MinioMetrics

type MinioMetrics struct {
	Metrics              map[string]string
	CloudCredentialsFile string
	BslBucket            string
	BslPrefix            string
	BslConfig            string
}

func (*MinioMetrics) GetMetrics

func (m *MinioMetrics) GetMetrics() map[string]string

func (*MinioMetrics) GetMetricsName

func (m *MinioMetrics) GetMetricsName() string

func (*MinioMetrics) Update

func (m *MinioMetrics) Update() error

type NFSMetrics

type NFSMetrics struct {
	Metrics       map[string]string
	NFSServerPath string
	Ctx           context.Context
}

func (*NFSMetrics) GetMetrics

func (n *NFSMetrics) GetMetrics() map[string]string

func (*NFSMetrics) GetMetricsName

func (n *NFSMetrics) GetMetricsName() string

func (*NFSMetrics) Update

func (n *NFSMetrics) Update() error

type PodMetrics

type PodMetrics struct {
	Client  *metricsclientset.Clientset
	Metrics map[string]int64

	PodName, Namespace string
	Ctx                context.Context
	// contains filtered or unexported fields
}

func (*PodMetrics) GetMetrics

func (p *PodMetrics) GetMetrics() map[string]string

func (*PodMetrics) GetMetricsName

func (p *PodMetrics) GetMetricsName() string

func (*PodMetrics) Update

func (p *PodMetrics) Update() error

type TimeMetrics

type TimeMetrics struct {
	Name     string
	TimeInfo map[string]TimeSpan // metric name : start timestamp
}

func (*TimeMetrics) End

func (t *TimeMetrics) End(name string)

func (*TimeMetrics) GetMetrics

func (t *TimeMetrics) GetMetrics() map[string]string

func (*TimeMetrics) GetMetricsName

func (t *TimeMetrics) GetMetricsName() string

func (*TimeMetrics) Start

func (t *TimeMetrics) Start(name string)

func (*TimeMetrics) Update

func (t *TimeMetrics) Update() error

type TimeSpan added in v1.13.0

type TimeSpan struct {
	Start time.Time
	End   time.Time
}

Jump to

Keyboard shortcuts

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