metric

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//DefaultMetricsEnable is default state for metrics
	DefaultMetricsEnable = false
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled    bool              `toml:"enable-metrics"`
	Slack      slack.Config      `toml:"slack"`
	Console    console.Config    `toml:"console"`
	Cloudwatch cloudwatch.Config `toml:"cloudwatch"`
}

Config represents the meta configuration.

func NewConfig

func NewConfig() *Config

NewConfig builds a new configuration with default values.

func (*Config) Validate

func (c *Config) Validate() error

Validate the config

type Service

type Service struct {
	Config    *Config
	Logger    *logrus.Logger
	Reporters []adapters.Reporter
}

Service Returns a config

func NewService

func NewService(config *Config, reporters []adapters.Reporter) *Service

NewService creates a new service adapter

func (*Service) Printf

func (s *Service) Printf(format string, v ...interface{})

Printf formats a message ot the default logger

func (*Service) Start

func (s *Service) Start() error

Start starts the metrics reporter

func (*Service) Stop

func (s *Service) Stop() error

Stop stops the metrics service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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