application

package
v4.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2016 License: MIT Imports: 25 Imported by: 1

Documentation

Overview

Package application allows the creation of Application struct. There's only one Application per main().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Hostname      string
	GeneralConfig config.GeneralConfig
	DBConfig      *config.DBConfig

	Mailers            map[string]*mailer.Mailer
	HandlerInstruments map[string]chan int64
	LatencyGauges      map[string]metrics.Gauge
	MetricsRegistry    metrics.Registry
	MessageBus         *messagebus.MessageBus
	Peers              *gocache.Cache
	RefetchChecksChan  chan bool
	// contains filtered or unexported fields
}

Application is the application object that runs HTTP server.

func New

func New(configDir string) (*Application, error)

New is the constructor for Application struct.

func (*Application) CheckAndRunTriggers

func (app *Application) CheckAndRunTriggers()

CheckAndRunTriggers pulls list of all checks, distributed evenly across N master daemons, evaluates the checks and run triggers when conditions are met.

func (*Application) FullAddr

func (app *Application) FullAddr() string

func (*Application) MessageBusHandlers

func (app *Application) MessageBusHandlers() map[string]func(msg string)

func (*Application) MiddlewareStruct

func (app *Application) MiddlewareStruct() (*interpose.Middleware, error)

MiddlewareStruct configures all the middlewares that are in-use for all request handlers.

func (*Application) MigrateUpAll

func (app *Application) MigrateUpAll() error

MigrateUpAll runs all migration files to be up-to-date.

func (*Application) NewHTTPServer

func (app *Application) NewHTTPServer() (*graceful.Server, error)

NewHTTPServer returns an instance of HTTP server.

func (*Application) NewHandlerInstruments

func (app *Application) NewHandlerInstruments() map[string]chan int64

func (*Application) NewMessageBus

func (app *Application) NewMessageBus(generalConfig config.GeneralConfig) (*messagebus.MessageBus, error)

NewMessageBus creates a new MessageBus instance.

func (*Application) NewMetricsRegistry

func (app *Application) NewMetricsRegistry(handlerInstruments map[string]chan int64, latencyGauges map[string]metrics.Gauge) metrics.Registry

func (*Application) PruneAll

func (app *Application) PruneAll()

PruneAll runs background job to prune all old timeseries data.

func (*Application) PruneTSCheckOnce

func (app *Application) PruneTSCheckOnce(clusterID int64) (err error)

PruneTSCheckOnce deletes old ts_checks data.

func (*Application) PruneTSEventOnce

func (app *Application) PruneTSEventOnce(clusterID int64) (err error)

PruneTSEventOnce deletes old ts_events data.

func (*Application) PruneTSExecutorLogOnce

func (app *Application) PruneTSExecutorLogOnce(clusterID int64) (err error)

PruneTSExecutorLogOnce deletes old ts_executor_logs data.

func (*Application) PruneTSLogOnce

func (app *Application) PruneTSLogOnce(clusterID int64) (err error)

PruneTSLogOnce deletes old ts_logs data.

func (*Application) PruneTSMetricAggr15mOnce

func (app *Application) PruneTSMetricAggr15mOnce(clusterID int64) (err error)

PruneTSMetricAggr15mOnce deletes old ts_metrics_aggr_15m data.

func (*Application) PruneTSMetricOnce

func (app *Application) PruneTSMetricOnce(clusterID int64) (err error)

PruneTSMetricOnce deletes old ts_metrics data.

func (*Application) SendHeartbeat

func (app *Application) SendHeartbeat()

SendHeartbeat every 30 seconds over message bus.

Jump to

Keyboard shortcuts

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