elasticsearch

package
v0.0.0-...-d990f74 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Urls of the cluster to watch with the plugin.
	Urls []string
}

Config is the configuration for the Elasticsearch plugin.

type Plugin

type Plugin struct {
	NumNodes     metrics.Gauge // number of nodes in the cluster
	NumDataNodes metrics.Gauge // number of data nodes in the cluster
	Shards       struct {
		Active       metrics.Gauge // active shards
		Relocating   metrics.Gauge // relocating shards
		Initializing metrics.Gauge // initializing shards
		Unassigned   metrics.Gauge // unassigned shards
	}
	NumPendingTasks metrics.Gauge // number of pending shards

	NumIndices metrics.Gauge // number of indices

	HeapUsed    metrics.Gauge        // heap used (on all nodes of the cluster)
	HeapMax     metrics.Gauge        // max heap size (of all nodes in the cluster)
	HeapPercent metrics.GaugeFloat64 // percentage of heap used (all nodes)

	CPUPercent metrics.GaugeFloat64 // CPU usage across all nodes of the cluster

	OFDMin metrics.Gauge // min open file descriptors (all nodes)
	OFDMax metrics.Gauge // max open file descriptors (all nodes)
	OFDAvg metrics.Gauge // avg open file descriptors (all nodes)
	// contains filtered or unexported fields
}

Plugin that watches an Elasticsearch cluster.

func NewPlugin

func NewPlugin(name string, config *Config) (*Plugin, error)

NewPlugin initializes a new watcher for an Elasticsearch cluster. Pass a name to differentiate between different clusters.

func (*Plugin) Name

func (p *Plugin) Name() string

Name of the plugin.

func (*Plugin) Snapshot

func (p *Plugin) Snapshot() (interface{}, error)

Snapshot returns a snapshot of the current cluster metrics.

type Stats

type Stats struct {
	Cluster struct {
		Name  string
		State string
	}

	NumNodes     int64
	NumDataNodes int64
	Shards       struct {
		Active       int64
		Relocating   int64
		Initializing int64
		Unassigned   int64
	}
	NumPendingTasks int64

	NumIndices int64

	HeapUsed    int64
	HeapMax     int64
	HeapPercent float64

	CPUPercent float64

	OFDMin int64
	OFDMax int64
	OFDAvg int64
}

Stats contains all information gathered of a cluster periodically.

func GetStats

func GetStats(client *elastic.Client) (*Stats, error)

GetStats gathers a snapshot of the cluster.

Jump to

Keyboard shortcuts

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