metrics

package
v1.18.11-rc.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: Apache-2.0 Imports: 5 Imported by: 130

Documentation

Index

Constants

View Source
const (
	// SchedulerSubsystem - subsystem name used by scheduler
	SchedulerSubsystem = "scheduler"
	// DeprecatedSchedulingDurationName - scheduler duration metric name which is deprecated
	DeprecatedSchedulingDurationName = "scheduling_duration_seconds"

	// OperationLabel - operation label name
	OperationLabel = "operation"

	// PredicateEvaluation - predicate evaluation operation label value
	PredicateEvaluation = "predicate_evaluation"
	// PriorityEvaluation - priority evaluation operation label value
	PriorityEvaluation = "priority_evaluation"
	// PreemptionEvaluation - preemption evaluation operation label value (occurs in case of scheduling fitError).
	PreemptionEvaluation = "preemption_evaluation"
	// Binding - binding operation label value
	Binding = "binding"
)

Variables

View Source
var (

	// PodScheduleSuccesses counts how many pods were scheduled.
	// This metric will be initialized again in Register() to assure the metric is not no-op metric.
	PodScheduleSuccesses = scheduleAttempts.With(metrics.Labels{"result": "scheduled"})
	// PodScheduleFailures counts how many pods could not be scheduled.
	// This metric will be initialized again in Register() to assure the metric is not no-op metric.
	PodScheduleFailures = scheduleAttempts.With(metrics.Labels{"result": "unschedulable"})
	// PodScheduleErrors counts how many pods could not be scheduled due to a scheduler error.
	// This metric will be initialized again in Register() to assure the metric is not no-op metric.
	PodScheduleErrors            = scheduleAttempts.With(metrics.Labels{"result": "error"})
	DeprecatedSchedulingDuration = metrics.NewSummaryVec(
		&metrics.SummaryOpts{
			Subsystem: SchedulerSubsystem,
			Name:      DeprecatedSchedulingDurationName,
			Help:      "Scheduling latency in seconds split by sub-parts of the scheduling operation",

			MaxAge:            5 * time.Hour,
			StabilityLevel:    metrics.ALPHA,
			DeprecatedVersion: "1.19.0",
		},
		[]string{OperationLabel},
	)
	E2eSchedulingLatency = metrics.NewHistogram(
		&metrics.HistogramOpts{
			Subsystem:      SchedulerSubsystem,
			Name:           "e2e_scheduling_duration_seconds",
			Help:           "E2e scheduling latency in seconds (scheduling algorithm + binding)",
			Buckets:        metrics.ExponentialBuckets(0.001, 2, 15),
			StabilityLevel: metrics.ALPHA,
		},
	)
	SchedulingAlgorithmLatency = metrics.NewHistogram(
		&metrics.HistogramOpts{
			Subsystem:      SchedulerSubsystem,
			Name:           "scheduling_algorithm_duration_seconds",
			Help:           "Scheduling algorithm latency in seconds",
			Buckets:        metrics.ExponentialBuckets(0.001, 2, 15),
			StabilityLevel: metrics.ALPHA,
		},
	)
	DeprecatedSchedulingAlgorithmPredicateEvaluationSecondsDuration = metrics.NewHistogram(
		&metrics.HistogramOpts{
			Subsystem:         SchedulerSubsystem,
			Name:              "scheduling_algorithm_predicate_evaluation_seconds",
			Help:              "Scheduling algorithm predicate evaluation duration in seconds",
			Buckets:           metrics.ExponentialBuckets(0.001, 2, 15),
			StabilityLevel:    metrics.ALPHA,
			DeprecatedVersion: "1.19.0",
		},
	)
	DeprecatedSchedulingAlgorithmPriorityEvaluationSecondsDuration = metrics.NewHistogram(
		&metrics.HistogramOpts{
			Subsystem:         SchedulerSubsystem,
			Name:              "scheduling_algorithm_priority_evaluation_seconds",
			Help:              "Scheduling algorithm priority evaluation duration in seconds",
			Buckets:           metrics.ExponentialBuckets(0.001, 2, 15),
			StabilityLevel:    metrics.ALPHA,
			DeprecatedVersion: "1.19.0",
		},
	)
	SchedulingAlgorithmPreemptionEvaluationDuration = metrics.NewHistogram(
		&metrics.HistogramOpts{
			Subsystem:      SchedulerSubsystem,
			Name:           "scheduling_algorithm_preemption_evaluation_seconds",
			Help:           "Scheduling algorithm preemption evaluation duration in seconds",
			Buckets:        metrics.ExponentialBuckets(0.001, 2, 15),
			StabilityLevel: metrics.ALPHA,
		},
	)
	BindingLatency = metrics.NewHistogram(
		&metrics.HistogramOpts{
			Subsystem:      SchedulerSubsystem,
			Name:           "binding_duration_seconds",
			Help:           "Binding latency in seconds",
			Buckets:        metrics.ExponentialBuckets(0.001, 2, 15),
			StabilityLevel: metrics.ALPHA,
		},
	)
	PreemptionVictims = metrics.NewHistogram(
		&metrics.HistogramOpts{
			Subsystem: SchedulerSubsystem,
			Name:      "pod_preemption_victims",
			Help:      "Number of selected preemption victims",

			Buckets:        metrics.LinearBuckets(5, 5, 10),
			StabilityLevel: metrics.ALPHA,
		})
	PreemptionAttempts = metrics.NewCounter(
		&metrics.CounterOpts{
			Subsystem:      SchedulerSubsystem,
			Name:           "total_preemption_attempts",
			Help:           "Total preemption attempts in the cluster till now",
			StabilityLevel: metrics.ALPHA,
		})

	SchedulerGoroutines = metrics.NewGaugeVec(
		&metrics.GaugeOpts{
			Subsystem:      SchedulerSubsystem,
			Name:           "scheduler_goroutines",
			Help:           "Number of running goroutines split by the work they do such as binding.",
			StabilityLevel: metrics.ALPHA,
		}, []string{"work"})

	PodSchedulingDuration = metrics.NewHistogram(
		&metrics.HistogramOpts{
			Subsystem: SchedulerSubsystem,
			Name:      "pod_scheduling_duration_seconds",
			Help:      "E2e latency for a pod being scheduled which may include multiple scheduling attempts.",

			Buckets:        metrics.ExponentialBuckets(0.001, 2, 15),
			StabilityLevel: metrics.ALPHA,
		})

	PodSchedulingAttempts = metrics.NewHistogram(
		&metrics.HistogramOpts{
			Subsystem:      SchedulerSubsystem,
			Name:           "pod_scheduling_attempts",
			Help:           "Number of attempts to successfully schedule a pod.",
			Buckets:        metrics.ExponentialBuckets(1, 2, 5),
			StabilityLevel: metrics.ALPHA,
		})

	FrameworkExtensionPointDuration = metrics.NewHistogramVec(
		&metrics.HistogramOpts{
			Subsystem: SchedulerSubsystem,
			Name:      "framework_extension_point_duration_seconds",
			Help:      "Latency for running all plugins of a specific extension point.",

			Buckets:        metrics.ExponentialBuckets(0.0001, 2, 12),
			StabilityLevel: metrics.ALPHA,
		},
		[]string{"extension_point", "status"})

	PluginExecutionDuration = metrics.NewHistogramVec(
		&metrics.HistogramOpts{
			Subsystem: SchedulerSubsystem,
			Name:      "plugin_execution_duration_seconds",
			Help:      "Duration for running a plugin at a specific extension point.",

			Buckets:        metrics.ExponentialBuckets(0.00001, 1.5, 20),
			StabilityLevel: metrics.ALPHA,
		},
		[]string{"plugin", "extension_point", "status"})

	SchedulerQueueIncomingPods = metrics.NewCounterVec(
		&metrics.CounterOpts{
			Subsystem:      SchedulerSubsystem,
			Name:           "queue_incoming_pods_total",
			Help:           "Number of pods added to scheduling queues by event and queue type.",
			StabilityLevel: metrics.ALPHA,
		}, []string{"queue", "event"})

	PermitWaitDuration = metrics.NewHistogramVec(
		&metrics.HistogramOpts{
			Subsystem:      SchedulerSubsystem,
			Name:           "permit_wait_duration_seconds",
			Help:           "Duration of waiting on permit.",
			Buckets:        metrics.ExponentialBuckets(0.001, 2, 15),
			StabilityLevel: metrics.ALPHA,
		},
		[]string{"result"})

	CacheSize = metrics.NewGaugeVec(
		&metrics.GaugeOpts{
			Subsystem:      SchedulerSubsystem,
			Name:           "scheduler_cache_size",
			Help:           "Number of nodes, pods, and assumed (bound) pods in the scheduler cache.",
			StabilityLevel: metrics.ALPHA,
		}, []string{"type"})
)

