Documentation ¶
Index ¶
Constants ¶
const ( // Name of plugin Name = "nova-compute" // Version of plugin Version = 3 // Type of plugin Type = plugin.CollectorPluginType )
const ( SUBGROUP_LIMITS = "limits" SUBGROUP_QUOTAS = "quotas" GROUP_HYPERVISOR = "hypervisor" GROUP_TENANT = "tenant" GROUP_CLUSTER = "cluster" ID_CONFIG = "config" )
Variables ¶
This section is empty.
Functions ¶
func Meta ¶
func Meta() *plugin.PluginMeta
func ReadConfig ¶
func ReadConfig(cfg interface{}, out interface{}) error
ReadConfig deserializes plugin's configuration from metric or global config given in cfg. out shoud be pointer to structure. If field of structure has no tag it's name is used as config key, if it has named tag "c" with values delimited by commas, first value is used as config key. If second value is "weak" and field of structure is string, string representation of read value is written. "weak" is optional for string fields and currently forbidden for other types. Returns nil if operation succeeded or relevant error.
Types ¶
type CachedNovas ¶
CachedNovas holds authenticated nova clients for given tenants
func (CachedNovas) Get ¶
func (self CachedNovas) Get(auth gophercloud.AuthOptions, tenant string, providers ...*gophercloud.ProviderClient) (v2.NovaV2, error)
Get performs lazy initalization of client for given tenant using given auth options. If optional parameter givent its used as authenticated client
type Config ¶
type Config struct { User string `c:"openstack_user"` Pass string `c:"openstack_pass"` Tenant string `c:"openstack_tenant"` Url string `c:"openstack_auth_url"` DomainName string `c:"openstack_domain_name"` DomaninID string `c:"openstack_domain_id"` RatioCores float64 `c:"allocation_ratio_cores"` RatioRam float64 `c:"allocation_ratio_ram"` ReservedNCores float64 `c:"reserved_node_cores"` ReservedNRam float64 `c:"reserved_node_ram_mb"` }
type NovaPlugin ¶
type NovaPlugin struct {
// contains filtered or unexported fields
}
func New ¶
func New() *NovaPlugin
func (*NovaPlugin) CollectMetrics ¶
func (self *NovaPlugin) CollectMetrics(mts []plugin.MetricType) ([]plugin.MetricType, error)
CollectMetrics returns filled mts table with metric values. Limits and quotas are colllected once per tenant. All hypervisor related statistics are collected in one call. This method also performs lazy initalization of plugin. Error is returned if initalization or any of required call failed.
func (*NovaPlugin) GetConfigPolicy ¶
func (self *NovaPlugin) GetConfigPolicy() (*cpolicy.ConfigPolicy, error)
func (*NovaPlugin) GetMetricTypes ¶
func (self *NovaPlugin) GetMetricTypes(cfg plugin.ConfigType) ([]plugin.MetricType, error)
GetMetricTypes returns list of possible namespaces. Namespaces involving limits or quotas are constructed per tenant. Namespaces for hypervisors are constructed in single api call. This method also performs lazy initalization of plugin. Returns error if initalization or any request failed.