forked from juju/juju
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stateinterface.go
31 lines (26 loc) · 945 Bytes
/
stateinterface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2016 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
// Package metricsender contains functions for sending
// metrics from a controller to a remote metric collector.
package metricsender
import (
"gopkg.in/juju/names.v2"
"github.com/juju/juju/controller"
"github.com/juju/juju/environs/config"
"github.com/juju/juju/state"
)
// ModelBackend contains methods that are used by the metrics sender.
type ModelBackend interface {
MetricsManager() (*state.MetricsManager, error)
MetricsToSend(batchSize int) ([]*state.MetricBatch, error)
SetMetricBatchesSent(batchUUIDs []string) error
CountOfUnsentMetrics() (int, error)
CountOfSentMetrics() (int, error)
CleanupOldMetrics() error
Name() string
Unit(name string) (*state.Unit, error)
ModelTag() names.ModelTag
ModelConfig() (*config.Config, error)
ControllerConfig() (controller.Config, error)
SetModelMeterStatus(string, string) error
}