All the histogram based metrics have 1ms as size for the smallest bucket.

Functions

func ActivePods added in v1.15.0

func ActivePods() metrics.GaugeMetric

ActivePods returns the pending pods metrics with the label active

func BackoffPods added in v1.15.0

func BackoffPods() metrics.GaugeMetric

BackoffPods returns the pending pods metrics with the label backoff

func GetGather added in v1.17.0

func GetGather() metrics.Gatherer

GetGather returns the gatherer. It used by test case outside current package.

func Register

func Register()

Register all metrics.

func Reset added in v1.11.0

func Reset()

Reset resets metrics

func SinceInSeconds added in v1.11.0

func SinceInSeconds(start time.Time) float64

SinceInSeconds gets the time since the specified start in seconds.

func UnschedulablePods added in v1.15.0

func UnschedulablePods() metrics.GaugeMetric

UnschedulablePods returns the pending pods metrics with the label unschedulable

Types

type MetricRecorder added in v1.15.0

type MetricRecorder interface {
	Inc()
	Dec()
	Clear()
}

MetricRecorder represents a metric recorder which takes action when the metric Inc(), Dec() and Clear()

type PendingPodsRecorder added in v1.15.0

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

PendingPodsRecorder is an implementation of MetricRecorder

func NewActivePodsRecorder added in v1.15.0

func NewActivePodsRecorder() *PendingPodsRecorder

NewActivePodsRecorder returns ActivePods in a Prometheus metric fashion

func NewBackoffPodsRecorder added in v1.15.0

func NewBackoffPodsRecorder() *PendingPodsRecorder

NewBackoffPodsRecorder returns BackoffPods in a Prometheus metric fashion

func NewUnschedulablePodsRecorder added in v1.15.0

func NewUnschedulablePodsRecorder() *PendingPodsRecorder

NewUnschedulablePodsRecorder returns UnschedulablePods in a Prometheus metric fashion

func (*PendingPodsRecorder) Clear added in v1.15.0

func (r *PendingPodsRecorder) Clear()

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

func (*PendingPodsRecorder) Dec added in v1.15.0

func (r *PendingPodsRecorder) Dec()

Dec decreases a metric counter by 1, in an atomic way

func (*PendingPodsRecorder) Inc added in v1.15.0

func (r *PendingPodsRecorder) Inc()

Inc increases a metric counter by 1, in an atomic way

Jump to

Keyboard shortcuts

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