metric

package
v6.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildsRunning = &Gauge{}
View Source
var BuildsStarted = &Counter{}
View Source
var ChecksDeleted = &Counter{}
View Source
var ChecksEnqueued = &Counter{}
View Source
var ChecksFinishedWithError = &Counter{}
View Source
var ChecksFinishedWithSuccess = &Counter{}
View Source
var ChecksQueueSize = &Gauge{}
View Source
var ChecksStarted = &Counter{}
View Source
var ConcurrentRequests = map[string]*Gauge{}
View Source
var ConcurrentRequestsLimitHit = map[string]*Counter{}
View Source
var ContainersCreated = &Counter{}
View Source
var ContainersDeleted = &Counter{}
View Source
var DatabaseQueries = &Counter{}
View Source
var Databases []db.Conn
View Source
var ErrFailedToEmit = errors.New("failed to emit metric")
View Source
var FailedContainers = &Counter{}
View Source
var FailedVolumes = &Counter{}
View Source
var JobsScheduled = &Counter{}
View Source
var JobsScheduling = &Gauge{}
View Source
var TasksWaiting = &Gauge{}
View Source
var VolumesCreated = &Counter{}
View Source
var VolumesDeleted = &Counter{}

Functions

func CountQueries

func CountQueries(conn db.Conn) db.Conn

func Deinitialize

func Deinitialize(logger lager.Logger)

func Initialize

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

func LogLockAcquired

func LogLockAcquired(logger lager.Logger, lockID lock.LockID)

func LogLockReleased

func LogLockReleased(logger lager.Logger, lockID lock.LockID)

func PeriodicallyEmit

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

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 ArtifactCollectorDuration

type ArtifactCollectorDuration struct {
	Duration time.Duration
}

func (ArtifactCollectorDuration) Emit

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

type BuildCollectorDuration

type BuildCollectorDuration struct {
	Duration time.Duration
}

func (BuildCollectorDuration) Emit

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

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 ContainerCollectorDuration

type ContainerCollectorDuration struct {
	Duration time.Duration
}

func (ContainerCollectorDuration) Emit

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

type Counter

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

func (*Counter) Delta

func (m *Counter) Delta() float64

func (*Counter) Inc

func (m *Counter) Inc()

func (*Counter) IncDelta

func (m *Counter) IncDelta(delta int)

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 ErrorLog

type ErrorLog struct {
	Message string
	Value   int
}

func (ErrorLog) Emit

func (e ErrorLog) Emit(logger lager.Logger)

type ErrorSinkCollector

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

func NewErrorSinkCollector

func NewErrorSinkCollector(logger lager.Logger) ErrorSinkCollector

func (*ErrorSinkCollector) Log

type Event

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

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

func (*Gauge) Set

func (c *Gauge) Set(val int64)

type HTTPResponseTime

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

func (HTTPResponseTime) Emit

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

type LockAcquired

type LockAcquired struct {
	LockType string
}

func (LockAcquired) Emit

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

type LockReleased

type LockReleased struct {
	LockType string
}

func (LockReleased) Emit

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

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 ResourceCacheCollectorDuration

type ResourceCacheCollectorDuration struct {
	Duration time.Duration
}

func (ResourceCacheCollectorDuration) Emit

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

type ResourceCacheUseCollectorDuration

type ResourceCacheUseCollectorDuration struct {
	Duration time.Duration
}

func (ResourceCacheUseCollectorDuration) Emit

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

type ResourceConfigCheckSessionCollectorDuration

type ResourceConfigCheckSessionCollectorDuration struct {
	Duration time.Duration
}

func (ResourceConfigCheckSessionCollectorDuration) Emit

type ResourceConfigCollectorDuration

type ResourceConfigCollectorDuration struct {
	Duration time.Duration
}

func (ResourceConfigCollectorDuration) Emit

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

type SchedulingJobDuration

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

func (SchedulingJobDuration) Emit

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

type VolumeCollectorDuration

type VolumeCollectorDuration struct {
	Duration time.Duration
}

func (VolumeCollectorDuration) Emit

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

type VolumesToBeGarbageCollected

type VolumesToBeGarbageCollected struct {
	Volumes int
}

func (VolumesToBeGarbageCollected) Emit

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

type WorkerCollectorDuration

type WorkerCollectorDuration struct {
	Duration time.Duration
}

func (WorkerCollectorDuration) Emit

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

type WorkerContainers

type WorkerContainers struct {
	WorkerName string
	Platform   string
	Containers int
	TeamName   string
	Tags       []string
}

func (WorkerContainers) Emit

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

type WorkerTasks

type WorkerTasks struct {
	WorkerName string
	Platform   string
	Tasks      int
}

func (WorkerTasks) Emit

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

type WorkerUnknownContainers

type WorkerUnknownContainers struct {
	WorkerName string
	Containers int
}

func (WorkerUnknownContainers) Emit

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

type WorkerUnknownVolumes

type WorkerUnknownVolumes struct {
	WorkerName string
	Volumes    int
}

func (WorkerUnknownVolumes) Emit

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

type WorkerVolumes

type WorkerVolumes struct {
	WorkerName string
	Platform   string
	Volumes    int
	TeamName   string
	Tags       []string
}

func (WorkerVolumes) Emit

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

type WorkersState

type WorkersState struct {
	WorkerStateByName map[string]db.WorkerState
}

func (WorkersState) Emit

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

Directories

Path Synopsis
emitterfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
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