Documentation ¶
Index ¶
- Constants
- Variables
- func GetLogicalCapacityAvailable(stats *types.Statistics) float64
- func GetLogicalCapacityInUse(stats *types.Statistics) float64
- func GetLogicalProvisioned(stats *types.Statistics) float64
- func GetSDCBandwidth(stats *types.SdcStatistics) (readBW float64, writeBW float64)
- func GetSDCIOPS(stats *types.SdcStatistics) (readIOPS float64, writeIOPS float64)
- func GetSDCLatency(stats *types.SdcStatistics) (readLatency float64, writeLatency float64)
- func GetTotalLogicalCapacity(stats *types.Statistics) float64
- func GetVolumeBandwidth(stats *types.VolumeStatistics) (readBW float64, writeBW float64)
- func GetVolumeIOPS(stats *types.VolumeStatistics) (readIOPS float64, writeIOPS float64)
- func GetVolumeLatency(stats *types.VolumeStatistics) (readLatency float64, writeLatency float64)
- type ArrayConnectionData
- type CapacityMetrics
- type ConfigurationReader
- type Float64UpDownCounterCreater
- type IDedPoolStatisticGetter
- type LeaderElector
- type MappedSDC
- type Metrics
- type MetricsRecorder
- type MetricsWrapper
- type NodeFinder
- type PowerFlexClient
- type PowerFlexService
- func (s *PowerFlexService) ExportVolumeStatistics(ctx context.Context, volumes []VolumeStatisticsGetter, ...)
- func (s *PowerFlexService) GetSDCStatistics(ctx context.Context, nodes []corev1.Node, sdcs []StatisticsGetter)
- func (s *PowerFlexService) GetSDCs(_ context.Context, client PowerFlexClient, sdcFinder SDCFinder) ([]StatisticsGetter, error)
- func (s *PowerFlexService) GetStorageClasses(_ context.Context, client PowerFlexClient, ...) ([]StorageClassMeta, error)
- func (s *PowerFlexService) GetStoragePoolStatistics(ctx context.Context, storageClassMetas []StorageClassMeta)
- func (s *PowerFlexService) GetVolumes(_ context.Context, sdcs []StatisticsGetter) ([]VolumeStatisticsGetter, error)
- type PowerFlexSystem
- type SDCFinder
- type SDCMeta
- type SDCMetricsRecord
- type Service
- type StatisticsGetter
- type StorageClassFinder
- type StorageClassInfo
- type StorageClassMeta
- type StoragePoolStatisticsGetter
- type VolumeFinder
- type VolumeMeta
- type VolumeMetricsRecord
- type VolumeStatisticsGetter
Constants ¶
const (
// DefaultMaxPowerFlexConnections is the number of workers that can query powerflex at a time
DefaultMaxPowerFlexConnections = 10
)
Variables ¶
var SystemFinder = func(client PowerFlexClient, id string, name string, href string) (PowerFlexSystem, error) {
return client.FindSystem(id, name, href)
}
SystemFinder is a function that will be used for finding a PowerFlexSystem by id, name, and href
Functions ¶
func GetLogicalCapacityAvailable ¶
func GetLogicalCapacityAvailable(stats *types.Statistics) float64
GetLogicalCapacityAvailable returns the unused user data in GB from the given storage pool statistics
func GetLogicalCapacityInUse ¶
func GetLogicalCapacityInUse(stats *types.Statistics) float64
GetLogicalCapacityInUse returns the used user data in GB from the given storage pool statistics
func GetLogicalProvisioned ¶
func GetLogicalProvisioned(stats *types.Statistics) float64
GetLogicalProvisioned returns the total volume size in GB from the given storage pool statistics
func GetSDCBandwidth ¶
func GetSDCBandwidth(stats *types.SdcStatistics) (readBW float64, writeBW float64)
GetSDCBandwidth returns the read and write bandwidth based on the given SDC statistics
func GetSDCIOPS ¶
func GetSDCIOPS(stats *types.SdcStatistics) (readIOPS float64, writeIOPS float64)
GetSDCIOPS returns the read and write IOPS based on the given SDC statistics
func GetSDCLatency ¶
func GetSDCLatency(stats *types.SdcStatistics) (readLatency float64, writeLatency float64)
GetSDCLatency returns the read and write latency based on the given SDC statistics
func GetTotalLogicalCapacity ¶
func GetTotalLogicalCapacity(stats *types.Statistics) float64
GetTotalLogicalCapacity returns the used + unused user data in GB from the given storage pool statistics
func GetVolumeBandwidth ¶
func GetVolumeBandwidth(stats *types.VolumeStatistics) (readBW float64, writeBW float64)
GetVolumeBandwidth returns the read and write bandwidth based on the given SDC statistics
func GetVolumeIOPS ¶
func GetVolumeIOPS(stats *types.VolumeStatistics) (readIOPS float64, writeIOPS float64)
GetVolumeIOPS returns the read and write IOPS based on the given SDC statistics
func GetVolumeLatency ¶
func GetVolumeLatency(stats *types.VolumeStatistics) (readLatency float64, writeLatency float64)
GetVolumeLatency returns the read and write latency based on the given SDC statistics
Types ¶
type ArrayConnectionData ¶
type ArrayConnectionData struct { SystemID string `json:"systemID"` Username string `json:"username"` Password string `json:"password"` Endpoint string `json:"endpoint"` Insecure bool `json:"insecure,omitempty"` IsDefault bool `json:"isDefault,omitempty"` SkipCertificateValidation bool `json:"skipCertificateValidation,omitempty"` }
ArrayConnectionData contains data required to connect to array
type CapacityMetrics ¶
type CapacityMetrics struct { TotalLogicalCapacity asyncfloat64.UpDownCounter LogicalCapacityAvailable asyncfloat64.UpDownCounter LogicalCapacityInUse asyncfloat64.UpDownCounter LogicalProvisioned asyncfloat64.UpDownCounter }
CapacityMetrics contains the metrics related to a capacity
type ConfigurationReader ¶
type ConfigurationReader struct{}
ConfigurationReader handles reading of the storage system configuration secret
func (*ConfigurationReader) GetStorageSystemConfiguration ¶
func (c *ConfigurationReader) GetStorageSystemConfiguration(file string) ([]ArrayConnectionData, error)
GetStorageSystemConfiguration returns a storage system from the configuration file If no default system is supplied, the first system in the list is returned
type Float64UpDownCounterCreater ¶
type Float64UpDownCounterCreater interface {
AsyncFloat64() asyncfloat64.InstrumentProvider
}
Float64UpDownCounterCreater creates a Float64UpDownCounter InstrumentProvider
type IDedPoolStatisticGetter ¶
type IDedPoolStatisticGetter struct { ID string Getter StoragePoolStatisticsGetter }
IDedPoolStatisticGetter offers PoolStatisticGetter with its corresponding pool ID
type LeaderElector ¶
LeaderElector will elect a leader
type Metrics ¶
type Metrics struct { ReadBW asyncfloat64.UpDownCounter WriteBW asyncfloat64.UpDownCounter ReadIOPS asyncfloat64.UpDownCounter WriteIOPS asyncfloat64.UpDownCounter ReadLatency asyncfloat64.UpDownCounter WriteLatency asyncfloat64.UpDownCounter }
Metrics contains the list of metrics data that is collected
type MetricsRecorder ¶
type MetricsRecorder interface { Record(ctx context.Context, meta interface{}, readBW, writeBW, readIOPS, writeIOPS, readLatency, writeLatency float64) error RecordCapacity(ctx context.Context, meta interface{}, totalLogicalCapacity, logicalCapacityAvailable, logicalCapacityInUse, logicalProvisioned float64) error }
MetricsRecorder supports recording I/O metrics
type MetricsWrapper ¶
type MetricsWrapper struct { Meter Float64UpDownCounterCreater Metrics sync.Map Labels sync.Map CapacityMetrics sync.Map }
MetricsWrapper contains data used for pushing metrics data
func (*MetricsWrapper) Record ¶
func (mw *MetricsWrapper) Record(ctx context.Context, meta interface{}, readBW, writeBW, readIOPS, writeIOPS, readLatency, writeLatency float64, ) error
Record will publish metrics data for a given instance
func (*MetricsWrapper) RecordCapacity ¶
func (mw *MetricsWrapper) RecordCapacity(ctx context.Context, meta interface{}, totalLogicalCapacity, logicalCapacityAvailable, logicalCapacityInUse, logicalProvisioned float64, ) error
RecordCapacity will publish capacity metrics for a given instance
type NodeFinder ¶
NodeFinder is a node finder that will query the Kubernetes API for a slice of cluster nodes
type PowerFlexClient ¶
type PowerFlexClient interface { Authenticate(*sio.ConfigConnect) (sio.Cluster, error) GetInstance(string) ([]*types.System, error) FindSystem(string, string, string) (*sio.System, error) GetStoragePool(href string) ([]*types.StoragePool, error) }
PowerFlexClient contains operations for a powerflex client
type PowerFlexService ¶
type PowerFlexService struct { MetricsWrapper MetricsRecorder MaxPowerFlexConnections int Logger *logrus.Logger }
PowerFlexService represents the service for getting SDC metrics data for a PowerFlex system
func (*PowerFlexService) ExportVolumeStatistics ¶
func (s *PowerFlexService) ExportVolumeStatistics(ctx context.Context, volumes []VolumeStatisticsGetter, volumeFinder VolumeFinder)
ExportVolumeStatistics records I/O statistics for the given list of Volumes
func (*PowerFlexService) GetSDCStatistics ¶
func (s *PowerFlexService) GetSDCStatistics(ctx context.Context, nodes []corev1.Node, sdcs []StatisticsGetter)
GetSDCStatistics records I/O statistics for the given list of SDCs
func (*PowerFlexService) GetSDCs ¶
func (s *PowerFlexService) GetSDCs(_ context.Context, client PowerFlexClient, sdcFinder SDCFinder) ([]StatisticsGetter, error)
GetSDCs returns a slice of SDCs
func (*PowerFlexService) GetStorageClasses ¶
func (s *PowerFlexService) GetStorageClasses(_ context.Context, client PowerFlexClient, storageClassFinder StorageClassFinder) ([]StorageClassMeta, error)
GetStorageClasses returns a list of StorageClassMeta
func (*PowerFlexService) GetStoragePoolStatistics ¶
func (s *PowerFlexService) GetStoragePoolStatistics(ctx context.Context, storageClassMetas []StorageClassMeta)
GetStoragePoolStatistics records the capacity metrics for a slice of StorageClassMeta
func (*PowerFlexService) GetVolumes ¶
func (s *PowerFlexService) GetVolumes(_ context.Context, sdcs []StatisticsGetter) ([]VolumeStatisticsGetter, error)
GetVolumes returns all unique, mapped volumes in sdcs
type PowerFlexSystem ¶
PowerFlexSystem contains operations for a powerflex system
type SDCMeta ¶
SDCMeta is meta data for a specific SDC
func GetSDCMeta ¶
GetSDCMeta returns SDC meta information from a goscaleio SDC This function is exported for direct testing
type SDCMetricsRecord ¶
type SDCMetricsRecord struct {
// contains filtered or unexported fields
}
SDCMetricsRecord used for holding output of the SDC stat query results
type Service ¶
type Service interface { GetSDCs(context.Context, PowerFlexClient, SDCFinder) ([]StatisticsGetter, error) GetSDCStatistics(context.Context, []corev1.Node, []StatisticsGetter) GetVolumes(context.Context, []StatisticsGetter) ([]VolumeStatisticsGetter, error) ExportVolumeStatistics(context.Context, []VolumeStatisticsGetter, VolumeFinder) GetStorageClasses(ctx context.Context, client PowerFlexClient, storageClassFinder StorageClassFinder) ([]StorageClassMeta, error) GetStoragePoolStatistics(ctx context.Context, storageClassMetas []StorageClassMeta) }
Service contains operations that would be used to interact with a PowerFlex system
type StatisticsGetter ¶
type StatisticsGetter interface { GetStatistics() (*types.SdcStatistics, error) GetVolume() ([]*types.Volume, error) FindVolumes() ([]*sio.Volume, error) }
StatisticsGetter supports getting statistics
type StorageClassFinder ¶
type StorageClassFinder interface {
GetStorageClasses() ([]v1.StorageClass, error)
}
StorageClassFinder is used to find storage classes in kubernetes
type StorageClassInfo ¶
type StorageClassInfo struct { ID string Name string Driver string StorageSystemID string StoragePools []string }
StorageClassInfo is meta data about a storage class and contains the associated PowerFlex storage pool names
type StorageClassMeta ¶
type StorageClassMeta struct { ID string Name string Driver string StorageSystemID string StoragePools map[string]StoragePoolStatisticsGetter }
StorageClassMeta is the same as StorageClassInfo except it contains a map of PowerFlex storage pool IDs to goscaleio storage pool structs
type StoragePoolStatisticsGetter ¶
type StoragePoolStatisticsGetter interface {
GetStatistics() (*types.Statistics, error)
}
StoragePoolStatisticsGetter supports getting storage pool statistics
type VolumeFinder ¶
type VolumeFinder interface {
GetPersistentVolumes() ([]k8s.VolumeInfo, error)
}
VolumeFinder is used to find volume information in kubernetes
type VolumeMeta ¶
type VolumeMeta struct { ID string Name string PersistentVolumeName string PersistentVolumeClaimName string Namespace string StorageSystemID string MappedSDCs []MappedSDC }
VolumeMeta is the details of a volume in an SDC
type VolumeMetricsRecord ¶
type VolumeMetricsRecord struct {
// contains filtered or unexported fields
}
VolumeMetricsRecord used for holding output of the Volume stat query results
type VolumeStatisticsGetter ¶
type VolumeStatisticsGetter interface {
GetVolumeStatistics() (*types.VolumeStatistics, error)
}
VolumeStatisticsGetter supports getting statistics