Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config holds the settings for various parameters for the UsageMetricsReporter
func (*Config) WithDatacenter ¶
WithDatacenter adds the datacenter as a label to all metrics emitted by the UsageMetricsReporter
func (*Config) WithLogger ¶
WithLogger takes a logger and creates a new, named sub-logger to use when running
func (*Config) WithReportingInterval ¶
WithReportingInterval specifies the interval on which UsageMetricsReporter should emit metrics
func (*Config) WithStateProvider ¶
func (c *Config) WithStateProvider(sp StateProvider) *Config
type StateProvider ¶
StateProvider defines an inteface for retrieving a state.Store handle. In non-test code, this is satisfied by the fsm.FSM struct.
type UsageMetricsReporter ¶
type UsageMetricsReporter struct {
// contains filtered or unexported fields
}
UsageMetricsReporter provides functionality for emitting usage metrics into the metrics stream. This makes it essentially a translation layer between the state store and metrics stream.
func NewUsageMetricsReporter ¶
func NewUsageMetricsReporter(cfg *Config) (*UsageMetricsReporter, error)
func (*UsageMetricsReporter) Run ¶
func (u *UsageMetricsReporter) Run(ctx context.Context)
Run must be run in a goroutine, and can be stopped by closing or sending data to the passed in shutdownCh