collector

package
Version: v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package collector is used to collect metrics by implementing prometheus.Collector interface. See function level comments for more details.

Index

Constants

View Source
const (

	// SocketPath where istgt is listening
	SocketPath = "/var/run/istgt_ctl_sock"
	// HeaderPrefix is the prefix comes in the header from cstor.
	HeaderPrefix = "iSCSI Target Controller version"
	// EOF separates the strings from response which comes from the
	// cstor as the collection of metrics.
	EOF = "\r\n"
	// Footer is used to verify if all the response has collected.
	Footer = "OK IOSTATS"
	// Command is a command that is used to write over wire and get
	// the iostats from the cstor.
	Command = "IOSTATS"
	// BufSize is the size of response from cstor read at one time.
	BufSize = 1024
)
View Source
const (

	// Offline is the status of volume when no io's have been served
	// or volume may be in RO state (only for jiva)
	Offline volumeStatus
	// Degraded is the status of volume when volume is
	// performing in degraded mode but all features may available
	Degraded
	// Healthy is the status of volume when volume is serving io's
	// and all features are available or volume may be in RW state
	// (for jiva)
	Healthy
	// Unknown is the status of volume when no info is available
	Unknown
)

Variables

This section is empty.

Functions

func Cstor

func Cstor(path string) *cstor

Cstor returns cstor's instance

func Jiva

func Jiva(url *url.URL) *jiva

Jiva returns jiva's instance

func Metrics

func Metrics(cas string) metrics

MetricsInitializer returns the Metrics instance used for registration of exporter while instantiating JivaStatsExporter and CstorStatsExporter.

func New

func New(vol Volume) *collector

Types

type Collector

type Collector interface {
	Describe(chan<- *prometheus.Desc)
	Collect(chan<- prometheus.Metric)
}

Collector is an interface that is used for initializing various collectors for collecting volume and pool metrics

type Getter

type Getter interface {
	// contains filtered or unexported methods
}

Getter interface defines the method that to be implemented by the cstor and jiva. getter() is used to collect the stats from the Jiva and Cstor.

type Parser

type Parser interface {
	// contains filtered or unexported methods
}

Parser interface defines the method that to be implemented by the Cstor and Jiva. parse() is used to parse the response into the Metrics struct.

type Volume

type Volume interface {
	Getter
	Parser
}

Volume interface defines the interfaces that has methods to be implemented by various storage engines e.g. cstor, jiva etc.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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