Documentation
¶
Index ¶
- Variables
- func FormatConfig(config *JMXConfig, hideSecrets bool) string
- func FormatJMXAttributes(attrs []*AttributeResponse) string
- type AttributeResponse
- type Client
- func (c *Client) Close() error
- func (c *Client) GetClientVersion() string
- func (c *Client) GetInternalStats() (InternalStatsList, error)
- func (c *Client) GetMBeanAttributeNames(mBeanName string) ([]string, error)
- func (c *Client) GetMBeanAttributes(mBeanName string, mBeanAttrName ...string) ([]*AttributeResponse, error)
- func (c *Client) IsRunning() bool
- func (c *Client) Open(config *JMXConfig) (client *Client, err error)
- func (c *Client) QueryMBeanAttributes(mBeanNamePattern string, mBeanAttrName ...string) ([]*AttributeResponse, error)
- func (c *Client) QueryMBeanNames(mBeanGlobPattern string) ([]string, error)
- type InternalStat
- type InternalStatsList
- type JMXClientError
- type JMXConfig
- type JMXConnectionError
- type JMXError
- type ResponseType
Constants ¶
This section is empty.
Variables ¶
var ( // ResponseTypeBool AttributeResponse of bool value ResponseTypeBool = nrprotocol.ResponseType_BOOL // ResponseTypeString AttributeResponse of string value ResponseTypeString = nrprotocol.ResponseType_STRING // ResponseTypeDouble AttributeResponse of double value ResponseTypeDouble = nrprotocol.ResponseType_DOUBLE // ResponseTypeInt AttributeResponse of int value ResponseTypeInt = nrprotocol.ResponseType_INT // ResponseTypeErr AttributeResponse with error ResponseTypeErr = nrprotocol.ResponseType_ERROR )
Functions ¶
func FormatConfig ¶
FormatConfig will convert the JMXConfig into a string.
func FormatJMXAttributes ¶
func FormatJMXAttributes(attrs []*AttributeResponse) string
FormatJMXAttributes will prettify JMXAttributes.
Types ¶
type AttributeResponse ¶
type AttributeResponse nrprotocol.AttributeResponse
AttributeResponse keeps the JMX MBean query response.
func (*AttributeResponse) GetValue ¶
func (j *AttributeResponse) GetValue() interface{}
GetValue extracts the value from AttributeResponse based on type.
func (*AttributeResponse) GetValueAsFloat ¶
func (j *AttributeResponse) GetValueAsFloat() (float64, error)
GetValueAsFloat casts the value from AttributeResponse to float based on type.
func (*AttributeResponse) String ¶
func (j *AttributeResponse) String() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client to connect with a JMX endpoint.
func (*Client) GetClientVersion ¶
GetClientVersion returns nrjmx version.
func (*Client) GetInternalStats ¶
func (c *Client) GetInternalStats() (InternalStatsList, error)
GetInternalStats returns the nrjmx internal query statistics for troubleshooting. Internal statistics must be enabled using JMXConfig.EnableInternalStats flag. Additionally you can set a maximum size for the collected stats using JMXConfig.MaxInternalStatsSize. (default: 100000) Each time you retrieve GetInternalStats, the internal stats will be cleaned.
func (*Client) GetMBeanAttributeNames ¶
GetMBeanAttributeNames returns all the available JMX attribute names for a given mBeanName.
func (*Client) GetMBeanAttributes ¶
func (c *Client) GetMBeanAttributes(mBeanName string, mBeanAttrName ...string) ([]*AttributeResponse, error)
GetMBeanAttributes returns the JMX attribute values.
func (*Client) QueryMBeanAttributes ¶
func (c *Client) QueryMBeanAttributes(mBeanNamePattern string, mBeanAttrName ...string) ([]*AttributeResponse, error)
QueryMBeanAttributes performs all calls necessary for retrieving all MBeanAttrs values for the mBeanNamePattern: 1. QueryMBeanNames 2. GetMBeanAttributeNames 3. GetMBeanAttributes If an error occur it checks if it's a collection error (it can recover) or a connection error (that blocks all the collection).
type InternalStat ¶
type InternalStat nrprotocol.InternalStat
InternalStat gathers stats about queries performed by nrjmx.
func (*InternalStat) String ¶
func (is *InternalStat) String() string
type InternalStatsList ¶
type InternalStatsList []*InternalStat
func (InternalStatsList) String ¶
func (is InternalStatsList) String() string
type JMXClientError ¶
type JMXClientError struct {
Message string
}
JMXClientError is returned when there is an nrjmx process error. Those errors require opening a new client.
func IsJMXClientError ¶
func IsJMXClientError(err error) (*JMXClientError, bool)
IsJMXClientError checks if the err is JMXJMXClientError.
func (*JMXClientError) Error ¶
func (e *JMXClientError) Error() string
func (*JMXClientError) String ¶
func (e *JMXClientError) String() string
type JMXConnectionError ¶
type JMXConnectionError nrprotocol.JMXConnectionError
JMXConnectionError is returned when there is a JMX connection error or a nrjmx process error.
func IsJMXConnectionError ¶
func IsJMXConnectionError(err error) (*JMXConnectionError, bool)
IsJMXConnectionError tries to convert the error to exported JMXConnectionError.
func (*JMXConnectionError) Error ¶
func (e *JMXConnectionError) Error() string
func (*JMXConnectionError) String ¶
func (e *JMXConnectionError) String() string
type JMXError ¶
type JMXError nrprotocol.JMXError
JMXError is reported when a JMX query fails.
func IsJMXError ¶
IsJMXError asserts if the error is JMXError.
type ResponseType ¶
type ResponseType nrprotocol.ResponseType
ResponseType specify the type of the value of the AttributeResponse.