scheduler

package
v0.0.0-...-c72af41 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CheckFailureTotal = promauto.NewCounterVec(prometheus.CounterOpts{
	Name: utils.MetricSuffix + "_scheduler_check_failure",
	Help: "Total number of check failures during scheduling",
}, []string{"func", "endpoint_name", "check_name"})
View Source
var CheckSuccessTotal = promauto.NewCounterVec(prometheus.CounterOpts{
	Name: utils.MetricSuffix + "_scheduler_check_success",
	Help: "Total number of successful checks call during scheduling",
}, []string{"func", "endpoint_name", "check_name"})
View Source
var EndpointFailureTotal = promauto.NewCounterVec(prometheus.CounterOpts{
	Name: utils.MetricSuffix + "_scheduler_endpoint_failure",
	Help: "Total number of failures during scheduling for an endpoint",
}, []string{"func", "endpoint_name"})
View Source
var EndpointSuccessTotal = promauto.NewCounterVec(prometheus.CounterOpts{
	Name: utils.MetricSuffix + "_scheduler_endpoint_success",
	Help: "Total number of successful operations during scheduling for an endpoint",
}, []string{"func", "endpoint_name"})
View Source
var SchedulerFailureTotal = promauto.NewCounterVec(prometheus.CounterOpts{
	Name: utils.MetricSuffix + "_scheduler_failure",
	Help: "Total number of failures during scheduling",
}, []string{"endpoint_name"})

Functions

func Noop

Noop do nothing. It is a noop function to use in a check when there is nothing to do

Types

type Check

type Check struct {
	// Name of the check
	Name string
	// Prepare function called once after the endpoint has been init
	// Used to prepare the database the check (creating the monitoring keyspaces/buckets... etc)
	PrepareFn func(topology.ProbeableEndpoint) error
	// Check function called every Interval
	// Used to monitor the endpoint, this should produce metrics for SLXs
	CheckFn func(topology.ProbeableEndpoint) error
	// Teardown function called just before terminating/closing an endpoint
	// Used to clean the database if needed
	TeardownFn func(topology.ProbeableEndpoint) error
	// Interval at which the CheckFn is performed
	Interval time.Duration
}

type CheckConfig

type CheckConfig struct {
	Enable   bool          `yaml:"enable,omitempty"`
	Interval time.Duration `yaml:"interval,omitempty"`
}

type ProberWorker

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

func (*ProberWorker) PrepareProbing

func (pw *ProberWorker) PrepareProbing() error

func (*ProberWorker) StartProbing

func (pw *ProberWorker) StartProbing()

type ProbingScheduler

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

func NewProbingScheduler

func NewProbingScheduler(logger log.Logger, topologyUpdateChan chan topology.ClusterMap) ProbingScheduler

func (*ProbingScheduler) RegisterNewClusterCheck

func (ps *ProbingScheduler) RegisterNewClusterCheck(check Check)

RegisterNewClusterCheck add a new check at the cluster level It will be executed once per cluster every check interval

func (*ProbingScheduler) RegisterNewNodeCheck

func (ps *ProbingScheduler) RegisterNewNodeCheck(check Check)

RegisterNewClusterCheck add a new check level It will be executed once for each nodes every check interval

func (*ProbingScheduler) Start

func (ps *ProbingScheduler) Start()

Start the probing scheduler: - listen for topology changes - start and stop probes

Jump to

Keyboard shortcuts

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