kubernetes/test/integration/scheduler_perf/scheduler_perf.go

type operationCode

const allocResourceClaimsOpcode

const createAnyOpcode

const createNodesOpcode

const createNamespacesOpcode

const createPodsOpcode

const createPodSetsOpcode

const deletePodsOpcode

const createResourceClaimsOpcode

const createResourceDriverOpcode

const churnOpcode

const updateAnyOpcode

const barrierOpcode

const sleepOpcode

const startCollectingMetricsOpcode

const stopCollectingMetricsOpcode

const Create

const Recreate

const configFile

const extensionPointsLabelName

const resultLabelName

const pluginLabelName

const eventLabelName

const DefaultLoggingVerbosity

var LoggingFeatureGate

var LoggingConfig

type FeatureGateFlag

func init() {}

var defaultMetricsCollectorConfig

var PluginNames

type testCase

func (tc *testCase) collectsMetrics() bool {}

func (tc *testCase) workloadNamesUnique() error {}

type workload

func (w *workload) isValid(mcc *metricsCollectorConfig) error {}

func (w *workload) setDefaults(testCaseThresholdMetricSelector *thresholdMetricSelector) {}

type thresholdMetricSelector

func (ms thresholdMetricSelector) isValid(mcc *metricsCollectorConfig) error {}

type params

// UnmarshalJSON is a custom unmarshaler for params.
//
// from(json):
//
//	{
//		"initNodes": 500,
//		"initPods": 50
//	}
//
// to:
//
//	params{
//		params: map[string]any{
//			"intNodes": 500,
//			"initPods": 50,
//		},
//		isUsed: map[string]bool{}, // empty map
//	}
func (p *params) UnmarshalJSON(b []byte) error {}

// get retrieves the parameter as an integer
func (p params) get(key string) (int, error) {}

// getParam retrieves the parameter as specific type. There is no conversion,
// so in practice this means that only types that JSON unmarshaling uses
// (float64, string, bool) work.
func getParam[T float64 | string | bool](p params, key string) (T, error) {}

// unusedParams returns the names of unusedParams
func (w workload) unusedParams() []string {}

type op

// UnmarshalJSON is a custom unmarshaler for the op struct since we don't know
// which op we're decoding at runtime.
func (op *op) UnmarshalJSON(b []byte) error {}

type realOp

type runnableOp

func isValidParameterizable(val string) bool {}

func isValidCount(allowParameterization bool, count int, countParam string) bool {}

type createNodesOp

func (cno *createNodesOp) isValid(allowParameterization bool) error {}

func (*createNodesOp) collectsMetrics() bool {}

func (cno createNodesOp) patchParams(w *workload) (realOp, error) {}

type createNamespacesOp

func (cmo *createNamespacesOp) isValid(allowParameterization bool) error {}

func (*createNamespacesOp) collectsMetrics() bool {}

func (cmo createNamespacesOp) patchParams(w *workload) (realOp, error) {}

type createPodsOp

func (cpo *createPodsOp) isValid(allowParameterization bool) error {}

func (cpo *createPodsOp) collectsMetrics() bool {}

func (cpo createPodsOp) patchParams(w *workload) (realOp, error) {}

type createPodSetsOp

func (cpso *createPodSetsOp) isValid(allowParameterization bool) error {}

func (cpso *createPodSetsOp) collectsMetrics() bool {}

func (cpso createPodSetsOp) patchParams(w *workload) (realOp, error) {}

type deletePodsOp

func (dpo *deletePodsOp) isValid(allowParameterization bool) error {}

func (dpo *deletePodsOp) collectsMetrics() bool {}

func (dpo deletePodsOp) patchParams(w *workload) (realOp, error) {}

type churnOp

func (co *churnOp) isValid(_ bool) error {}

func (*churnOp) collectsMetrics() bool {}

func (co churnOp) patchParams(w *workload) (realOp, error) {}

type SchedulingStage

const Scheduled

const Attempted

type barrierOp

func (bo *barrierOp) isValid(allowParameterization bool) error {}

func (*barrierOp) collectsMetrics() bool {}

func (bo barrierOp) patchParams(w *workload) (realOp, error) {}

type sleepOp

func (so *sleepOp) isValid(_ bool) error {}

func (so *sleepOp) collectsMetrics() bool {}

func (so sleepOp) patchParams(w *workload) (realOp, error) {}

type startCollectingMetricsOp

func (scm *startCollectingMetricsOp) isValid(_ bool) error {}

func (*startCollectingMetricsOp) collectsMetrics() bool {}

func (scm startCollectingMetricsOp) patchParams(_ *workload) (realOp, error) {}

type stopCollectingMetricsOp

func (scm *stopCollectingMetricsOp) isValid(_ bool) error {}

func (*stopCollectingMetricsOp) collectsMetrics() bool {}

func (scm stopCollectingMetricsOp) patchParams(_ *workload) (realOp, error) {}

var useTestingLog

func initTestOutput(tb testing.TB) io.Writer {}

var specialFilenameChars

func setupTestCase(t testing.TB, tc *testCase, featureGates map[featuregate.Feature]bool, output io.Writer, outOfTreePluginRegistry frameworkruntime.Registry) (informers.SharedInformerFactory, ktesting.TContext) {}

func featureGatesMerge(src map[featuregate.Feature]bool, overrides map[featuregate.Feature]bool) map[featuregate.Feature]bool {}

// RunBenchmarkPerfScheduling runs the scheduler performance tests.
//
// You can pass your own scheduler plugins via outOfTreePluginRegistry.
// Also, you may want to put your plugins in PluginNames variable in this package
// to collect metrics for them.
// testcaseLabelSelectors is available to select specific test cases to run with labels on them.
func RunBenchmarkPerfScheduling(b *testing.B, outOfTreePluginRegistry frameworkruntime.Registry, testcaseLabelSelectors []string) {}

