control

package
v0.0.0-...-bd03ed3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package control handles config requests from collect-jmx.

The lookup requests use the simple key host, or the composite (host, process).

The host-specific settings are always served. These setting may be extended using the process-specific settings, if found.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(config *config.Config) error

Handle registers the HTTP handlers.

func Update

func Update(config *config.Config) error

Update decodes the collect-jmx parts of the config.

Types

type Attribute

type Attribute struct {
	Name string `json:"attributeName"`
}

Attribute represent a single mbean attribute.

type KPI

type KPI struct {
	Name          string `xml:"name,attr" json:"name"`
	ID            string `xml:"id,attr" json:"id"`
	CollectRanges bool   `xml:"collectRanges,attr" json:"collectRanges"`
}

A KPI is the JSON structure of a KPIQuery.

type Key

type Key struct {
	Program, Host, Process string
}

Key represents the configuration lookup request.

type Object

type Object struct {
	// Attributes corresponds to Query's Attributes field.
	Attributes []*Attribute `json:"attributes,omitempty"`

	// KPIs corresponds to Query's KPI field.
	KPIs []*KPI `json:"kpis"`

	// MetricName corresponds to Query's ID field.
	MetricName string `json:"metricName"`

	// ObjectName corresponds to Query's On field.
	ObjectName string `json:"objectName"`
}

An Object is the JSON structure describing a Query.

type Process

type Process struct {
	ID string
}

A Process corresponds to a <process> configuration element.

func (*Process) UnmarshalXML

func (p *Process) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) error

type Query

type Query struct {
	ID         string
	On         string
	Attributes []string
	KPI        []*KPI
}

Query represents a <query> element in the config file.

func (*Query) MarshalJSON

func (q *Query) MarshalJSON() ([]byte, error)

func (*Query) UnmarshalXML

func (q *Query) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) error

type QueryGroup

type QueryGroup struct {
	ID      string
	Targets []string
	Query   []*Query
}

A QueryGroup corresponds to a <querygroup> configuration element.

func (*QueryGroup) Match

func (g *QueryGroup) Match(ids ...string) bool

func (*QueryGroup) UnmarshalXML

func (g *QueryGroup) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) error

type View

type View struct {
	Period  int      `json:"period"`
	Objects []*Query `json:"objects"`
}

View corresponds to collect-jmx configuration file.

Jump to

Keyboard shortcuts

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