smart

package
v1.2.0-RC2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	CollectorType string
	MetricsData
	MetricsLabels
}

Metrics defines the metrics data along with the labels present on those metrics. The collector(currently seachest/smart) used to fetch the metrics is also defined

func NewMetrics

func NewMetrics(collector string) *Metrics

NewMetrics creates a new Metrics with the given collector type

func (*Metrics) Collectors

func (m *Metrics) Collectors() []prometheus.Collector

Collectors lists out all the collectors for which the metrics is exposed

func (*Metrics) ErrorCollectors

func (m *Metrics) ErrorCollectors() []prometheus.Collector

ErrorCollectors lists out all collectors for metrics related to error

func (*Metrics) IncErrorRequestCounter

func (m *Metrics) IncErrorRequestCounter()

IncErrorRequestCounter increments the no of requests errored out.

func (*Metrics) IncRejectRequestCounter

func (m *Metrics) IncRejectRequestCounter()

IncRejectRequestCounter increments the reject request error counter

func (*Metrics) SetBlockDeviceCapacity added in v0.9.0

func (m *Metrics) SetBlockDeviceCapacity(capacity uint64) *Metrics

SetBlockDeviceCapacity sets the current block device capacity value to the metric

func (*Metrics) SetBlockDeviceCurrentTemperature

func (m *Metrics) SetBlockDeviceCurrentTemperature(currentTemp int16) *Metrics

SetBlockDeviceCurrentTemperature sets the current temperature value to the metric

func (*Metrics) SetBlockDeviceCurrentTemperatureValid

func (m *Metrics) SetBlockDeviceCurrentTemperatureValid(valid bool) *Metrics

SetBlockDeviceCurrentTemperatureValid sets the validity of the exposed current temperature metrics

func (*Metrics) SetBlockDeviceHighestTemperature added in v0.9.0

func (m *Metrics) SetBlockDeviceHighestTemperature(highTemp int16) *Metrics

SetBlockDeviceHighestTemperature sets the highest temperature value to the metric

func (*Metrics) SetBlockDeviceHighestTemperatureValid added in v0.9.0

func (m *Metrics) SetBlockDeviceHighestTemperatureValid(valid bool) *Metrics

SetBlockDeviceHighestTemperatureValid sets the validity of the exposed highest temperature metrics

func (*Metrics) SetBlockDeviceLowestTemperature added in v0.9.0

func (m *Metrics) SetBlockDeviceLowestTemperature(lowTemp int16) *Metrics

SetBlockDeviceLowestTemperature sets the lowest temperature value to the metric

func (*Metrics) SetBlockDeviceLowestTemperatureValid added in v0.9.0

func (m *Metrics) SetBlockDeviceLowestTemperatureValid(valid bool) *Metrics

SetBlockDeviceLowestTemperatureValid sets the validity of the exposed lowest temperature metrics

func (*Metrics) SetBlockDevicePercentEnduranceUsed added in v0.9.0

func (m *Metrics) SetBlockDevicePercentEnduranceUsed(size float64) *Metrics

SetBlockDevicePercentEnduranceUsed sets the percentage of endurance used by a block device to the metric

func (*Metrics) SetBlockDeviceTotalBytesRead added in v0.9.0

func (m *Metrics) SetBlockDeviceTotalBytesRead(size uint64) *Metrics

SetBlockDeviceTotalBytesRead sets the total bytes read value to the metric

func (*Metrics) SetBlockDeviceTotalBytesWritten added in v0.9.0

func (m *Metrics) SetBlockDeviceTotalBytesWritten(size uint64) *Metrics

SetBlockDeviceTotalBytesWritten sets the total bytes written value to the metric

func (*Metrics) SetBlockDeviceUtilizationRate added in v0.9.0

func (m *Metrics) SetBlockDeviceUtilizationRate(size float64) *Metrics

SetBlockDeviceUtilizationRate sets the utilization rate value to the metric

func (*Metrics) WithBlockDeviceCapacity added in v0.9.0

func (m *Metrics) WithBlockDeviceCapacity() *Metrics

WithBlockDeviceCapacity declares the blockdevice capacity

func (*Metrics) WithBlockDeviceCurrentTemperature

