fake

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Calculate added in v0.2.0

type Calculate struct {
	GetUsageRatioReplicaCountReactor  func(currentReplicas int32, usageRatio float64, readyPodCount int64) int32
	GetPlainMetricReplicaCountReactor func(metrics metricsclient.PodMetricsInfo,
		currentReplicas int32,
		targetUtilization int64,
		readyPodCount int64,
		missingPods,
		ignoredPods sets.String) int32
}

Calculate (fake) provides a way to insert functionality into a Calculater

func (*Calculate) GetPlainMetricReplicaCount added in v0.2.0

func (f *Calculate) GetPlainMetricReplicaCount(metrics metricsclient.PodMetricsInfo,
	currentReplicas int32,
	targetUtilization int64,
	readyPodCount int64,
	missingPods,
	ignoredPods sets.String) int32

GetPlainMetricReplicaCount calls the fake Calculater function

func (*Calculate) GetUsageRatioReplicaCount added in v0.2.0

func (f *Calculate) GetUsageRatioReplicaCount(currentReplicas int32, usageRatio float64, readyPodCount int64) int32

GetUsageRatioReplicaCount calls the fake Calculater function

type ExternalEvaluater added in v0.2.0

type ExternalEvaluater struct {
	GetEvaluationReactor func(currentReplicas int32, gatheredMetric *metric.Metric) (*evaluate.Evaluation, error)
}

ExternalEvaluater (fake) provides a way to insert functionality into an ExternalEvaluater

func (*ExternalEvaluater) GetEvaluation added in v0.2.0

func (f *ExternalEvaluater) GetEvaluation(currentReplicas int32, gatheredMetric *metric.Metric) (*evaluate.Evaluation, error)

GetEvaluation calls the fake Evaluater function

type ExternalGatherer

type ExternalGatherer struct {
	GetMetricReactor       func(metricName, namespace string, metricSelector *metav1.LabelSelector, podSelector labels.Selector) (*external.Metric, error)
	GetPerPodMetricReactor func(metricName, namespace string, metricSelector *metav1.LabelSelector) (*external.Metric, error)
}

ExternalGatherer (fake) provides a way to insert functionality into an ExternalGatherer

func (*ExternalGatherer) GetMetric

func (f *ExternalGatherer) GetMetric(metricName, namespace string, metricSelector *metav1.LabelSelector, podSelector labels.Selector) (*external.Metric, error)

GetMetric calls the fake ExternalGatherer function

func (*ExternalGatherer) GetPerPodMetric

func (f *ExternalGatherer) GetPerPodMetric(metricName, namespace string, metricSelector *metav1.LabelSelector) (*external.Metric, error)

GetPerPodMetric calls the fake ExternalGatherer function

type MetricClient

