metrics

package
v0.0.0-...-dcfb068 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SchedulerSubsystem - subsystem name used by scheduler
	SchedulerSubsystem = "scheduler"

	UpdatingPod = "updating"

	// PreFilterAddPodEvaluation - PreFilter add pod evaluation operation label value
	PreFilterAddPodEvaluation = "prefilter_evaluation"

	// PreFilterRemovePodEvaluation - PreFilter remove pod evaluation operation label value
	PreFilterRemovePodEvaluation = "prefilter_evaluation"

	// PreFilterEvaluation - PreFilter evaluation operation label value
	PreFilterEvaluation = "prefilter_evaluation"

	// FilterEvaluation - Filter evaluation operation label value
	FilterEvaluation = "filter_evaluation"

	// PreScoreEvaluation - PreScore evaluation operation label value
	PreScoreEvaluation = "prescore_evaluation"

	// ScoreEvaluation - Score evaluation operation label value
	ScoreEvaluation = "score_evaluation"

	// ScoreNormalizeEvaluation - Score normalize evaluation operation label value
	ScoreNormalizeEvaluation = "score_normalize_evaluation"

	// SuccessResult - result label value
	SuccessResult = "success"

	// FailureResult - result label value
	FailureResult = "failure"

	// Preempting phase label value
	PreemptingFindCandidates    = "find_candidates"
	PreemptingSelectCandidate   = "select_candidate"
	PreemptingFilterVictims     = "filter_victims"
	PreemptingPreparePriorities = "prepare_priorities"

	// ScheduledSuccessPhase - the scheduling cycle in which pod is successfully scheduled or preempted
	ScheduledSuccessPhase = "scheduled"
	// SchedulingWaitingPhase - The scheduling waiting process, which is the total latency of successfully scheduled
	// pod extracts the last successful scheduling latency, in seconds. This includes queue waiting duration as well.
	SchedulingWaitingPhase = "waiting"

	// unit schedule result
	UnitScheduleSucceed    = "succeed"
	UnitScheduleFailed     = "schedule_failed"
	UnitApplyToCacheFailed = "apply_to_cache_failed"
)

Variables

View Source
var (
	CacheSize = metrics.NewGaugeVec(
		&metrics.GaugeOpts{
			Subsystem:      SchedulerSubsystem,
			Name:           "cache_size",
			Help:           "Number of nodes, pods, and reserved (bound) pods in the scheduler cache.",
			StabilityLevel: metrics.ALPHA,
		}, []string{pkgmetrics.TypeLabel, pkgmetrics.SchedulerLabel})

	ClusterPodRequested = metrics.NewGaugeVec(
		&metrics.GaugeOpts{
			Subsystem: SchedulerSubsystem,
			Name:      "cluster_pod_requested",
			Help:      "The allocatable of one instance observed from node status.",
		}, []string{pkgmetrics.SubClusterLabel, pkgmetrics.QosLabel, pkgmetrics.ResourceLabel, pkgmetrics.SchedulerLabel})

	ClusterAllocatable = metrics.NewGaugeVec(
		&metrics.GaugeOpts{
			Subsystem: SchedulerSubsystem,
			Name:      "cluster_allocatable",
			Help:      "The capacity of one instance observed from node status.",
		}, []string{pkgmetrics.SubClusterLabel, pkgmetrics.QosLabel, pkgmetrics.ResourceLabel, pkgmetrics.SchedulerLabel})

	NodeCounter = metrics.NewGaugeVec(
		&metrics.GaugeOpts{
			Subsystem: SchedulerSubsystem,
			Name:      "cluster_nodes_total",
			Help:      "The total number of cluster nodes.",
		}, []string{pkgmetrics.StatusLabel, pkgmetrics.SchedulerLabel})
)
View Source
var SchedulerName string

SchedulerName name of scheduler to produce metrics

Functions

func ObservePodEvaluatedNodes

func ObservePodEvaluatedNodes(subCluster, qos, scheduler string, count float64)

func ObservePodFeasibleNodes

func ObservePodFeasibleNodes(subCluster, qos, scheduler string, count float64)

func ObservePodSchedulingLatency

func ObservePodSchedulingLatency(podProperty *api.PodProperty, attempts string, duration float64)

func ObservePodUpdatingAttemptAndLatency

func ObservePodUpdatingAttemptAndLatency(podProperty *api.PodProperty, result string, duration float64)

