Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultPort = 2112 DefaultTimeout = 15 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Daemon ¶
type Daemon struct { Logger *zap.SugaredLogger Server *http.Server Trashcan *tmo.Trashcan PollTimeout time.Duration FastmileReturnChannel chan *models.FastmileReturn HttpErrorChannel chan error Signals chan os.Signal }
Daemon is the central daemon which surfaces metrics from the tmo trashcan
func NewDaemon ¶
New returns a newly configured daemon ready to start A port or timeout of 0 will use default values (2112 & 15 respectively)
func (*Daemon) BackgroundHTTPServer ¶
func (d *Daemon) BackgroundHTTPServer()
func (*Daemon) RegisterMetrics ¶
func (d *Daemon) RegisterMetrics()
RegisterMetrics registers various metrics with prometheus_client to be surfaced
type OneShot ¶
type OneShot struct { Trashcan *tmo.Trashcan FastmileReturnChannel chan *models.FastmileReturn }
OneShot is a client for making single requests without polling
func (*OneShot) Fetch ¶
func (o *OneShot) Fetch() *models.FastmileReturn
Fetch requests a set of metrics from the trashcan
type Polling ¶
type Polling struct { Trashcan *tmo.Trashcan PollTimeout time.Duration Signals chan os.Signal FastmileReturnChannel chan *models.FastmileReturn }
Polling is a client for injecting a return channel and leaving it run in a loop
func NewPolling ¶
func (*Polling) Start ¶
func (p *Polling) Start(ret chan *models.FastmileReturn, signal chan interface{})
Start launches a poller which will return results on ret and terminate on signal
Click to show internal directories.
Click to hide internal directories.