type MetricClient struct {
	GetResourceMetricReactor func(resource corev1.ResourceName, namespace string, selector labels.Selector) (metricsclient.PodMetricsInfo, time.Time, error)
	GetRawMetricReactor      func(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (metricsclient.PodMetricsInfo, time.Time, error)
	GetObjectMetricReactor   func(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error)
	GetExternalMetricReactor func(metricName string, namespace string, selector labels.Selector) ([]int64, time.Time, error)
}

MetricClient (fake) provides a way to insert functionality into a MetricClient

func (*MetricClient) GetExternalMetric

func (f *MetricClient) GetExternalMetric(metricName string, namespace string, selector labels.Selector) ([]int64, time.Time, error)

GetExternalMetric calls the fake MetricClient function

func (*MetricClient) GetObjectMetric

func (f *MetricClient) GetObjectMetric(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error)

GetObjectMetric calls the fake MetricClient function

func (*MetricClient) GetRawMetric

func (f *MetricClient) GetRawMetric(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (metricsclient.PodMetricsInfo, time.Time, error)

GetRawMetric calls the fake MetricClient function

func (*MetricClient) GetResourceMetric

func (f *MetricClient) GetResourceMetric(resource corev1.ResourceName, namespace string, selector labels.Selector) (metricsclient.PodMetricsInfo, time.Time, error)

GetResourceMetric calls the fake MetricClient function

type ObjectEvaluater added in v0.2.0

type ObjectEvaluater struct {
	GetEvaluationReactor func(currentReplicas int32, gatheredMetric *metric.Metric) (*evaluate.Evaluation, error)
}

ObjectEvaluater (fake) provides a way to insert functionality into an ObjectEvaluater

func (*ObjectEvaluater) GetEvaluation added in v0.2.0

func (f *ObjectEvaluater) GetEvaluation(currentReplicas int32, gatheredMetric *metric.Metric) (*evaluate.Evaluation, error)

GetEvaluation calls the fake Evaluater function

type ObjectGatherer

type ObjectGatherer struct {
	GetMetricReactor       func(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, selector labels.Selector, metricSelector labels.Selector) (*object.Metric, error)
	GetPerPodMetricReactor func(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (*object.Metric, error)
}

ObjectGatherer (fake) provides a way to insert functionality into an ObjectGatherer

func (*ObjectGatherer) GetMetric

func (f *ObjectGatherer) GetMetric(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, selector labels.Selector, metricSelector labels.Selector) (*object.Metric, error)

GetMetric calls the fake ObjectGatherer function

func (*ObjectGatherer) GetPerPodMetric

func (f *ObjectGatherer) GetPerPodMetric(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (*object.Metric, error)

GetPerPodMetric calls the fake ObjectGatherer function

type PodLister

type PodLister struct {
	ListReactor func(selector labels.Selector) (ret []*corev1.Pod, err error)
	PodsReactor func(namespace string) corelisters.PodNamespaceLister
}

PodLister (fake) provides a way to insert functionality into a PodLister

func (*PodLister) List

func (f *PodLister) List(selector labels.Selector) (ret []*corev1.Pod, err error)

List calls the fake PodLister function

func (*PodLister) Pods

func (f *PodLister) Pods(namespace string) corelisters.PodNamespaceLister

Pods calls the fake PodLister function

type PodNamespaceLister

type PodNamespaceLister struct {
	ListReactor func(selector labels.Selector) (ret []*corev1.Pod, err error)
	GetReactor  func(name string) (*corev1.Pod, error)
}

PodNamespaceLister (fake) provides a way to insert functionality into a PodNamespaceLister

func (*PodNamespaceLister) Get

func (f *PodNamespaceLister) Get(name string) (*corev1.Pod, error)

Get calls the fake PodNamespaceLister function

func (*PodNamespaceLister) List

func (f *PodNamespaceLister) List(selector labels.Selector) (ret []*corev1.Pod, err error)

List calls the fake PodNamespaceLister function

type PodReadyCounter

type PodReadyCounter struct {
	GetReadyPodsCountReactor func(namespace string, selector labels.Selector) (int64, error)
}

PodReadyCounter (fake) provides a way to insert functionality into a PodReadyCounter

func (*PodReadyCounter) GetReadyPodsCount

func (f *PodReadyCounter) GetReadyPodsCount(namespace string, selector labels.Selector) (int64, error)

GetReadyPodsCount calls the fake PodReadyCounter function

type PodsEvaluater added in v0.2.0

type PodsEvaluater struct {
	GetEvaluationReactor func(currentReplicas int32, gatheredMetric *metric.Metric) *evaluate.Evaluation
}

PodsEvaluater (fake) provides a way to insert functionality into an PodsEvaluater

func (*PodsEvaluater) GetEvaluation added in v0.2.0

func (f *PodsEvaluater) GetEvaluation(currentReplicas int32, gatheredMetric *metric.Metric) *evaluate.Evaluation

GetEvaluation calls the fake Evaluater function

type PodsGatherer

type PodsGatherer struct {
	GetMetricReactor func(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (*pods.Metric, error)
}

PodsGatherer (fake) provides a way to insert functionality into an PodsGatherer

func (*PodsGatherer) GetMetric

func (f *PodsGatherer) GetMetric(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (*pods.Metric, error)

GetMetric calls the fake PodsGatherer function

type ResourceEvaluater added in v0.2.0

type ResourceEvaluater struct {
	GetEvaluationReactor func(currentReplicas int32, gatheredMetric *metric.Metric) (*evaluate.Evaluation, error)
}

ResourceEvaluater (fake) provides a way to insert functionality into an ResourceEvaluater

func (*ResourceEvaluater) GetEvaluation added in v0.2.0

func (f *ResourceEvaluater) GetEvaluation(currentReplicas int32, gatheredMetric *metric.Metric) (*evaluate.Evaluation, error)

GetEvaluation calls the fake Evaluater function

type ResourceGatherer

type ResourceGatherer struct {
	GetMetricReactor    func(resource corev1.ResourceName, namespace string, selector labels.Selector) (*resource.Metric, error)
	GetRawMetricReactor func(resource corev1.ResourceName, namespace string, selector labels.Selector) (*resource.Metric, error)
}

ResourceGatherer (fake) provides a way to insert functionality into an ResourceGatherer

func (*ResourceGatherer) GetMetric

func (f *ResourceGatherer) GetMetric(resource corev1.ResourceName, namespace string, selector labels.Selector) (*resource.Metric, error)

GetMetric calls the fake ResourceGatherer function

func (*ResourceGatherer) GetRawMetric

func (f *ResourceGatherer) GetRawMetric(resource corev1.ResourceName, namespace string, selector labels.Selector) (*resource.Metric, error)

GetRawMetric calls the fake ResourceGatherer function

Jump to

Keyboard shortcuts

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