Documentation
¶
Overview ¶
Package rtorrentexporter provides the Exporter type used in the rtorrent_exporter Prometheus exporter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DownloadsCollector ¶
type DownloadsCollector struct {
Downloads *prometheus.Desc
DownloadsStarted *prometheus.Desc
DownloadsStopped *prometheus.Desc
DownloadsComplete *prometheus.Desc
DownloadsIncomplete *prometheus.Desc
DownloadsHashing *prometheus.Desc
DownloadsSeeding *prometheus.Desc
DownloadsLeeching *prometheus.Desc
DownloadsActive *prometheus.Desc
DownloadRateBytes *prometheus.Desc
DownloadTotalBytes *prometheus.Desc
UploadRateBytes *prometheus.Desc
UploadTotalBytes *prometheus.Desc
// contains filtered or unexported fields
}
A DownloadsCollector is a Prometheus collector for metrics regarding rTorrent downloads.
func NewDownloadsCollector ¶
func NewDownloadsCollector(ds DownloadsSource) *DownloadsCollector
NewDownloadsCollector creates a new DownloadsCollector which collects metrics regarding rTorrent downloads.
func (*DownloadsCollector) Collect ¶
func (c *DownloadsCollector) Collect(ch chan<- prometheus.Metric)
Collect sends the metric values for each metric pertaining to the rTorrent downloads to the provided prometheus Metric channel.
func (*DownloadsCollector) Describe ¶
func (c *DownloadsCollector) Describe(ch chan<- *prometheus.Desc)
Describe sends the descriptors of each metric over to the provided channel. The corresponding metric values are sent separately.
type DownloadsSource ¶
type DownloadsSource interface {
All() ([]string, error)
Started() ([]string, error)
Stopped() ([]string, error)
Complete() ([]string, error)
Incomplete() ([]string, error)
Hashing() ([]string, error)
Seeding() ([]string, error)
Leeching() ([]string, error)
Active() ([]string, error)
BaseFilename(infoHash string) (string, error)
DownloadRate(infoHash string) (int, error)
DownloadTotal(infoHash string) (int, error)
UploadRate(infoHash string) (int, error)
UploadTotal(infoHash string) (int, error)
}
A DownloadsSource is a type which can retrieve downloads information from rTorrent. It is implemented by *rtorrent.DownloadService.
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
An Exporter is a Prometheus exporter for rTorrent metrics. It wraps all rTorrent metrics collectors and provides a single global exporter which can serve metrics. It also ensures that the collection is done in a thread-safe manner, the necessary requirement stated by Prometheus. It implements the prometheus.Collector interface in order to register with Prometheus.
func (*Exporter) Collect ¶
func (c *Exporter) Collect(ch chan<- prometheus.Metric)
Collect sends the collected metrics from each of the collectors to prometheus. Collect could be called several times concurrently and thus its run is protected by a single mutex.
func (*Exporter) Describe ¶
func (c *Exporter) Describe(ch chan<- *prometheus.Desc)
Describe sends all the descriptors of the collectors included to the provided channel.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
rtorrent_exporter
command
Command rtorrent_exporter provides a Prometheus exporter for rTorrent.
|
Command rtorrent_exporter provides a Prometheus exporter for rTorrent. |
