statemetrics

package
v0.0.0-...-8ff1004 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 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(pool StatePool) *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 PooledState

type PooledState interface {
	state.PoolHelper
	State
}

PooledState is a wrapper for State that includes methods to negotiate with the pool that supplied it.

type State

type State interface {
	AllMachines() ([]Machine, error)
	AllModelUUIDs() ([]string, error)
	AllUsers() ([]User, error)
	ControllerTag() names.ControllerTag
	UserAccess(names.UserTag, names.Tag) (permission.UserAccess, error)
}

State represents the global state managed by the Juju controller.

type StatePool

type StatePool interface {
	SystemState() State
	Get(modelUUID string) (PooledState, error)
	GetModel(modelUUID string) (Model, state.PoolHelper, error)
}

StatePool represents a pool of State objects.

func NewStatePool

func NewStatePool(pool *state.StatePool) StatePool

NewStatePool takes a *state.StatePool, and returns a StatePool value backed by it.

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