metric

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoData = errors.New("Collector returned no data")

ErrNoData indicates the collector found no data to collect, but had no other error.

Functions

func IsNoDataError

func IsNoDataError(err error) bool

IsNoDataError method is to determine whether the Collector has no data to return

Types

type CSICollector

type CSICollector struct {
	Collectors map[string]Collector
}

CSICollector implements the prometheus.Collector interface.

func (CSICollector) Collect

func (csi CSICollector) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface.

func (CSICollector) Describe

func (csi CSICollector) Describe(ch chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface.

type Collector

type Collector interface {
	// Get new metrics and expose them via prometheus registry.
	Update(ch chan<- prometheus.Metric) error
}

Collector is the interface a collector has to implement.

func NewDiskStatCollector

func NewDiskStatCollector() (Collector, error)

NewDiskStatCollector returns a new Collector exposing disk stats.

func NewPfsRawBlockStatCollector added in v1.1.1

func NewPfsRawBlockStatCollector() (Collector, error)

NewPfsRawBlockStatCollector returns a new Collector exposing stats.

type ExecResult added in v1.1.1

type ExecResult struct {
	ExitCode int
	// contains filtered or unexported fields
}

ExecResult represents a result returned from Exec()

type Handler

type Handler struct {
}

Handler is a package of promHttp,metric entry

func NewMetricHandler

func NewMetricHandler(serviceType string) *Handler

NewMetricHandler method returns a promHttp object

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

Jump to

Keyboard shortcuts

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