func ObserveUpdateSnapshotAttemptAndLatency

func ObserveUpdateSnapshotAttemptAndLatency(subCluster, qos, scheduler string, duration float64)

func PendingPodsAdd

func PendingPodsAdd(podProperty *api.PodProperty, queue string, value float64)

PendingPodsAdd Invoke Add method podLabels contains basic object property labels

func PendingUnitsDec

func PendingUnitsDec(unitProperty api.UnitProperty, queue string)

PendingUnitsDec Invoke Dec method podLabels contains basic object property labels

func PendingUnitsInc

func PendingUnitsInc(unitProperty api.UnitProperty, queue string)

PendingUnitsInc Invoke Inc method podLabels contains basic object property labels

func PodE2eSchedulingLatencyObserve

func PodE2eSchedulingLatencyObserve(podProperty *api.PodProperty, attempts string, duration float64)

PodE2eSchedulingLatencyObserve Invoke Observe method podLabels contains basic object property labels

func PodE2eSchedulingLatencyQuantileObserve

func PodE2eSchedulingLatencyQuantileObserve(podProperty *api.PodProperty, duration float64)

PodE2eSchedulingLatencyQuantileObserve Invoke Observe method podLabels contains basic object property labels

func PodNominated

func PodNominated(podProperty *api.PodProperty, duration float64)

PodNominated can record a successful preempting nomination attempt and the duration since `preemptingStart`.

func PodNominatedFailure

func PodNominatedFailure(podProperty *api.PodProperty, duration float64)

PodNominatedFailure can record a failed preempting nomination attempt and the duration since `start`.

func PodPendingLatencyObserve

func PodPendingLatencyObserve(podProperty *api.PodProperty, attempts string, duration float64)

PodPendingLatencyObserve Invoke Observe method podLabels contains basic object property labels

func PodScheduleError

func PodScheduleError(podProperty *api.PodProperty, duration float64)

PodScheduleError can record a scheduling attempt that had an error and the duration since `start`.

func PodScheduled

func PodScheduled(podProperty *api.PodProperty, duration float64)

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

func PodScheduledInPreempting

func PodScheduledInPreempting(podProperty *api.PodProperty, duration float64)

PodScheduledInPreempting can record a successful scheduling in preempting nomination attempt and the duration since `preemptingStart`.

func PodSchedulingStageDurationObserve

func PodSchedulingStageDurationObserve(podProperty *api.PodProperty, operation, plugin, status, nodeGroup string, duration float64)

PodSchedulingStageDurationObserve Invoke Observe method podLabels contains basic object property labels

func PodUnschedulable

func PodUnschedulable(podProperty *api.PodProperty, duration float64)

PodUnschedulable can record a scheduling attempt for an unschedulable pod and the duration since `start`.

func PodUpdatingAttemptsInc

func PodUpdatingAttemptsInc(podProperty *api.PodProperty, result string)

PodUpdatingAttemptsInc Invoke Inc method podLabels contains basic object property labels

func PodUpdatingLatencyObserve

func PodUpdatingLatencyObserve(podProperty *api.PodProperty, result string, duration float64)

PodUpdatingLatencyObserve Invoke Observe method podLabels contains basic object property labels

func PreemptingAttemptsInc

func PreemptingAttemptsInc(podProperty *api.PodProperty, result string)

PreemptingAttemptsInc Invoke Inc method podLabels contains basic object property labels

func PreemptingEvaluationDurationObserve

func PreemptingEvaluationDurationObserve(podProperty *api.PodProperty, result string, duration float64)

PreemptingEvaluationDurationObserve Invoke Observe method podLabels contains basic object property labels

func PreemptingEvaluationQuantileObserve

func PreemptingEvaluationQuantileObserve(podProperty *api.PodProperty, result string, duration float64)

PreemptingEvaluationQuantileObserve Invoke Observe method podLabels contains basic object property labels

func PreemptingStageLatencyObserve

func PreemptingStageLatencyObserve(podProperty *api.PodProperty, preemptingStage string, duration float64)

PreemptingStageLatencyObserve Invoke Observe method podLabels contains basic object property labels

func QueueSortingLatencyObserve

func QueueSortingLatencyObserve(podProperty *api.PodProperty, queue string, duration float64)

QueueSortingLatencyObserve Invoke Observe method podLabels contains basic object property labels

func Register

func Register(schedulerName string)

Register all metrics.

