Documentation ¶
Index ¶
- Constants
- Variables
- func CPUModelName() (string, error)
- func CPUTopology() (string, error)
- func CentOSVersion() (string, error)
- func Configure() bool
- func CreateExperimentDir(uuid, appName string) (experimentDirectory string, logFile *os.File, err error)
- func CreateRepetitionDir(appName, uuid, phaseName string, repetition int) error
- func DockerVersion() (string, error)
- func EtcdVersion() (string, error)
- func GetPeakLoad(hpLauncher executor.Launcher, loadGenerator executor.LoadGenerator, slo int) (peakLoad int, err error)
- func GetPlatformMetrics() (platformMetrics map[string]string)
- func IRQAffinity() (string, error)
- func KernelVersion() (string, error)
- func LaunchKubernetesCluster() (clusterHandle executor.TaskHandle, err error)
- func PowerGovernor() (string, error)
- func ShouldLaunchKubernetesCluster() bool
- func SnapteldVersion() (string, error)
- type Metadata
- func (m *Metadata) Clear() error
- func (m *Metadata) Get() ([]MetadataMap, error)
- func (m *Metadata) GetGroup(kind string) (MetadataMap, error)
- func (m *Metadata) Record(key string, value string) error
- func (m *Metadata) RecordMap(metadata MetadataMap) error
- func (m *Metadata) RecordRuntimeEnv(experimentStart time.Time) error
- type MetadataConfig
- type MetadataMap
Constants ¶
const ( // ExperimentKey defines the key for Snap tag. ExperimentKey = "swan_experiment" // PhaseKey defines the key for Snap tag. PhaseKey = "swan_phase" // RepetitionKey defines the key for Snap tag. RepetitionKey = "swan_repetition" // LoadPointQPSKey defines the key for Snap tag. LoadPointQPSKey = "swan_loadpoint_qps" // AggressorNameKey defines the key for Snap tag. AggressorNameKey = "swan_aggressor_name" // ExUsage represents command line user error exit code ExUsage = 64 // ExSoftware represents internal software error exit code ExSoftware = 70 // ExIOErr represents input/output error exit code ExIOErr = 74 )
const ( // CPUModelNameKey defines a key in the platform metrics map CPUModelNameKey = "cpu_model" // KernelVersionKey defines a key in the platform metrics map KernelVersionKey = "kernel_version" // CentOSVersionKey defines a key in the platform metrics map CentOSVersionKey = "centos_version" // CPUTopologyKey defines a key in the platform metrics map CPUTopologyKey = "cpu_topology" // DockerVersionKey defines a key in the platform metrics map DockerVersionKey = "docker_version" // SnapteldVersionKey defines a key in the platform metrics map SnapteldVersionKey = "snapteld_version" // PowerGovernorKey defines a key in the platform metrics map PowerGovernorKey = "power_governor" // IRQAffinityKey defines a key in the platform metrics map IRQAffinityKey = "irq_affinity" // EtcdVersionKey defines a key in the platform metrics map EtcdVersionKey = "etcd_version" )
Variables ¶
var ( // RunOnKubernetesFlag indicates that experiment is to be run on K8s cluster. RunOnKubernetesFlag = conf.NewBoolFlag("kubernetes", "Launch Kubernetes cluster and run workloads on Kubernetes. This flag is required to use other kubernetes flags. (caveat: cluster won't be started if `-kubernetes_run_on_existing` flag is set). ", false) // RunOnExistingKubernetesFlag indicates that experiment should not set up a Kubernetes cluster but use an existing one. RunOnExistingKubernetesFlag = conf.NewBoolFlag("kubernetes_run_on_existing", "Launch HP and BE tasks on existing Kubernetes cluster. (It has to be used with --kubernetes flag). User should provide 'kubernetes_kubeconfig' flag to kubeconfig to point proper API server.", false) )
Functions ¶
func CPUModelName ¶
CPUModelName reads /proc/cpuinfo and returns line 'model name' line. Note that it returns only first occurrence of the model since mixed cpu models in > 2 CPUs are not supported In case of an error empty string is returned.
func CPUTopology ¶
CPUTopology returns CPU topology returned by 'lscpu -e' command. The whole output of the command is returned. In case of an error empty string is returned
func CentOSVersion ¶
CentOSVersion returns OS version as stated in /etc/redhat-release In case of an error empty string is returned
func Configure ¶
func Configure() bool
Configure handles configuration parsing, generation and restoration based on config-* flags. Note: exits if configuration generation was requested. This function must reside in experiment package because depends on metadata access. Returns information about current log level.
func CreateExperimentDir ¶
func CreateExperimentDir(uuid, appName string) (experimentDirectory string, logFile *os.File, err error)
CreateExperimentDir creates directory structure for the experiment.
func CreateRepetitionDir ¶
CreateRepetitionDir creates folders that store repetition logs inside experiment's directory.
func DockerVersion ¶
DockerVersion returns docker version as returned by 'docker version' command. In case of an error empty string is returned
func EtcdVersion ¶
EtcdVersion returns etcd version as returned by 'etcd --version'. In case of an error empty string is returned
func GetPeakLoad ¶
func GetPeakLoad(hpLauncher executor.Launcher, loadGenerator executor.LoadGenerator, slo int) (peakLoad int, err error)
GetPeakLoad runs tuning in order to determine the peak load.
func GetPlatformMetrics ¶
GetPlatformMetrics returns map of strings with platform metrics. If metric could not be retrieved value for the key is empty string.
func IRQAffinity ¶
IRQAffinity returns semicolon (;) separated list of pairs iface {comma separated list of pairs queue:affinity} Example:
enp0s31f6 {134:6};enp3s0 {129:5,130:4,131:3,132:2,133:2}
In case of an error empty string is returned
func KernelVersion ¶
KernelVersion return kernel version as stated in /proc/version In case of an error empty string is returned
func LaunchKubernetesCluster ¶
func LaunchKubernetesCluster() (clusterHandle executor.TaskHandle, err error)
LaunchKubernetesCluster starts new Kubernetes cluster using configuration provided with flags.
func PowerGovernor ¶
PowerGovernor returns a comma separated list of CPU:power_policy. Example (snippet):
"performance,1:performance,10:performance,11:performance"
In case of an error empty string is returned
func ShouldLaunchKubernetesCluster ¶
func ShouldLaunchKubernetesCluster() bool
ShouldLaunchKubernetesCluster checks RunOnKubernetesFlag and RunOnExistingKubernetesFlag and returns information if Kubernetes cluster should be launched.
func SnapteldVersion ¶
SnapteldVersion returns snapteld version as returned by 'snapteld -v' command. In case of an error empty string is returned
Types ¶
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
Metadata is a helper struct which keeps the Cassandra session alive, holds the active configuration and the experiment id to tag the metadata with.
func NewMetadata ¶
func NewMetadata(experimentID string, config MetadataConfig) (*Metadata, error)
NewMetadata returns the Metadata helper from an experiment id and configuration.
func (*Metadata) Clear ¶
Clear deletes all metadata entries associated with the current experiment id.
func (*Metadata) Get ¶
func (m *Metadata) Get() ([]MetadataMap, error)
Get retrieves all metadata maps from the database.
func (*Metadata) GetGroup ¶
func (m *Metadata) GetGroup(kind string) (MetadataMap, error)
GetGroup retrive signle kind from the database. Returns error if no kind or too many groups found.
func (*Metadata) RecordMap ¶
func (m *Metadata) RecordMap(metadata MetadataMap) error
RecordMap stores a key and value map and associates with the experiment id.
type MetadataConfig ¶
type MetadataConfig struct { CassandraAddress string CassandraConnectionTimeout time.Duration CassandraCreateKeyspace bool CassandraIgnorePeerAddr bool CassandraInitialHostLookup bool CassandraKeyspaceName string CassandraPassword string CassandraPort int CassandraSslCAPath string CassandraSslCertPath string CassandraSslEnabled bool CassandraSslHostValidation bool CassandraSslKeyPath string CassandraTimeout time.Duration CassandraUsername string }
MetadataConfig encodes the settings for connecting to the database.
func DefaultMetadataConfig ¶
func DefaultMetadataConfig() MetadataConfig
DefaultMetadataConfig applies the Cassandra settings from the command line flags and environment variables.
type MetadataMap ¶
MetadataMap encodes the key value pairs to be stored in Cassandra.