Documentation ¶
Index ¶
- type Client
- func (c *Client) CounterInfoByKey(ctx context.Context) (map[int32]*types.PerfCounterInfo, error)
- func (c *Client) CounterInfoByName(ctx context.Context) (map[string]*types.PerfCounterInfo, error)
- func (c *Client) GetCustomFields(ctx context.Context) (map[int32]string, error)
- func (c *Client) GetMaxQueryMetrics(ctx context.Context) (int, error)
- func (c *Client) GetServerTime(ctx context.Context) (time.Time, error)
- func (c *Client) ListResources(ctx context.Context, root *view.ContainerView, kind []string, ps []string, ...) error
- func (c *Client) QueryMetrics(ctx context.Context, pqs []types.PerfQuerySpec) ([]performance.EntityMetric, error)
- type ClientFactory
- type Endpoint
- type Finder
- type Instance
- type ResourceFilter
- type TSCache
- type ThrottledExecutor
- type VSphere
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Client *govmomi.Client Views *view.Manager Root *view.ContainerView Perf *performance.Manager Valid bool Timeout time.Duration // contains filtered or unexported fields }
Client represents a connection to vSphere and is backed by a govmomi connection
func NewClient ¶
NewClient creates a new vSphere client based on the url and setting passed as parameters.
func (*Client) CounterInfoByKey ¶
CounterInfoByKey wraps performance.CounterInfoByKey to give it proper timeouts
func (*Client) CounterInfoByName ¶
CounterInfoByName wraps performance.CounterInfoByName to give it proper timeouts
func (*Client) GetCustomFields ¶
func (*Client) GetMaxQueryMetrics ¶
GetMaxQueryMetrics returns the max_query_metrics setting as configured in vCenter
func (*Client) GetServerTime ¶
GetServerTime returns the time at the vCenter server
func (*Client) ListResources ¶
func (c *Client) ListResources(ctx context.Context, root *view.ContainerView, kind []string, ps []string, dst interface{}) error
ListResources wraps property.Collector.Retrieve to give it proper timeouts
func (*Client) QueryMetrics ¶
func (c *Client) QueryMetrics(ctx context.Context, pqs []types.PerfQuerySpec) ([]performance.EntityMetric, error)
QueryMetrics wraps performance.Query to give it proper timeouts
type ClientFactory ¶
type ClientFactory struct {
// contains filtered or unexported fields
}
ClientFactory is used to obtain Clients to be used throughout the plugin. Typically, a single Client is reused across all functions and goroutines, but the client is periodically recycled to avoid authentication expiration issues.
func NewClientFactory ¶
func NewClientFactory(vSphereURL *url.URL, parent *Instance) *ClientFactory
NewClientFactory creates a new ClientFactory and prepares it for use.
func (*ClientFactory) Close ¶
func (cf *ClientFactory) Close()
Close shuts down a ClientFactory and releases any resources associated with it.
type Endpoint ¶
Endpoint is a high-level representation of a connected vCenter endpoint. It is backed by the lower level Client type.
func NewEndpoint ¶
NewEndpoint returns a new connection to a vCenter based on the URL and configuration passed as parameters.
type Finder ¶
type Finder struct {
// contains filtered or unexported fields
}
Finder allows callers to find resources in vCenter given a query string.
type Instance ¶
type Instance struct { config.InstanceConfig Vcenter string `toml:"vcenter"` Username string `toml:"username"` Password string `toml:"password"` DatacenterInstances bool `toml:"datacenter_instances"` DatacenterMetricInclude []string `toml:"datacenter_metric_include"` DatacenterMetricExclude []string `toml:"datacenter_metric_exclude"` DatacenterInclude []string `toml:"datacenter_include"` DatacenterExclude []string `toml:"datacenter_exclude"` ClusterInstances bool `toml:"cluster_instances"` ClusterMetricInclude []string `toml:"cluster_metric_include"` ClusterMetricExclude []string `toml:"cluster_metric_exclude"` ClusterInclude []string `toml:"cluster_include"` ClusterExclude []string `toml:"cluster_exclude"` ResourcePoolInstances bool `toml:"resoucepool_instances"` ResourcePoolMetricInclude []string `toml:"resoucepool_metric_include"` ResourcePoolMetricExclude []string `toml:"resoucepool_metric_exclude"` ResourcePoolInclude []string `toml:"resoucepool_include"` ResourcePoolExclude []string `toml:"resoucepool_exclude"` HostInstances bool `toml:"host_instances"` HostMetricInclude []string `toml:"host_metric_include"` HostMetricExclude []string `toml:"host_metric_exclude"` HostInclude []string `toml:"host_include"` HostExclude []string `toml:"host_exclude"` VMInstances bool `toml:"vm_instances"` VMMetricInclude []string `toml:"vm_metric_include"` VMMetricExclude []string `toml:"vm_metric_exclude"` VMInclude []string `toml:"vm_include"` VMExclude []string `toml:"vm_exclude"` DatastoreInstances bool `toml:"datastore_instances"` DatastoreMetricInclude []string `toml:"datastore_metric_include"` DatastoreMetricExclude []string `toml:"datastore_metric_exclude"` DatastoreInclude []string `toml:"datastore_include"` DatastoreExclude []string `toml:"datastore_exclude"` Separator string `toml:"separator"` CustomAttributeInclude []string `toml:"custom_attribute_include"` CustomAttributeExclude []string `toml:"custom_attribute_exclude"` UseIntSamples bool `toml:"use_int_samples"` IPAddresses []string `toml:"ip_addresses"` MetricLookback int `toml:"metric_lookback"` MaxQueryObjects int `toml:"max_query_objects"` MaxQueryMetrics int `toml:"max_query_metrics"` CollectConcurrency int `toml:"collect_concurrency"` DiscoverConcurrency int `toml:"discover_concurrency"` ObjectDiscoveryInterval config.Duration `toml:"object_discovery_interval"` HistoricalInterval config.Duration `toml:"historical_interval"` Timeout config.Duration `toml:"timeout"` tls.ClientConfig // Mix in the TLS/SSL goodness from core // contains filtered or unexported fields }
func (*Instance) Gather ¶
func (ins *Instance) Gather(slist *types.SampleList)
Gather is the main data collection function called by the Telegraf core. It performs all the data collection and writes all metrics into the Accumulator passed as an argument.
type ResourceFilter ¶
type ResourceFilter struct {
// contains filtered or unexported fields
}
ResourceFilter is a convenience class holding a finder and a set of paths. It is useful when you need a self contained object capable of returning a certain set of resources.
type TSCache ¶
type TSCache struct {
// contains filtered or unexported fields
}
TSCache is a cache of timestamps used to determine the validity of datapoints
func NewTSCache ¶
NewTSCache creates a new TSCache with a specified time-to-live after which timestamps are discarded.
func (*TSCache) IsNew ¶
IsNew returns true if the supplied timestamp for the supplied key is more recent than the timestamp we have on record.
type ThrottledExecutor ¶
type ThrottledExecutor struct {
// contains filtered or unexported fields
}
ThrottledExecutor provides a simple mechanism for running jobs in separate goroutines while limit the number of concurrent jobs running at any given time.
func NewThrottledExecutor ¶
func NewThrottledExecutor(limit int) (*ThrottledExecutor, error)
NewThrottledExecutor creates a new ThrottlesExecutor with a specified maximum number of concurrent jobs
func (*ThrottledExecutor) Run ¶
func (t *ThrottledExecutor) Run(ctx context.Context, job func())
Run schedules a job for execution as soon as possible while respecting the maximum concurrency limit.
func (*ThrottledExecutor) Wait ¶
func (t *ThrottledExecutor) Wait()
Wait blocks until all scheduled jobs have finished
type VSphere ¶
type VSphere struct { config.PluginConfig Instances []*Instance `toml:"instances"` }
VSphere is the top level type for the vSphere input plugin. It contains all the configuration and a list of connected vSphere endpoints