Documentation ¶
Index ¶
- type MetricScraper
- type MetricScraperFactory
- func (msf *MetricScraperFactory) Construct() (MetricScraper, error)
- func (msf *MetricScraperFactory) ForCommand(command core.Command) *MetricScraperFactory
- func (msf *MetricScraperFactory) ForSingularEntity(entity string) *MetricScraperFactory
- func (msf *MetricScraperFactory) WithScrapeInterval(interval uint64) *MetricScraperFactory
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetricScraper ¶
type MetricScraper interface { // Serve serves the metrics to a 'sink', which can be a TUI or // logic that exports these served metrics to either a file or // maybe even served over an endpoint (some day). Serve(opts ...Option) error // SetSink sets the Sink that consumes the metrics produced // by the MetricScraper. SetSink(core.Sink) }
MetricScraper scrapes metrics of some form and serves it based on the implementation.
type MetricScraperFactory ¶
type MetricScraperFactory struct {
// contains filtered or unexported fields
}
MetricScraperFactory constructs a MetricScaper for a command and returns it.
func NewMetricScraperFactory ¶
func NewMetricScraperFactory() *MetricScraperFactory
NewMetricScraperFactory is a constructor for the MetricScraperFactory type. By default, this will be for the core.MainCommand command.
func (*MetricScraperFactory) Construct ¶
func (msf *MetricScraperFactory) Construct() (MetricScraper, error)
Construct constructs the MetricScraper for a particular Command and returns it.
func (*MetricScraperFactory) ForCommand ¶
func (msf *MetricScraperFactory) ForCommand(command core.Command) *MetricScraperFactory
ForCommand sets the command for which a MetricScraper needs to be constructed.
func (*MetricScraperFactory) ForSingularEntity ¶
func (msf *MetricScraperFactory) ForSingularEntity(entity string) *MetricScraperFactory
ForSingularEntity sets the factory to construct an entity specific MetricScraper.
func (*MetricScraperFactory) WithScrapeInterval ¶
func (msf *MetricScraperFactory) WithScrapeInterval(interval uint64) *MetricScraperFactory
WithScrapeInterval sets the scrape interval for the factory.
type Option ¶
type Option func(MetricScraper)
Option is used to inject command specific configuration.
func WithCPUInfoAs ¶
WithCPUInfoAs sets the cpuinfo flag value for the RootCommand.