collector

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package collector includes all individual collectors to gather and export lsf metrics.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Regexp to parse lsid.
	ClusterNameRegex = regexp.MustCompile(`My\s+cluster\s+name\s+is\s+(?P<cluster_name>[^\s]+)`)
	MasterNameRegex  = regexp.MustCompile(`My\s+master\s+name\s+is\s+(?P<master_name>[^\s]+)`)
	LSFVersionRegex  = regexp.MustCompile(`(?P<lsf_version>\d+.\d+.\d+.\d+)`)

	ResourceRegex = regexp.MustCompile(`\((?P<resource_type>.+)\)`)
)

Functions

func ConvertServerType added in v1.0.2

func ConvertServerType(server_type string) string

转义服务器类型

func ConvertUT added in v1.0.2

func ConvertUT(data string, logger log.Logger) float64

func ConvertresourceType added in v1.0.2

func ConvertresourceType(resource_type string) string

去除字符串中的()

func DisableDefaultCollectors

func DisableDefaultCollectors()

DisableDefaultCollectors sets the collector state to false for all collectors which have not been explicitly enabled on the command line.

func FormatQueusStatus added in v1.0.1

func FormatQueusStatus(status string, logger log.Logger) float64

func FormatbhostsStatus added in v1.0.1

func FormatbhostsStatus(status string, logger log.Logger) float64

func FormatlsLoadStatus added in v1.0.2

func FormatlsLoadStatus(status string, logger log.Logger) float64

func FormatlshostsUnit added in v1.0.2

func FormatlshostsUnit(size float64, unit string) float64

Types

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 NewLSFInformationCollector added in v1.0.2

func NewLSFInformationCollector(logger log.Logger) (Collector, error)

NewLmstatCollector returns a new Collector exposing lmstat license stats.

func NewLSFJobCollector

func NewLSFJobCollector(logger log.Logger) (Collector, error)

NewLmstatCollector returns a new Collector exposing lmstat license stats.

func NewLSFQueuesCollector added in v1.0.1

func NewLSFQueuesCollector(logger log.Logger) (Collector, error)

NewLmstatCollector returns a new Collector exposing lmstat license stats.

func NewLSFbHostCollector added in v1.0.1

func NewLSFbHostCollector(logger log.Logger) (Collector, error)

NewLmstatCollector returns a new Collector exposing lmstat license stats.

func NewLSFlsLoadCollector added in v1.0.2

func NewLSFlsLoadCollector(logger log.Logger) (Collector, error)

NewLmstatCollector returns a new Collector exposing lmstat license stats.

func NewLSFlshostCollector added in v1.0.2

func NewLSFlshostCollector(logger log.Logger) (Collector, error)

NewLmstatCollector returns a new Collector exposing lmstat license stats.

type InformationCollector added in v1.0.2

type InformationCollector struct {
	LsfInformation *prometheus.Desc
	// contains filtered or unexported fields
}

func (*InformationCollector) Update added in v1.0.2

func (c *InformationCollector) Update(ch chan<- prometheus.Metric) error

Update calls (*lmstatCollector).getLmStat to get the platform specific memory metrics.

type Job

type Job struct {
	ID            string
	User          string
	Status        string
	Queue         string
	FromHost      string
	ExecutionHost string
	JobName       string
	SubmitTime    int64
}

type JobCollector

type JobCollector struct {
	JobInfo *prometheus.Desc
	// contains filtered or unexported fields
}

func (*JobCollector) Update

func (c *JobCollector) Update(ch chan<- prometheus.Metric) error

Update calls (*lmstatCollector).getLmStat to get the platform specific memory metrics.

type LsfCollector

type LsfCollector struct {
	Collectors map[string]Collector
	// contains filtered or unexported fields
}

LsfCollector implements the prometheus.Collector interface.

func NewLsfCollector

func NewLsfCollector(logger log.Logger, filters ...string) (*LsfCollector, error)

NewLsfCollector creates a new LsfCollector.

func (LsfCollector) Collect

func (n LsfCollector) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface.

func (LsfCollector) Describe

func (n LsfCollector) Describe(ch chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface.

type QueuesCollector added in v1.0.1

type QueuesCollector struct {
	QueuesRuningJobCount  *prometheus.Desc
	QueuesPendingJobCount *prometheus.Desc
	QueuesMaxJobCount     *prometheus.Desc

	QueuesStatus *prometheus.Desc
	// contains filtered or unexported fields
}

func (*QueuesCollector) Update added in v1.0.1

func (c *QueuesCollector) Update(ch chan<- prometheus.Metric) error

Update calls (*lmstatCollector).getLmStat to get the platform specific memory metrics.

type TrimReader added in v1.0.2

type TrimReader struct{ io.Reader }

func (TrimReader) Read added in v1.0.2

func (tr TrimReader) Read(bs []byte) (int, error)

Jump to

Keyboard shortcuts

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