metricsmanager

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: 15 Imported by: 0

Documentation

Overview

Package metricsmanager contains the implementation of an api endpoint for calling metrics functions in state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricsManager

type MetricsManager interface {
	CleanupOldMetrics(arg params.Entities) (params.ErrorResults, error)
	SendMetrics(args params.Entities) (params.ErrorResults, error)
}

MetricsManager defines the methods on the metricsmanager API end point.

type MetricsManagerAPI

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

MetricsManagerAPI implements the metrics manager interface and is the concrete implementation of the api end point.

func NewFacade

func NewFacade(ctx facade.Context) (*MetricsManagerAPI, error)

NewFacade wraps NewMetricsManagerAPI for API registration.

func NewMetricsManagerAPI

func NewMetricsManagerAPI(
	st *state.State,
	resources facade.Resources,
	authorizer facade.Authorizer,
	pool *state.StatePool,
	clock clock.Clock,
) (*MetricsManagerAPI, error)

NewMetricsManagerAPI creates a new API endpoint for calling metrics manager functions.

func (*MetricsManagerAPI) AddJujuMachineMetrics

func (api *MetricsManagerAPI) AddJujuMachineMetrics() error

AddJujuMachineMetrics adds a metric that counts the number of non-container machines in the current model.

func (*MetricsManagerAPI) CleanupOldMetrics

func (api *MetricsManagerAPI) CleanupOldMetrics(args params.Entities) (params.ErrorResults, error)

CleanupOldMetrics removes old metrics from the collection. The single arg params is expected to contain and model uuid. Even though the call will delete all metrics across models it serves to validate that the connection has access to at least one model.

func (*MetricsManagerAPI) SendMetrics

func (api *MetricsManagerAPI) SendMetrics(args params.Entities) (params.ErrorResults, error)

SendMetrics will send any unsent metrics onto the metric collection service.

Jump to

Keyboard shortcuts

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