exporter

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package exporter implements a Prometheus exporter for TfL Cycles availability.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

type Exporter struct {
	Logger *slog.Logger
	Client *bikepoint.Client
	// contains filtered or unexported fields
}

Exporter is an http.Handler that will respond to Prometheus scrape requests with information about stations' dock and cycle availability. Create instances with NewExporter().

func NewExporter

func NewExporter(logger *slog.Logger, client *bikepoint.Client) *Exporter

func (Exporter) ServeHTTP

func (e Exporter) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ScrapeCollector

type ScrapeCollector struct {
	Success bool
	time.Duration
}

ScrapeCollector is a prometheus.Collector yielding metrics about the fetching of data from the TfL BikePoint API.

func (ScrapeCollector) Collect

func (c ScrapeCollector) Collect(m chan<- prometheus.Metric)

func (ScrapeCollector) Describe

func (ScrapeCollector) Describe(d chan<- *prometheus.Desc)

type StationAvailabilitiesCollector

type StationAvailabilitiesCollector struct {
	StationAvailabilities []bikepoint.StationAvailability
}

StationAvailabilitiesCollector is a prometheus.Collector yielding metrics about retrieved dock and bike availability data.

func (StationAvailabilitiesCollector) Collect

func (c StationAvailabilitiesCollector) Collect(m chan<- prometheus.Metric)

func (StationAvailabilitiesCollector) Describe

func (StationAvailabilitiesCollector) Describe(d chan<- *prometheus.Desc)

Jump to

Keyboard shortcuts

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