Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mapper ¶
type Mapper struct {
// contains filtered or unexported fields
}
Mapper manages the http.Handler we create for each BMC being scraped. Given a target addr, it returns a promhttp-created handler that, when invoked, will retrieve and yield metrics for that BMC.
type Provider ¶
type Provider interface { // TargetFor returns a target struct for the provided address. TargetFor(addr string) *Target }
Provider creates target structs. This exists to shield the mapper from the relative complexity of creating collectors and targets from them.
type ProviderFunc ¶
ProviderFunc allows creating a Provider implementation from a function.
func (ProviderFunc) TargetFor ¶
func (f ProviderFunc) TargetFor(addr string) *Target
TargetFor implements Provider.
type Target ¶
type Target struct {
// contains filtered or unexported fields
}
Target is the outermost wrapper around a BMC being scraped. It encapsulates the Collector implementation, implementing an event loop around it. This serialises access to a BMC, freeing us from locking.
func New ¶
New constructs and starts a new BMC target. Be sure to call Close() when finished with it to terminate the event loop and underlying BMC connection.
func (*Target) Close ¶
func (t *Target) Close()
Close cleanly terminates the connection and resources associated with the BMC. This method must only be called once, otherwise it will panic.