exporter

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	Jobs  []*JobItem   `json:"jobs"`
	Queue []*QueueItem `json:"items"`
}

Collector represents the collected api response from the Jenkins APIs.

func (*Collector) Fetch

func (c *Collector) Fetch(address, username, password string) error

Fetch gathers the content from the Jenkins API.

type Exporter

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

Exporter combines the metric collector and descritions.

func NewExporter

func NewExporter(address, username, password string) *Exporter

NewExporter gives you a new exporter instance.

func (*Exporter) Collect

func (e *Exporter) Collect(ch chan<- prometheus.Metric)

Collect delivers the metrics to Prometheus.

func (*Exporter) Describe

func (e *Exporter) Describe(ch chan<- *prometheus.Desc)

Describe defines the metric descriptions for Prometheus.

type JobItem

type JobItem struct {
	Name  string `json:"name"`
	Color string `json:"color"`
	URL   string `json:"url"`
}

JobItem represents a single job definition from the Jenkins jobs API.

type QueueItem

type QueueItem struct {
	Task         *QueueItemTask `json:"task"`
	InQueueSince float64        `json:"inQueueSince"`
}

QueueItem represents a queue item definition from the Jenkins queue API.

type QueueItemTask

type QueueItemTask struct {
	Name string `json:"name"`
}

QueueItemTask represents a single task definition in a queue

Jump to

Keyboard shortcuts

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