Documentation ¶
Index ¶
- Constants
- func CPUModelName() (string, error)
- func CPUTopology() (string, error)
- func CentOSVersion() (string, error)
- func DockerVersion() (string, error)
- func EtcdVersion() (string, error)
- func GetPlatformMetrics() (platformMetrics map[string]string)
- func IRQAffinity() (string, error)
- func KernelVersion() (string, error)
- func PowerGovernor() (string, error)
- func RecordRuntimeEnv(metadata Metadata, experimentStart time.Time) error
- func SnapteldVersion() (string, error)
- type Cassandra
- type CassandraConfig
- type InfluxDB
- type InfluxDBConfig
- type Metadata
Constants ¶
const ( TypeEmpty = "" TypeFlags = "flags" TypeEnviron = "environ" TypePlatform = "platform" )
Predefined types of metadata. This selector allows to group metadata by their common characteristics. For instancje metadataKindFlags can be added to parameters passed to swan, metadataKindEnviron for environment variable and metadataKindPlatform for recorded platform characteristics like number of CPUs and so on. Note that metadataKind is just a string and each experiment can define it own personalized types of metadata.
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 ¶
This section is empty.
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 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 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 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 RecordRuntimeEnv ¶
RecordRuntimeEnv store experiment environment information in Cassandra.
func SnapteldVersion ¶
SnapteldVersion returns snapteld version as returned by 'snapteld -v' command. In case of an error empty string is returned
Types ¶
type Cassandra ¶
type Cassandra struct {
// contains filtered or unexported fields
}
Cassandra is a helper struct which keeps the Cassandra session alive, holds the active configuration and the experiment id to tag the metadata with.
func (*Cassandra) Clear ¶
Clear deletes all metadata entries associated with the current experiment id.
func (*Cassandra) GetByKind ¶
GetByKind retrive signle kind from the database. Returns error if no kind or too many groups found.
type CassandraConfig ¶
type CassandraConfig struct { Address string ConnectionTimeout time.Duration CreateKeyspace bool IgnorePeerAddr bool InitialHostLookup bool KeyspaceName string Password string Port int SslCAPath string SslCertPath string SslEnabled bool SslHostValidation bool SslKeyPath string Timeout time.Duration Username string }
CassandraConfig encodes the settings for connecting to the database.
func DefaultCassandraConfig ¶
func DefaultCassandraConfig() CassandraConfig
DefaultCassandraConfig applies the Cassandra settings from the command line flags and environment variables.
type InfluxDB ¶
type InfluxDB struct {
// contains filtered or unexported fields
}
InfluxDB is a helper struct which keeps the InfluxDB session alive, holds the active configuration and the experiment id to tag the metadata with.
func (*InfluxDB) Clear ¶
Clear deletes all metadata entries associated with the current experiment id.
func (*InfluxDB) GetByKind ¶
GetByKind retrive single kind from the database. If duplicates are found then the last one is returned. Returns error if no kind or too many groups found.
type InfluxDBConfig ¶
type InfluxDBConfig struct {
// contains filtered or unexported fields
}
InfluxDBConfig holds configuration for InfluxDB
func DefaultInfluxDBConfig ¶
func DefaultInfluxDBConfig() InfluxDBConfig
DefaultInfluxDBConfig applies the InfluxDB settings from the command line flags and environment variables.
type Metadata ¶
type Metadata interface { // Record stores a key and value and associates with the experiment id. Record(key string, value string, kind string) error // RecordMap stores a key and value map and associates with the experiment id. RecordMap(metadata map[string]string, kind string) error // GetByKind retrives single metadata type from the database. // Returns error if no kind or too many groups found. GetByKind(kind string) (map[string]string, error) // Clear deletes all metadata entries associated with the current experiment id. Clear() error }
Metadata interface defines methods which must be supported by DB backend
func NewCassandra ¶
func NewCassandra(experimentID string, config CassandraConfig) (Metadata, error)
NewCassandra returns the Metadata helper from an experiment id and configuration.
func NewDefault ¶
NewDefault initialize metadata object which is configured via env. variable.
func NewInfluxDB ¶
func NewInfluxDB(experimentID string, config InfluxDBConfig) (Metadata, error)
NewInfluxDB returns the Metadata helper from an experiment id and configuration.