collector

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 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+)`)
)

Functions

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 QueuesSplite added in v1.0.1

func QueuesSplite(lsfOutput []byte, logger log.Logger) (map[int]*queuesInfo, error)

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 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.

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 {
	QueuesPendingCount *prometheus.Desc
	QueuesRuningCount  *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.

Jump to

Keyboard shortcuts

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