emulator

package
v0.0.0-...-4473aac Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertTimeMappingDataIndex

func ConvertTimeMappingDataIndex(startTime *time.Time, inputTime *time.Time, timeStep int, startHour int64, dataCount int64) int64

func GenerateRandomFloat64

func GenerateRandomFloat64(minvalue *float64, maxvalue *float64, precision int) float64

func ReadCSV

func ReadCSV(file string) (map[string][]string, error)

Types

type Config

type Config struct {
	Containers *Containers
	Container  map[string]SubContainer
	Datahub    *datahub.Config `mapstructure:"datahub"`
	Global     *EmulatorGlobal `mapstructure:"global"`
	Log        *log.Config     `mapstructure:"log"`
}

func NewConfig

func NewConfig() Config

NewConfig returns Config objecdt

func (Config) Validate

func (c Config) Validate() error

type Containers

type Containers struct {
	ContainersNamespace        string `mapstructure:"container_namespace"`
	ContainerCountVPA          int    `mapstructure:"container_vpa_count"`
	ContainerCountHPA          int    `mapstructure:"container_hpa_count"`
	ContainerPrefixName        string `mapstructure:"container_prefix_name"`
	ContainerCPUCsvFilepath    string `mapstructure:"container_cpu_csv_filepath"`
	ContainerMemoryCsvFilepath string `mapstructure:"container_memory_csv_filepath"`
	ContainerPulledStartHour   string `mapstructure:"container_pulled_start_hour"`
	ContainerCPURandom         bool   `mapstructure:"container_cpu_random"`
	ContainerMemoryRandom      bool   `mapstructure:"container_memory_random"`
	ContainerCPURandomRange    string `mapstructure:"container_cpu_random_range"`
	ContainerMemoryRandomRange string `mapstructure:"container_memory_random_range"`
	ContainerDataStep          int    `mapstructure:"container_data_step"`
}

type ConvNodeMetaData

type ConvNodeMetaData struct {
	Node *Datahub.Node
}

func NewNodeMetadata

func NewNodeMetadata(rawData []byte) *ConvNodeMetaData

type ConvPodMetadata

type ConvPodMetadata struct {
	Pod *Datahub.Pod
}

func NewPodMetadata

func NewPodMetadata(rawData []byte) *ConvPodMetadata

func (*ConvPodMetadata) EnableHPA

func (c *ConvPodMetadata) EnableHPA(enabled bool)

func (*ConvPodMetadata) EnableVPA

func (c *ConvPodMetadata) EnableVPA(enabled bool)

func (*ConvPodMetadata) GetPod

func (c *ConvPodMetadata) GetPod() *Datahub.Pod

func (*ConvPodMetadata) SetContainer

func (c *ConvPodMetadata) SetContainer(container *Datahub.Container)

func (*ConvPodMetadata) SetContainerName

func (c *ConvPodMetadata) SetContainerName(containerName string)

func (*ConvPodMetadata) SetCreatedTime

func (c *ConvPodMetadata) SetCreatedTime(startedTime time.Time)

func (*ConvPodMetadata) SetNamesapce

func (c *ConvPodMetadata) SetNamesapce(namespace string)

func (*ConvPodMetadata) SetNodeName

func (c *ConvPodMetadata) SetNodeName(nodeName string)

func (*ConvPodMetadata) SetPod

func (c *ConvPodMetadata) SetPod(pod *Datahub.Pod)

func (*ConvPodMetadata) SetPodName

func (c *ConvPodMetadata) SetPodName(podName string)

type EmulatorGlobal

type EmulatorGlobal struct {
	EmulatorNamespace                            string `mapstructure:"emulator_namespace"`
	EmulatorListenAddress                        string `mapstructure:"emulator_listen_address"`
	EmulatorWebPath                              string `mapstructure:"emulator_web_path"`
	EmulatorLabelName                            string `mapstructure:"emulator_label_name"`
	EmulatorLabelValue                           string `mapstructure:"emulator_label_value"`
	EmulatorNodeName                             string `mapstructure:"emulator_node_name"`
	EmulatorNodeResourceCPUCores                 int64  `mapstructure:"emulator_node_resource_cpu_cores"`
	EmulatorNodeCPUUsageRange                    string `mapstructure:"emulator_node_resource_cpu_usage_range"`
	EmulatorNodeResourceMemoryBytes              int64  `mapstructure:"emulator_node_resource_memory_bytes"`
	EmulatorNodeMemoryBytesRange                 string `mapstructure:"emulator_node_resource_memory_usage_range"`
	EmulatorNodeResourceNetwotkMegabitsPerSecond int64  `mapstructure:"emulator_node_netwotk_megabits_per_second"`
	EmulatorNodeMetadata                         string `mapstructure:"emulator_node_metadata_template"`
	EmulatorContainerMetadata                    string `mapstructure:"emulator_container_metadata_template"`
	EmulatorContainerIgnoreCreation              bool   `mapstructure:"emulator_container_ignore_creation"`
	EmulatorPrometheusScrapSeconds               int64  `mapstructure:"emulator_performance_scrap_seconds"`
}

type SubContainer

type SubContainer struct {
	ContainersNamespace        string `mapstructure:"container_namespace"`
	ContainerPrefixName        string `mapstructure:"container_prefix_name"`
	ContainerCPUCsvFilepath    string `mapstructure:"container_cpu_csv_filepath"`
	ContainerMemoryCsvFilepath string `mapstructure:"container_memory_csv_filepath"`
	ContainerPulledStartHour   string `mapstructure:"container_pulled_start_hour"`
	ContainerCPURandom         bool   `mapstructure:"container_cpu_random"`
	ContainerMemoryRandom      bool   `mapstructure:"container_memory_random"`
	ContainerCPURandomRange    string `mapstructure:"container_cpu_random_range"`
	ContainerMemoryRandomRange string `mapstructure:"container_memory_random_range"`
	ContainerDataStep          int64  `mapstructure:"container_data_step"`
}

Jump to

Keyboard shortcuts

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