sabnzbd

package
v0.0.0-...-073d061 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGauge

func NewGauge(name string) prometheus.Gauge

func NewServerGauge

func NewServerGauge(name, server string) prometheus.Gauge

func Validate

func Validate(*Config)

Types

type Config

type Config struct {
	BaseUrl  string `json:"base_url"`
	Key      string `json:"api_key"`
	Interval int    `json:"interval"`
	// contains filtered or unexported fields
}

func NewDefaultConfig

func NewDefaultConfig() *Config

func (*Config) GetURL

func (c *Config) GetURL() string

type Exporter

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

func NewExporter

func NewExporter(client apiclient.IApiClient, logger logger.ILogger, config *Config) *Exporter

func (*Exporter) Data

func (e *Exporter) Data() *SabNZBd

func (*Exporter) Interval

func (e *Exporter) Interval() int

func (*Exporter) Scrape

func (e *Exporter) Scrape() error

type Metrics

type Metrics struct {
	SpeedLimit    prometheus.Gauge
	SpeedLimitAbs prometheus.Gauge
	Speed         prometheus.Gauge
	Kbs           prometheus.Gauge
	MbTotal       prometheus.Gauge
	MbLeft        prometheus.Gauge
	MbDone        prometheus.Gauge
	SizeTotal     prometheus.Gauge
	SizeLeft      prometheus.Gauge
	TimeLeft      prometheus.Gauge
	SlotCount     prometheus.Gauge
	SlotTotal     prometheus.Gauge

	XferTotal  prometheus.Gauge
	ServerXfer map[string]prometheus.Gauge

	Calls prometheus.Gauge
	Limit prometheus.Gauge
}

func NewMetrics

func NewMetrics() *Metrics

func (*Metrics) SetCalls

func (m *Metrics) SetCalls(val float64)

func (*Metrics) SetKbs

func (m *Metrics) SetKbs(v float64)

func (*Metrics) SetLimit

func (m *Metrics) SetLimit(val float64)

func (*Metrics) SetMbDone

func (m *Metrics) SetMbDone(v float64)

func (*Metrics) SetMbLeft

func (m *Metrics) SetMbLeft(v float64)

func (*Metrics) SetMbTotal

func (m *Metrics) SetMbTotal(v float64)

func (*Metrics) SetServerXfer

func (m *Metrics) SetServerXfer(name string, v float64)

func (*Metrics) SetSizeLeft

func (m *Metrics) SetSizeLeft(v float64)

func (*Metrics) SetSizeTotal

func (m *Metrics) SetSizeTotal(v float64)

func (*Metrics) SetSlotCount

func (m *Metrics) SetSlotCount(v float64)

func (*Metrics) SetSlotTotal

func (m *Metrics) SetSlotTotal(v float64)

func (*Metrics) SetSpeed

func (m *Metrics) SetSpeed(v float64)

func (*Metrics) SetSpeedLimit

func (m *Metrics) SetSpeedLimit(v float64)

func (*Metrics) SetSpeedLimitAbs

func (m *Metrics) SetSpeedLimitAbs(v float64)

func (*Metrics) SetTimeLeft

func (m *Metrics) SetTimeLeft(v float64)

func (*Metrics) SetXferTotal

func (m *Metrics) SetXferTotal(v float64)

type Queue

type Queue struct {
	Version        string      `json:"version"`
	Paused         bool        `json:"paused"`
	PausedAll      bool        `json:"paused_all"`
	DiskSpace1     SabFloat    `json:"diskspace1"`
	DiskSpace2     SabFloat    `json:"diskspace2"`
	SpeedLimit     SabUint     `json:"speedlimit"`
	SpeedLimitAbs  SabFloat    `json:"speedlimit_abs"`
	CacheSize      SabSize     `json:"cache_size"`
	KbPerSec       SabFloat    `json:"kbpersec"`
	Speed          SabSize     `json:"speed"`
	MbLeft         SabFloat    `json:"mbleft"`
	Mb             SabFloat    `json:"mb"`
	SizeLeft       SabSize     `json:"sizeleft"`
	Size           SabSize     `json:"size"`
	TimeLeft       SabDuration `json:"timeleft"`
	NoOfSlots      uint64      `json:"noofslots"`
	NoOfSlotsTotal uint64      `json:"noofslots_total"`
}

func (Queue) MbDone

func (s Queue) MbDone() float64

type QueueStats

type QueueStats struct {
	Queue Queue `json:"queue"`
}

type SabDuration

type SabDuration time.Duration

func (SabDuration) Duration

func (s SabDuration) Duration() time.Duration

func (SabDuration) Float64

func (s SabDuration) Float64() float64

func (SabDuration) Seconds

func (s SabDuration) Seconds() float64

func (SabDuration) String

func (s SabDuration) String() string

func (*SabDuration) UnmarshalJSON

func (s *SabDuration) UnmarshalJSON(b []byte) error

type SabFloat

type SabFloat float64

func (SabFloat) Float64

func (s SabFloat) Float64() float64

func (SabFloat) String

func (s SabFloat) String() string

func (*SabFloat) UnmarshalJSON

func (s *SabFloat) UnmarshalJSON(b []byte) error

type SabNZBd

type SabNZBd struct {
	Queue  *QueueStats
	Server *ServerStats
}

func NewSabNZBd

func NewSabNZBd() *SabNZBd

type SabSize

type SabSize float64

func (SabSize) Float64

func (s SabSize) Float64() float64

func (SabSize) String

func (s SabSize) String() string

func (*SabSize) UnmarshalJSON

func (s *SabSize) UnmarshalJSON(b []byte) error

type SabUint

type SabUint uint64

func (SabUint) Float64

func (s SabUint) Float64() float64

func (SabUint) Int64

func (s SabUint) Int64() int64

func (SabUint) String

func (s SabUint) String() string

func (SabUint) Uint64

func (s SabUint) Uint64() uint64

func (*SabUint) UnmarshalJSON

func (s *SabUint) UnmarshalJSON(b []byte) error

type Server

type Server struct {
	Total uint64 `json:"total"`
}

func (Server) Dump

func (s Server) Dump()

type ServerStats

type ServerStats struct {
	Total   uint64            `json:"total"`
	Servers map[string]Server `json:"servers"`
}

func NewServerStats

func NewServerStats() *ServerStats

Jump to

Keyboard shortcuts

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