func loadSchedulerConfig(file string) (*config.KubeSchedulerConfiguration, error) {}

func unrollWorkloadTemplate(tb ktesting.TB, wt []op, w *workload) []op {}

func setupClusterForWorkload(tCtx ktesting.TContext, configPath string, featureGates map[featuregate.Feature]bool, outOfTreePluginRegistry frameworkruntime.Registry) (informers.SharedInformerFactory, ktesting.TContext) {}

func labelsMatch(actualLabels, requiredLabels map[string]string) bool {}

func valueWithinThreshold(value, threshold float64, expectLower bool) bool {}

func compareMetricWithThreshold(items []DataItem, threshold float64, metricSelector thresholdMetricSelector) error {}

func checkEmptyInFlightEvents() error {}

func startCollectingMetrics(tCtx ktesting.TContext, collectorWG *sync.WaitGroup, podInformer coreinformers.PodInformer, mcc *metricsCollectorConfig, throughputErrorMargin float64, opIndex int, name string, namespaces []string, labelSelector map[string]string) (ktesting.TContext, []testDataCollector) {}

func stopCollectingMetrics(tCtx ktesting.TContext, collectorCtx ktesting.TContext, collectorWG *sync.WaitGroup, threshold float64, tms thresholdMetricSelector, opIndex int, collectors []testDataCollector) []DataItem {}

func runWorkload(tCtx ktesting.TContext, tc *testCase, w *workload, informerFactory informers.SharedInformerFactory) []DataItem {}

func createNamespaceIfNotPresent(tCtx ktesting.TContext, namespace string, podsPerNamespace *map[string]int) {}

type testDataCollector

func getTestDataCollectors(podInformer coreinformers.PodInformer, name string, namespaces []string, labelSelector map[string]string, mcc *metricsCollectorConfig, throughputErrorMargin float64) []testDataCollector {}

func getNodePreparer(prefix string, cno *createNodesOp, clientset clientset.Interface) (testutils.TestNodePreparer, error) {}

// createPodsRapidly implements the "create pods rapidly" mode of [createPodsOp].
// It's a nop when cpo.SteadyState is true.
func createPodsRapidly(tCtx ktesting.TContext, namespace string, cpo *createPodsOp) error {}

// createPodsSteadily implements the "create pods and delete pods" mode of [createPodsOp].
// It's a nop when cpo.SteadyState is false.
func createPodsSteadily(tCtx ktesting.TContext, namespace string, podInformer coreinformers.PodInformer, cpo *createPodsOp) error {}

// waitUntilPodsScheduledInNamespace blocks until all pods in the given
// namespace are scheduled. Times out after 10 minutes because even at the
// lowest observed QPS of ~10 pods/sec, a 5000-node test should complete.
func waitUntilPodsScheduledInNamespace(tCtx ktesting.TContext, podInformer coreinformers.PodInformer, labelSelector map[string]string, namespace string, wantCount int) error {}

// waitUntilPodsAttemptedInNamespace blocks until all pods in the given
// namespace at least once went through a schedyling cycle.
// Times out after 10 minutes similarly to waitUntilPodsScheduledInNamespace.
func waitUntilPodsAttemptedInNamespace(tCtx ktesting.TContext, podInformer coreinformers.PodInformer, labelSelector map[string]string, namespace string, wantCount int) error {}

// waitUntilPodsScheduled blocks until the all pods in the given namespaces are
// scheduled.
func waitUntilPodsScheduled(tCtx ktesting.TContext, podInformer coreinformers.PodInformer, labelSelector map[string]string, namespaces []string, numPodsScheduledPerNamespace map[string]int) error {}

// waitUntilPodsAttempted blocks until the all pods in the given namespaces are
// attempted (at least once went through a schedyling cycle).
func waitUntilPodsAttempted(tCtx ktesting.TContext, podInformer coreinformers.PodInformer, labelSelector map[string]string, namespaces []string, numPodsScheduledPerNamespace map[string]int) error {}

func getSpecFromFile(path *string, spec interface{}

func getUnstructuredFromFile(path string) (*unstructured.Unstructured, *schema.GroupVersionKind, error) {}

func getTestCases(path string) ([]*testCase, error) {}

func validateTestCases(testCases []*testCase) error {}

func getPodStrategy(cpo *createPodsOp) (testutils.TestPodCreateStrategy, error) {}

type nodeTemplateFromFile

func (f nodeTemplateFromFile) GetNodeTemplate(index, count int) (*v1.Node, error) {}

type podTemplateFromFile

func (f podTemplateFromFile) GetPodTemplate(index, count int) (*v1.Pod, error) {}

func getPersistentVolumeSpecFromFile(path *string) (*v1.PersistentVolume, error) {}

func getPersistentVolumeClaimSpecFromFile(path *string) (*v1.PersistentVolumeClaim, error) {}

func getCustomVolumeFactory(pvTemplate *v1.PersistentVolume) func(id int) *v1.PersistentVolume {}

type namespacePreparer

func newNamespacePreparer(tCtx ktesting.TContext, cno *createNamespacesOp) (*namespacePreparer, error) {}

// namespaces returns namespace names have been (or will be) created by this namespacePreparer
func (p *namespacePreparer) namespaces() []string {}

// prepare creates the namespaces.
func (p *namespacePreparer) prepare(tCtx ktesting.TContext) error {}

// cleanup deletes existing test namespaces.
func (p *namespacePreparer) cleanup(tCtx ktesting.TContext) error {}