application

package
v4.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 25, 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
	Peers              *libmap.TSafeMapString // Peers include self
	HandlerInstruments map[string]chan int64
	LatencyGauges      map[string]metrics.Gauge
	MetricsRegistry    metrics.Registry
	// 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(refetchChecksChan <-chan bool)

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) HandleAllTypesOfNotification

func (app *Application) HandleAllTypesOfNotification(notification *pq.Notification) error

func (*Application) HandlePGNotificationPeersAdd

func (app *Application) HandlePGNotificationPeersAdd(notification *pq.Notification) error

HandlePGNotificationPeersAdd responds to peers_add channel.

func (*Application) HandlePGNotificationPeersRemove

func (app *Application) HandlePGNotificationPeersRemove(notification *pq.Notification) error

HandlePGNotificationPeersRemove responds to peers_remove channel.

func (*Application) ListenAllPGChannels

func (app *Application) ListenAllPGChannels(listener *pq.ListenerConn) (bool, error)

ListenAllPGChannels listens to all predefined channels.

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) NewMetricsRegistry

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

func (*Application) NewPGListener

func (app *Application) NewPGListener(generalConfig config.GeneralConfig) (*pq.ListenerConn, <-chan *pq.Notification, error)

NewPGListener creates a new database connection for the purpose of listening events.

func (*Application) PGNotifyChecksRefetch

func (app *Application) PGNotifyChecksRefetch() error

PGNotifyChecksRefetch sends message to checks_refetch channel.

func (*Application) PGNotifyPeersAdd

func (app *Application) PGNotifyPeersAdd() error

PGNotifyPeersAdd sends message to peers_add channel.

func (*Application) PGNotifyPeersRemove

func (app *Application) PGNotifyPeersRemove() error

PGNotifyPeersRemove sends message to peers_remove channel.

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.

Jump to

Keyboard shortcuts

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