metric

package
v3.3.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DatabaseConnections = &Gauge{}
View Source
var DatabaseQueries = Meter(0)

Functions

func CountQueries

func CountQueries(conn db.Conn) db.Conn

func Initialize

func Initialize(logger lager.Logger, host string, attributes map[string]string)

func PeriodicallyEmit

func PeriodicallyEmit(logger lager.Logger, interval time.Duration)

func RegisterEmitter

func RegisterEmitter(factory EmitterFactory)

func SetupConnectionCountingDriver

func SetupConnectionCountingDriver(delegateDriverName, sqlDataSource, newDriverName string)

func WireEmitters

func WireEmitters(group *flags.Group)

func WrapHandler

func WrapHandler(logger lager.Logger, route string, handler http.Handler) http.Handler

Types

type BuildFinished

type BuildFinished struct {
	PipelineName  string
	JobName       string
	BuildName     string
	BuildID       int
	BuildStatus   db.BuildStatus
	BuildDuration time.Duration
}

func (BuildFinished) Emit

func (event BuildFinished) Emit(logger lager.Logger)

type BuildStarted

type BuildStarted struct {
	PipelineName string
	JobName      string
	BuildName    string
	BuildID      int
}

func (BuildStarted) Emit

func (event BuildStarted) Emit(logger lager.Logger)

type Conn

type Conn interface {
	Prepare(query string) (driver.Stmt, error)
	Close() error
	Begin() (driver.Tx, error)
}

type Driver

type Driver interface {
	Open(name string) (driver.Conn, error)
}

type Emitter

type Emitter interface {
	Emit(lager.Logger, Event)
}

type EmitterFactory

type EmitterFactory interface {
	Description() string
	IsConfigured() bool
	NewEmitter() Emitter
}

type Event

type Event struct {
	Name       string
	Value      interface{}
	State      EventState
	Attributes map[string]string
	Host       string
	Time       time.Time
}

type EventState

type EventState string
const EventStateCritical EventState = "critical"
const EventStateOK EventState = "ok"
const EventStateWarning EventState = "warning"

type Gauge

type Gauge struct {
	// contains filtered or unexported fields
}

func (*Gauge) Dec

func (c *Gauge) Dec()

func (*Gauge) Inc

func (c *Gauge) Inc()

func (*Gauge) Max

func (c *Gauge) Max() int

type HTTPResponseTime

type HTTPResponseTime struct {
	Route    string
	Path     string
	Method   string
	Duration time.Duration
}

func (HTTPResponseTime) Emit

func (event HTTPResponseTime) Emit(logger lager.Logger)

type Meter

type Meter int64

func (*Meter) Delta

func (m *Meter) Delta() int

func (*Meter) Inc

func (m *Meter) Inc()

type MetricsHandler

type MetricsHandler struct {
	Logger lager.Logger

	Route   string
	Handler http.Handler
}

func (MetricsHandler) ServeHTTP

func (handler MetricsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type SchedulingFullDuration

type SchedulingFullDuration struct {
	PipelineName string
	Duration     time.Duration
}

func (SchedulingFullDuration) Emit

func (event SchedulingFullDuration) Emit(logger lager.Logger)

type SchedulingJobDuration

type SchedulingJobDuration struct {
	PipelineName string
	JobName      string
	Duration     time.Duration
}

func (SchedulingJobDuration) Emit

func (event SchedulingJobDuration) Emit(logger lager.Logger)

type SchedulingLoadVersionsDuration

type SchedulingLoadVersionsDuration struct {
	PipelineName string
	Duration     time.Duration
}

func (SchedulingLoadVersionsDuration) Emit

func (event SchedulingLoadVersionsDuration) Emit(logger lager.Logger)

type WorkerContainers

type WorkerContainers struct {
	WorkerName string
	Containers int
}

func (WorkerContainers) Emit

func (event WorkerContainers) Emit(logger lager.Logger)

type WorkerVolumes

type WorkerVolumes struct {
	WorkerName string
	Volumes    int
}

func (WorkerVolumes) Emit

func (event WorkerVolumes) Emit(logger lager.Logger)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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