func RegisterSchedulerName

func RegisterSchedulerName(name string)

RegisterSchedulerName registers scheduler name, which is used as a value of ScheduleLabel

func ScheduleAttemptsInc

func ScheduleAttemptsInc(podProperty *api.PodProperty, result string)

ScheduleAttemptsInc Invoke Inc method podLabels contains basic object property labels

func SchedulerGoroutinesDec

func SchedulerGoroutinesDec(podProperty *api.PodProperty, work string)

SchedulerGoroutinesDec Invoke Dec method podLabels contains basic object property labels

func SchedulerGoroutinesInc

func SchedulerGoroutinesInc(podProperty *api.PodProperty, work string)

SchedulerGoroutinesInc Invoke Inc method podLabels contains basic object property labels

func SchedulerQueueIncomingPodsAdd

func SchedulerQueueIncomingPodsAdd(podProperty *api.PodProperty, queue, event string, value float64)

SchedulerQueueIncomingPodsAdd Invoke Add method podLabels contains basic object property labels

func SchedulerQueueIncomingPodsInc

func SchedulerQueueIncomingPodsInc(podProperty *api.PodProperty, queue, event string)

SchedulerQueueIncomingPodsInc Invoke Inc method podLabels contains basic object property labels

func SchedulerQueueIncomingUnitsInc

func SchedulerQueueIncomingUnitsInc(unitProperty api.UnitProperty, queue, event string)

SchedulerQueueIncomingUnitsInc Invoke Inc method podLabels contains basic object property labels

func SchedulerUnitE2ELatencyObserve

func SchedulerUnitE2ELatencyObserve(unitProperty api.UnitProperty, duration float64)

func SchedulingAlgorithmDurationObserve

func SchedulingAlgorithmDurationObserve(podProperty *api.PodProperty, result string, duration float64)

SchedulingAlgorithmDurationObserve Invoke Observe method podLabels contains basic object property labels

func SchedulingUpdateSnapshotDurationObserve

func SchedulingUpdateSnapshotDurationObserve(basicLabels metrics.Labels, duration float64)

SchedulingUpdateSnapshotDurationObserve Invoke Observe method basicLabels contains basic object property labels

func UnitPendingLatencyObserve

func UnitPendingLatencyObserve(unitProperty api.UnitProperty, duration float64)

UnitPendingLatencyObserve Invoke Observe method podLabels contains basic object property labels

func UnitScheduleResultObserve

func UnitScheduleResultObserve(unitProperty api.UnitProperty, result string, minMember float64)

Types

type PendingUnitsRecorder

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

PendingUnitsRecorder is an implementation of MetricRecorder

func NewPendingUnitsRecorder

func NewPendingUnitsRecorder(queue string) *PendingUnitsRecorder

NewPendingUnitsRecorder return PendingUnitsRecorder about given queue

func (*PendingUnitsRecorder) AddingLatencyInSeconds

func (r *PendingUnitsRecorder) AddingLatencyInSeconds(obj interface{}, duration float64)

func (*PendingUnitsRecorder) Clear

func (r *PendingUnitsRecorder) Clear()

Clear set a metric counter to 0, in an atomic way

func (*PendingUnitsRecorder) Dec

func (r *PendingUnitsRecorder) Dec(obj interface{})

Dec decreases the pod and unit metrics, in an atomic way

func (*PendingUnitsRecorder) Inc

func (r *PendingUnitsRecorder) Inc(obj interface{})

Inc increases the pod and unit metrics, in an atomic way

type ScheduleResult

type ScheduleResult string
var (
	// ScheduledResult is marked as successful scheduling with feasible nodes
	ScheduledResult ScheduleResult = "scheduled"

	// UnschedulableResult is marked as successful scheduling but no suitable nodes found, exclude preempting nomination
	UnschedulableResult ScheduleResult = "unschedulable"

	// NominatedResult is marked as successful preempting nomination
	NominatedResult ScheduleResult = "nominated"

	// NominatedSchedulingResult is marked as successful scheduling in preempting
	NominatedSchedulingResult ScheduleResult = "nominatedScheduling"

	// NominatedFailureResult is marked as uns
	NominatedFailureResult ScheduleResult = "nominatedFailure"

	// ErrorResult is marked as internal error, including scheduling and preempting nomination
	ErrorResult ScheduleResult = "error"
)

Jump to

Keyboard shortcuts

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