cassandra

package
v0.0.0-...-f6b4e3f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
const (
	MetricQuery    = "/serverbydomain?querynames=org.apache.cassandra.metrics:*&template=identity"
	MbeanQuery     = "/mbean?objectname="
	QuerySuffix    = "&template=identity"
	JavaStringType = "java.lang.String"
)

const defines constant varaibles

View Source
const (
	// Wildcard the * string
	Wildcard = "*"
	// Pipe the | string
	Pipe = "|"
	// Slash the slash symbol string
	Slash = "/"
)
View Source
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

func Asset(name string) ([]byte, error)

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

func AssetDir(name string) ([]string, error)

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

func AssetInfo(name string) (os.FileInfo, error)

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 AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func Meta

func Meta() *plugin.PluginMeta

Meta returns the snap plug.PluginMeta type

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

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

type XMLDomain

type XMLDomain struct {
	XMLName xml.Name   `xml:"Domain"`
	MBeans  []XMLMBean `xml:"MBean"`
}

XMLDomain represents Domain element

type XMLMBean

type XMLMBean struct {
	XMLName    xml.Name `xml:"MBean"`
	Objectname string   `xml:"objectname,attr"`
}

XMLMBean represents MBean element

type XMLServer

type XMLServer struct {
	XMLName xml.Name  `xml:"Server"`
	Domain  XMLDomain `xml:"Domain"`
}

XMLServer represents Server element

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL