config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPodZero

func IsPodZero() bool

func ParseConfiguration

func ParseConfiguration()

func ValidateConfiguration

func ValidateConfiguration()

Types

type AttributeUpdateSpecification

type AttributeUpdateSpecification struct {
	Type          string  `json:"type" split_words:"true"`
	AttributeName string  `json:"attributeName" split_words:"true"`
	Rate          float64 `json:"rate" split_words:"true"`
	Interval      int     `json:"interval" split_words:"true"`
}

func (*AttributeUpdateSpecification) Decode

func (s *AttributeUpdateSpecification) Decode(value string) error

type AttributeUpdateSpecifications

type AttributeUpdateSpecifications []AttributeUpdateSpecification

func (*AttributeUpdateSpecifications) Decode

func (s *AttributeUpdateSpecifications) Decode(value string) error

type Specification

type Specification struct {
	ClusterName string `json:"clusterName" split_words:"true" required:"false" default:"cluster-loadtest"`
	PodUID      string `json:"podUID" split_words:"true" required:"false" default:"PodUID1"`
	PodName     string `json:"podName" split_words:"true" required:"false" default:"pod-0"`

	//2 containers per pod * 4 pods per deployment * 5 deployments per node * 400 nodes = 16000 containers
	Ec2NodeCount       int `json:"ec2NodeCount" split_words:"true" required:"false" default:"100"`
	AzureNodeCount     int `json:"azureNodeCount" split_words:"true" required:"false" default:"1"`
	GcpNodeCount       int `json:"gcpNodeCount" split_words:"true" required:"false" default:"1"`
	DeploymentsPerNode int `json:"deploymentsPerNode" split_words:"true" required:"false" default:"100"`
	PodsPerDeployment  int `json:"podsPerDeployment" split_words:"true" required:"false" default:"1"`
	ContainerPerPod    int `json:"containerPerPod" split_words:"true" required:"false" default:"1"`

	AttributeUpdates   AttributeUpdateSpecifications    `split_words:"true" required:"false" default:"[]"`
	TargetReplacements TargetReplacementsSpecifications `split_words:"true" required:"false" default:"[]"`

	DiscoveryAttributesExcludesContainer            []string `json:"discoveryAttributesExcludesContainer" split_words:"true" required:"false"`
	DiscoveryAttributesExcludesEc2                  []string `json:"discoveryAttributesExcludesEc2" split_words:"true" required:"false"`
	DiscoveryAttributesExcludesHost                 []string `json:"discoveryAttributesExcludesHost" split_words:"true" required:"false"`
	DiscoveryAttributesExcludesKubernetesPod        []string `json:"discoveryAttributesExcludesKubernetesPod" split_words:"true" required:"false"`
	DiscoveryAttributesExcludesKubernetesDeployment []string `json:"discoveryAttributesExcludesKubernetesDeployment" split_words:"true" required:"false"`
	DiscoveryAttributesExcludesKubernetesContainer  []string `json:"discoveryAttributesExcludesKubernetesContainer" split_words:"true" required:"false"`
	DiscoveryAttributesExcludesKubernetesNode       []string `json:"discoveryAttributesExcludesKubernetesNode" split_words:"true" required:"false"`

	// Simulate multiple extensions
	ServicesEnabled bool `json:"servicesEnabled" split_words:"true" required:"false" default:"false"`

	// Disable Discoveries
	DisableAWSDiscovery        bool `json:"disableAWSDiscovery" split_words:"true" required:"false" default:"false"`
	DisableGCPDiscovery        bool `json:"disableGCPDiscovery" split_words:"true" required:"false" default:"false"`
	DisableAzureDiscovery      bool `json:"disableAzureDiscovery" split_words:"true" required:"false" default:"false"`
	DisableKubernetesDiscovery bool `json:"disableKubernetesDiscovery" split_words:"true" required:"false" default:"false"`
	DisableHostDiscovery       bool `json:"disableHostDiscovery" split_words:"true" required:"false" default:"false"`
	DisableContainerDiscovery  bool `json:"disableContainerDiscovery" split_words:"true" required:"false" default:"false"`

	// Simulate Enrichments
	EnrichmentHostToContainerEnabled bool `json:"enrichmentHostToContainerEnabled" split_words:"true" required:"false" default:"false"`
	EnrichmentContainerToHostEnabled bool `json:"enrichmentContainerToHostEnabled" split_words:"true" required:"false" default:"false"`
	EnrichmentEc2ToHostEnabled       bool `json:"enrichmentEc2ToHostEnabled" split_words:"true" required:"false" default:"false"`

	// Simulate an Event Listener
	EventListenerEnabled bool `json:"eventListenerEnabled" split_words:"true" required:"false" default:"true"`

	// discovery delay in ms
	DiscoveryDelayInMs int `json:"discoveryDelayInMs" split_words:"true" required:"false" default:"0"`
}

Specification is the configuration specification for the extension. Configuration values can be applied through environment variables. Learn more through the documentation of the envconfig package. https://github.com/kelseyhightower/envconfig

var (
	Config Specification
)

func (*Specification) FindAttributeUpdate

func (s *Specification) FindAttributeUpdate(t string) *AttributeUpdateSpecification

func (*Specification) FindTargetReplacementsSpecification

func (s *Specification) FindTargetReplacementsSpecification(t string) *TargetReplacementsSpecification

type TargetReplacementsSpecification

type TargetReplacementsSpecification struct {
	Type     string `json:"type" split_words:"true"`
	Count    int    `json:"count" split_words:"true"`
	Interval int    `json:"interval" split_words:"true"`
}

func (*TargetReplacementsSpecification) Decode

func (s *TargetReplacementsSpecification) Decode(value string) error

type TargetReplacementsSpecifications

type TargetReplacementsSpecifications []TargetReplacementsSpecification

func (*TargetReplacementsSpecifications) Decode

Jump to

Keyboard shortcuts

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