metrics

package
v1.9.0-preview1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BindingAdd is the event when a new binding is added to API server.
	BindingAdd = "BindingAdd"
	// BindingUpdate is the event when a new binding is updated to API server.
	BindingUpdate = "BindingUpdate"
	// ScheduleAttemptFailure is the event when a schedule attempt fails.
	ScheduleAttemptFailure = "ScheduleAttemptFailure"
	// PolicyChanged means binding needs to be rescheduled for the policy changed
	PolicyChanged = "PolicyChanged"
	// ClusterChanged means binding needs to be rescheduled for the cluster changed
	ClusterChanged = "ClusterChanged"
)
View Source
const (
	// ScheduleStepFilter means the step in generic scheduler to filter clusters
	ScheduleStepFilter = "Filter"
	// ScheduleStepScore means the step in generic scheduler to score clusters
	ScheduleStepScore = "Score"
	// ScheduleStepSelect means the step in generic scheduler to select clusters
	ScheduleStepSelect = "Select"
	// ScheduleStepAssignReplicas means the step in generic scheduler to assign replicas
	ScheduleStepAssignReplicas = "AssignReplicas"
)
View Source
const SchedulerSubsystem = "karmada_scheduler"

SchedulerSubsystem - subsystem name used by scheduler

Variables

View Source
var (

	// SchedulerQueueIncomingBindings is the Number of ResourceBinding and ClusterResourceBinding objects added to scheduling queues by event type.
	SchedulerQueueIncomingBindings = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Subsystem: SchedulerSubsystem,
			Name:      "queue_incoming_bindings_total",
			Help:      "Number of ResourceBinding and ClusterResourceBinding objects added to scheduling queues by event type.",
		}, []string{"event"})

	// FrameworkExtensionPointDuration is the metrics which indicates the latency for running all plugins of a specific extension point.
	FrameworkExtensionPointDuration = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Subsystem: SchedulerSubsystem,
			Name:      "framework_extension_point_duration_seconds",
			Help:      "Latency for running all plugins of a specific extension point.",

			Buckets: prometheus.ExponentialBuckets(0.0001, 2, 12),
		},
		[]string{"extension_point", "result"})

	// PluginExecutionDuration is the metrics which indicates the duration for running a plugin at a specific extension point.
	PluginExecutionDuration = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Subsystem: SchedulerSubsystem,
			Name:      "plugin_execution_duration_seconds",
			Help:      "Duration for running a plugin at a specific extension point.",

			Buckets: prometheus.ExponentialBuckets(0.00001, 1.5, 20),
		},
		[]string{"plugin", "extension_point", "result"})
)

Functions

func BindingSchedule

func BindingSchedule(scheduleType string, duration float64, err error)

BindingSchedule can record a scheduling attempt and the duration since `start`.

func CountSchedulerBindings

func CountSchedulerBindings(event string)

CountSchedulerBindings records the number of binding added to scheduling queues by event type.

func ScheduleStep

func ScheduleStep(action string, startTime time.Time)

ScheduleStep can record each scheduling step duration.

Types

This section is empty.

Jump to

Keyboard shortcuts

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