Documentation ¶
Index ¶
- Constants
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func Meta() *plugin.PluginMeta
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type CassClient
- type Cassandra
- type HTTPClient
- type XMLAttribute
- type XMLAttributes
- type XMLDomain
- type XMLMBean
- type XMLServer
Constants ¶
const ( // Name of plugin Name = "cassandra" // Version of plugin Version = 3 // Type of plugin PluginType = plugin.CollectorPluginType // Timeout duration DefaultTimeout = 5 * time.Second CassURL = "url" Port = "port" Hostname = "hostname" InvalidURL = "Invalid URL in Global configuration" NoHostname = "No hostname define in Global configuration" )
const defines constant varaibles
const ( MetricQuery = "/serverbydomain?querynames=org.apache.cassandra.metrics:*&template=identity" MbeanQuery = "/mbean?objectname=" QuerySuffix = "&template=identity" JavaStringType = "java.lang.String" )
const defines constant varaibles
const ( // Wildcard the * string Wildcard = "*" // Pipe the | string Pipe = "|" // Slash the slash symbol string Slash = "/" )
const ( EmptyRespErr = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" ReadDocErr = "Read document error" QueryDocErr = "Queried document not found" EmptyNamespaceErr = "To be collected metric namespace is empty" InvalidNamespaceErr = "To be collected metric namespace is invalid" Dot = "." Underscore = "_" Root = "Root" )
const defines constant varaibles
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type CassClient ¶
type CassClient struct { Root *node // contains filtered or unexported fields }
CassClient defines the URL of Cassandra
func NewCassClient ¶
func NewCassClient(url, host string) *CassClient
NewCassClient returns a new instance of CassClient
func NewEmptyCassClient ¶
func NewEmptyCassClient() *CassClient
NewEmptyCassClient returns an empty instance of CassClient
type Cassandra ¶
type Cassandra struct {
// contains filtered or unexported fields
}
Cassandra struct
func NewCassandraCollector ¶
func NewCassandraCollector() *Cassandra
NewCassandraCollector returns a new instance of Cassandra struct
func (*Cassandra) CollectMetrics ¶
func (p *Cassandra) CollectMetrics(mts []plugin.MetricType) ([]plugin.MetricType, error)
CollectMetrics collects metrics from Cassandra through JMX
func (*Cassandra) GetConfigPolicy ¶
func (p *Cassandra) GetConfigPolicy() (*cpolicy.ConfigPolicy, error)
GetConfigPolicy returns a ConfigPolicy
func (*Cassandra) GetMetricTypes ¶
func (p *Cassandra) GetMetricTypes(cfg plugin.ConfigType) ([]plugin.MetricType, error)
GetMetricTypes returns the metric types exposed by Cassandra
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient defines the client for HTTP communication
func NewHTTPClient ¶
func NewHTTPClient(url, endpoint string, timeout time.Duration) *HTTPClient
NewClient returns a new instance of HTTPClient
func (*HTTPClient) GetUrl ¶
func (hc *HTTPClient) GetUrl() string
GetUrl returns the URL of a HTTPClient
type XMLAttribute ¶
type XMLAttribute struct { XMLName xml.Name `xml:"Attribute"` Name string `xml:"name,attr"` Type string `xml:"type,attr"` Value float64 `xml:"value,attr"` }
XMLAttribute represents Attribute element
type XMLAttributes ¶
type XMLAttributes struct { XMLName xml.Name `xml:"MBean"` Attributes []XMLAttribute `xml:"Attribute"` }
XMLAttributes represents list of Attribute elements