Documentation
¶
Index ¶
Constants ¶
const (
// Name is the name of the API Client Querier plugin
Name = "api"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClientQuerier ¶
type APIClientQuerier struct {
APIEndpoints map[string]*client.Config `json:"endpoints" yaml:"endpoints"`
MaxConcurrent int `json:"max_concurrent" yaml:"max_concurrent"`
}
APIClientQuerier implements an API-based querier, fulfilling the Querier interface
func New ¶
func New(cfgPath string) (*APIClientQuerier, error)
New instantiates a new goProbe API-based querier. It uses the goprobe/client under the hood to run queries
func (*APIClientQuerier) AllHosts ¶
func (a *APIClientQuerier) AllHosts() (hostList hosts.Hosts, err error)
AllHosts returns a list of all hosts / targets available to the querier
func (*APIClientQuerier) Query ¶
func (a *APIClientQuerier) Query(ctx context.Context, hosts hosts.Hosts, args *query.Args) (<-chan *results.Result, <-chan struct{})
Query takes query workloads from the internal workloads channel, runs them, and returns a channel from which the results can be read and a channel from which keepalive signals can be read
func (*APIClientQuerier) SetMaxConcurrent ¶
func (a *APIClientQuerier) SetMaxConcurrent(num int) *APIClientQuerier
SetMaxConcurrent guides how many hosts are contacted to run queries concurrently. In most cases, it's sufficient to set this to the amount of hosts available in configuration or the list of hosts queried