metrics

package
v0.0.0-...-e436aa5 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartPromServer

func StartPromServer(metricsAddress string)

StartPromServer starts up metrics-related endpoints and listeners.

Types

type Manager

type Manager interface {
	RecordGetSites(isSuccess bool, elapsed time.Duration)
	RecordGetSiteEvents(isSuccess bool, elapsed time.Duration, siteURL string, numEvents int)
	RecordRunEvent(isSuccess bool, elapsed time.Duration, siteURL string, reason string)
	RecordLockEvent(group locker.LockGroup, status string)
	RecordRunWorkerStats(currBusy int32, max int32)
	RecordFpmTiming(isSuccess bool, elapsed time.Duration)
	RecordSiteEventLag(url string, oldestEventTs time.Time)
}

Manager is the contract that metric implementations must follow.

type Mock

type Mock struct {
	Log bool
}

Mock is a mock implementation of a Metrics Manager.

func (Mock) RecordFpmTiming

func (m Mock) RecordFpmTiming(isSuccess bool, elapsed time.Duration)

RecordFpmTiming track FPM CLI calls.

func (Mock) RecordGetSiteEvents

func (m Mock) RecordGetSiteEvents(isSuccess bool, elapsed time.Duration, siteURL string, numEvents int)

RecordGetSiteEvents tracks successful performer.GetEvents() calls.

func (Mock) RecordGetSites

func (m Mock) RecordGetSites(isSuccess bool, elapsed time.Duration)

RecordGetSites tracks successful performer.GetSites() calls.

func (Mock) RecordLockEvent

func (m Mock) RecordLockEvent(group locker.LockGroup, status string)

func (Mock) RecordRunEvent

func (m Mock) RecordRunEvent(isSuccess bool, elapsed time.Duration, siteURL string, reason string)

RecordRunEvent tracks successful performer.runEvent() calls.

func (Mock) RecordRunWorkerStats

func (m Mock) RecordRunWorkerStats(currBusy int32, max int32)

RecordRunWorkerStats keeps track of runWorker activity.

func (Mock) RecordSiteEventLag

func (m Mock) RecordSiteEventLag(url string, oldestEventTs time.Time)

type Prom

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

Prom tracks metrics via prometheus Initialize with NewProm()

func NewProm

func NewProm() *Prom

NewProm configures the Prom metrics manager.

func (*Prom) RecordFpmTiming

func (p *Prom) RecordFpmTiming(isSuccess bool, elapsed time.Duration)

RecordFpmTiming track FPM CLI calls.

func (*Prom) RecordGetSiteEvents

func (p *Prom) RecordGetSiteEvents(isSuccess bool, elapsed time.Duration, siteURL string, numEvents int)

RecordGetSiteEvents tracks successful performer.GetEvents() calls.

func (*Prom) RecordGetSites

func (p *Prom) RecordGetSites(isSuccess bool, elapsed time.Duration)

RecordGetSites tracks successful performer.GetSites() calls.

func (*Prom) RecordLockEvent

func (p *Prom) RecordLockEvent(group locker.LockGroup, status string)

func (*Prom) RecordRunEvent

func (p *Prom) RecordRunEvent(isSuccess bool, elapsed time.Duration, siteURL string, reason string)

RecordRunEvent tracks successful performer.runEvent() calls.

func (*Prom) RecordRunWorkerStats

func (p *Prom) RecordRunWorkerStats(currBusy int32, max int32)

RecordRunWorkerStats keeps track of runWorker activity.

func (*Prom) RecordSiteEventLag

func (p *Prom) RecordSiteEventLag(url string, oldestEventTs time.Time)

Jump to

Keyboard shortcuts

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