Documentation
¶
Index ¶
- func StartPromServer(metricsAddress string)
- type Manager
- type Mock
- func (m Mock) RecordFpmTiming(isSuccess bool, elapsed time.Duration)
- func (m Mock) RecordGetSiteEvents(isSuccess bool, elapsed time.Duration, siteURL string, numEvents int)
- func (m Mock) RecordGetSites(isSuccess bool, elapsed time.Duration)
- func (m Mock) RecordLockEvent(group locker.LockGroup, status string)
- func (m Mock) RecordRunEvent(isSuccess bool, elapsed time.Duration, siteURL string, reason string)
- func (m Mock) RecordRunWorkerStats(currBusy int32, max int32)
- func (m Mock) RecordSiteEventLag(url string, oldestEventTs time.Time)
- type Prom
- func (p *Prom) RecordFpmTiming(isSuccess bool, elapsed time.Duration)
- func (p *Prom) RecordGetSiteEvents(isSuccess bool, elapsed time.Duration, siteURL string, numEvents int)
- func (p *Prom) RecordGetSites(isSuccess bool, elapsed time.Duration)
- func (p *Prom) RecordLockEvent(group locker.LockGroup, status string)
- func (p *Prom) RecordRunEvent(isSuccess bool, elapsed time.Duration, siteURL string, reason string)
- func (p *Prom) RecordRunWorkerStats(currBusy int32, max int32)
- func (p *Prom) RecordSiteEventLag(url string, oldestEventTs time.Time)
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 ¶
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 ¶
RecordGetSites tracks successful performer.GetSites() calls.
func (Mock) RecordRunEvent ¶
RecordRunEvent tracks successful performer.runEvent() calls.
func (Mock) RecordRunWorkerStats ¶
RecordRunWorkerStats keeps track of runWorker activity.
type Prom ¶
type Prom struct {
// contains filtered or unexported fields
}
Prom tracks metrics via prometheus Initialize with NewProm()
func (*Prom) RecordFpmTiming ¶
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 ¶
RecordGetSites tracks successful performer.GetSites() calls.
func (*Prom) RecordLockEvent ¶
func (*Prom) RecordRunEvent ¶
RecordRunEvent tracks successful performer.runEvent() calls.
func (*Prom) RecordRunWorkerStats ¶
RecordRunWorkerStats keeps track of runWorker activity.