metric

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 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 BaseMetrics

type BaseMetrics struct {
	Collector              MetricsCollector
	Logger                 *logrus.Logger
	VolumeFinder           types.VolumeFinder
	PowerMaxClients        map[string][]types.PowerMaxArray
	MetricsRecorder        types.MetricsRecorder
	MaxPowerMaxConnections int
}

BaseMetrics presents the base class of concrete metric classes

func NewBaseMetrics

func NewBaseMetrics(service types.Service) *BaseMetrics

NewBaseMetrics return BaseMetrics instance.

func (*BaseMetrics) ExportMetrics

func (m *BaseMetrics) ExportMetrics(ctx context.Context)

ExportMetrics collect and export metrics to Otel

func (*BaseMetrics) GetPowerMaxClient

func (m *BaseMetrics) GetPowerMaxClient(arrayID string) (types.PowerMaxClient, error)

GetPowerMaxClient return the first live PowerMaxClient based on the given arrayID

func (*BaseMetrics) TimeSince

func (m *BaseMetrics) TimeSince(start time.Time, fName string)

TimeSince will log the amount of time spent in a given function

type CapacityMetrics

type CapacityMetrics struct {
	*BaseMetrics
}

CapacityMetrics CapacityMetrics

func CreateCapacityMetricsInstance

func CreateCapacityMetricsInstance(service types.Service) *CapacityMetrics

CreateCapacityMetricsInstance return a singleton instance of CapacityMetrics.

func (*CapacityMetrics) Collect

func (m *CapacityMetrics) Collect(ctx context.Context) error

Collect metric collection and processing

type MetricsCollector

type MetricsCollector interface {
	Collect(ctx context.Context) error
}

MetricsCollector interface for metric collect

type MetricsRecorderWrapper

type MetricsRecorderWrapper struct {
	Meter types.AsyncMetricCreator
}

MetricsRecorderWrapper contains data used for pushing metrics data

func (*MetricsRecorderWrapper) RecordNumericMetrics

func (mrw *MetricsRecorderWrapper) RecordNumericMetrics(ctx context.Context, metrics []types.NumericMetric) error

RecordNumericMetrics record metrics using Otel's InstrumentProvider

type PerformanceMetrics

type PerformanceMetrics struct {
	*BaseMetrics
}

PerformanceMetrics performance metrics

func CreatePerformanceMetricsInstance

func CreatePerformanceMetricsInstance(service types.Service) *PerformanceMetrics

CreatePerformanceMetricsInstance return a singleton instance of PerformanceMetrics.

func (*PerformanceMetrics) Collect

func (m *PerformanceMetrics) Collect(ctx context.Context) error

Collect performance metric collection and processing

Jump to

Keyboard shortcuts

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