timemonitor

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TimeMonitor

type TimeMonitor struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

TimeMonitor is used to periodically monitor if time.Now().Sub(refreshTime) is greater than durationThreshold

func NewTimeMonitor

func NewTimeMonitor(name string, interval, unhealthyThreshold, healthyThreshold time.Duration,
	unhealthyMetricName string, emitter metrics.MetricEmitter, capacity int, healthy bool,
) (*TimeMonitor, error)

func (*TimeMonitor) GetHealthy added in v0.5.4

func (m *TimeMonitor) GetHealthy() bool

func (*TimeMonitor) Run

func (m *TimeMonitor) Run(stopCh <-chan struct{})

Run is blocking runned

func (*TimeMonitor) UpdateRefreshTime

func (m *TimeMonitor) UpdateRefreshTime()

Jump to

Keyboard shortcuts

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