statemetrics

package
v0.0.0-...-a0d7459 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2017 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2016 Canonical Ltd. Licensed under the AGPLv3, see LICENCE file for details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

Collector is a prometheus.Collector that collects metrics about the Juju global state.

func New

func New(st State) *Collector

New returns a new Collector.

func (*Collector) Collect

func (c *Collector) Collect(ch chan<- prometheus.Metric)

Collect is part of the prometheus.Collector interface.

func (*Collector) Describe

func (c *Collector) Describe(ch chan<- *prometheus.Desc)

Describe is part of the prometheus.Collector interface.

type Machine

type Machine interface {
	InstanceStatus() (status.StatusInfo, error)
	Life() state.Life
	Status() (status.StatusInfo, error)
}

Machine represents a machine in a Juju model.

type Model

type Model interface {
	Life() state.Life
	ModelTag() names.ModelTag
	Status() (status.StatusInfo, error)
}

Model represents a Juju model.

type State

type State interface {
	AllMachines() ([]Machine, error)
	AllModels() ([]Model, error)
	AllUsers() ([]User, error)
	ControllerTag() names.ControllerTag
	ForModel(names.ModelTag) (StateCloser, error)
	UserAccess(names.UserTag, names.Tag) (permission.UserAccess, error)
}

State represents the global state managed by the Juju controller.

func NewState

func NewState(st *state.State) State

NewState takes a *state.State, and returns a State value backed by it.

type StateCloser

type StateCloser interface {
	State
	Close() error
}

StateCloser extends the State interface with a Close method.

type User

type User interface {
	IsDeleted() bool
	IsDisabled() bool
	UserTag() names.UserTag
}

User represents a user known to the Juju controller.

Jump to

Keyboard shortcuts

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