metric

package
v4.2.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: Apache-2.0 Imports: 12 Imported by: 249

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContainersCreated = Meter(0)
View Source
var ContainersDeleted = Meter(0)
View Source
var DatabaseQueries = Meter(0)
View Source
var Databases []db.Conn
View Source
var FailedContainers = Meter(0)
View Source
var FailedVolumes = Meter(0)
View Source
var VolumesCreated = Meter(0)
View Source
var VolumesDeleted = 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) error

func PeriodicallyEmit

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

func RegisterEmitter

func RegisterEmitter(factory EmitterFactory)

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
	TeamName      string
}

func (BuildFinished) Emit

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

type BuildStarted

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

func (BuildStarted) Emit

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

type CreatedContainersToBeGarbageCollected

type CreatedContainersToBeGarbageCollected struct {
	Containers int
}

func (CreatedContainersToBeGarbageCollected) Emit

type CreatedVolumesToBeGarbageCollected

type CreatedVolumesToBeGarbageCollected struct {
	Volumes int
}

func (CreatedVolumesToBeGarbageCollected) Emit

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

type CreatingContainersToBeGarbageCollected

type CreatingContainersToBeGarbageCollected struct {
	Containers int
}

func (CreatingContainersToBeGarbageCollected) Emit

type DestroyingContainersToBeGarbageCollected

type DestroyingContainersToBeGarbageCollected struct {
	Containers int
}

func (DestroyingContainersToBeGarbageCollected) Emit

type DestroyingVolumesToBeGarbageCollected

type DestroyingVolumesToBeGarbageCollected struct {
	Volumes int
}

func (DestroyingVolumesToBeGarbageCollected) Emit

type Emitter

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

type EmitterFactory

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

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 FailedContainersToBeGarbageCollected

type FailedContainersToBeGarbageCollected struct {
	Containers int
}

func (FailedContainersToBeGarbageCollected) Emit

type FailedVolumesToBeGarbageCollected

type FailedVolumesToBeGarbageCollected struct {
	Volumes int
}

func (FailedVolumesToBeGarbageCollected) Emit

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

type GarbageCollectionContainerCollectorJobDropped

type GarbageCollectionContainerCollectorJobDropped struct {
	WorkerName string
}

func (GarbageCollectionContainerCollectorJobDropped) Emit

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

func (*Meter) IncDelta

func (m *Meter) IncDelta(delta int)

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 ResourceCheck

type ResourceCheck struct {
	PipelineName string
	ResourceName string
	TeamName     string
	Success      bool
}

func (ResourceCheck) Emit

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

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 VolumesToBeGarbageCollected

type VolumesToBeGarbageCollected struct {
	Volumes int
}

func (VolumesToBeGarbageCollected) Emit

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

type WorkerContainers

type WorkerContainers struct {
	WorkerName string
	Platform   string
	Containers int
}

func (WorkerContainers) Emit

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

type WorkerVolumes

type WorkerVolumes struct {
	WorkerName string
	Platform   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