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 ¶
func Register ¶
func Register(registry facade.FacadeRegistry)
Register is called to expose a package of facades onto a given registry.
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 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.