func (m *Metrics) WithBlockDeviceCurrentTemperature() *Metrics

WithBlockDeviceCurrentTemperature declares the metric current temperature as a prometheus metric

func (*Metrics) WithBlockDeviceCurrentTemperatureValid

func (m *Metrics) WithBlockDeviceCurrentTemperatureValid() *Metrics

WithBlockDeviceCurrentTemperatureValid declares the metric current temperature valid as a prometheus metric

func (*Metrics) WithBlockDeviceHighestTemperature added in v0.9.0

func (m *Metrics) WithBlockDeviceHighestTemperature() *Metrics

WithBlockDeviceHighestTemperature declares the metric highest temperature as a prometheus metric

func (*Metrics) WithBlockDeviceHighestTemperatureValid added in v0.9.0

func (m *Metrics) WithBlockDeviceHighestTemperatureValid() *Metrics

WithBlockDeviceHighestTemperatureValid declares the metric highest temperature valid as a prometheus metric

func (*Metrics) WithBlockDeviceLowestTemperature added in v0.9.0

func (m *Metrics) WithBlockDeviceLowestTemperature() *Metrics

WithBlockDeviceLowestTemperature declares the metric lowest temperature as a prometheus metric

func (*Metrics) WithBlockDeviceLowestTemperatureValid added in v0.9.0

func (m *Metrics) WithBlockDeviceLowestTemperatureValid() *Metrics

WithBlockDeviceLowestTemperatureValid declares the metric lowest temperature valid as a prometheus metric

func (*Metrics) WithBlockDevicePercentEnduranceUsed added in v0.9.0

func (m *Metrics) WithBlockDevicePercentEnduranceUsed() *Metrics

WithBlockDevicePercentEnduranceUsed declares the percentage of endurance used by a block device

func (*Metrics) WithBlockDeviceTotalBytesRead added in v0.9.0

func (m *Metrics) WithBlockDeviceTotalBytesRead() *Metrics

WithBlockDeviceTotalBytesRead declares the total number of bytes read by a block device

func (*Metrics) WithBlockDeviceTotalBytesWritten added in v0.9.0

func (m *Metrics) WithBlockDeviceTotalBytesWritten() *Metrics

WithBlockDeviceTotalBytesWritten declares the total number of bytes written by a block device

func (*Metrics) WithBlockDeviceUtilizationRate added in v0.9.0

func (m *Metrics) WithBlockDeviceUtilizationRate() *Metrics

WithBlockDeviceUtilizationRate declares the utilization rate of a block device

func (*Metrics) WithErrorRequest

func (m *Metrics) WithErrorRequest() *Metrics

WithErrorRequest declares the error request count metric

func (*Metrics) WithRejectRequest

func (m *Metrics) WithRejectRequest() *Metrics

WithRejectRequest declares the reject request count metric

type MetricsData

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

MetricsData is the prometheus metrics that are exposed by the exporter. This includes all the metrics that are available via SMART TODO additional smart metrics need to be added here

type MetricsLabels

type MetricsLabels struct {
	UUID     string
	Path     string
	HostName string
	NodeName string
}

MetricsLabels are the labels that are available on the prometheus metrics

func (*MetricsLabels) WithBlockDeviceHostName

func (ml *MetricsLabels) WithBlockDeviceHostName(hostName string) *MetricsLabels

WithBlockDeviceHostName sets the blockdevice hostname to the metric label

func (*MetricsLabels) WithBlockDeviceNodeName

func (ml *MetricsLabels) WithBlockDeviceNodeName(nodeName string) *MetricsLabels

WithBlockDeviceNodeName sets the blockdevice nodename to the metric label

func (*MetricsLabels) WithBlockDevicePath

func (ml *MetricsLabels) WithBlockDevicePath(path string) *MetricsLabels

WithBlockDevicePath sets the blockdevice path to the metric label

func (*MetricsLabels) WithBlockDeviceUUID

func (ml *MetricsLabels) WithBlockDeviceUUID(uuid string) *MetricsLabels

WithBlockDeviceUUID sets the blockdevice UUID to the metric label

Jump to

Keyboard shortcuts

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