Documentation ¶
Index ¶
- Constants
- type AutobenchConfig
- type BackupClientBlueprint
- type BackupInfo
- type BenchmarkConfig
- type BenchmarkResult
- type BenchmarkResults
- type Blueprint
- type BucketBlueprint
- type CBMConfig
- func (c *CBMConfig) CommandBackup(host string, ignoreBlackhole bool) Command
- func (c *CBMConfig) CommandCollectLogs() Command
- func (c *CBMConfig) CommandConfig() Command
- func (c *CBMConfig) CommandInfo() Command
- func (c *CBMConfig) CommandRemove(start, end string) Command
- func (c *CBMConfig) CommandRestore(host string) Command
- func (c *CBMConfig) String() string
- type CBMEnvironment
- type ClusterBlueprint
- type Command
- type DataBlueprint
- type DataLoaderType
- type NodeBlueprint
- type Platform
- func (p Platform) CommandDisableCouchbase() Command
- func (p Platform) CommandInstallPackageAt(path string) Command
- func (p Platform) CommandInstallPackages(packages ...string) Command
- func (p Platform) CommandUninstallPackages(packages ...string) Command
- func (p Platform) Dependencies() []string
- func (p Platform) PackageExtension() string
- type SSHConfig
- type Stats
Constants ¶
const ( // CBInstallDirectory is the default install directory for Couchbase Server. CBInstallDirectory = "/opt/couchbase" // CBBinDirectory is the default bin directory used by Couchbase Server. CBBinDirectory = "/opt/couchbase/bin" )
const RegexBuildID = `(\d+\.\d+\.\d+)-(\d+)`
RegexBuildID is an uncompiled regular expression which may be used to extract information from a Couchbase build identifier.
Full match: 7.0.0-4259 Group 1: 7.0.0 Group 2: 4259
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutobenchConfig ¶
type AutobenchConfig struct { SSHConfig *SSHConfig `yaml:"ssh,omitempty"` Blueprint *Blueprint `yaml:"blueprint,omitempty"` BenchmarkConfig *BenchmarkConfig `yaml:"benchmark,omitempty"` }
AutobenchConfig encapsulates the options which can be used to configure 'cbtools-authbench' and the benchmarks that is performs. By default the config file is read from disk in the YAML format.
type BackupClientBlueprint ¶
type BackupClientBlueprint struct { // Host is the hostname/address of the node Host string `yaml:"host,omitempty"` // PackagePath is the path to a local package. This package will be secure copied to the backup client and installed // instead of downloading the build from latest builds. // // NOTE: No validation takes place to ensure the package is valid for the current distribution; that's on you... PackagePath string `yaml:"package_path,omitempty"` }
BackupClientBlueprint encapsulates the available configuration for the backup client which will be provisioned by the 'provison' sub-command.
func (*BackupClientBlueprint) MarshalJSON ¶
func (b *BackupClientBlueprint) MarshalJSON() ([]byte, error)
MarshalJSON returns a JSON representation of the backup blueprint which will be displayed in the report.
func (*BackupClientBlueprint) String ¶
func (b *BackupClientBlueprint) String() string
String returns a human readable string representation of the backup blueprint which will be displayed in the report.
type BackupInfo ¶
BackupInfo represents useful information about a finished backup.
type BenchmarkConfig ¶
type BenchmarkConfig struct { // Iterations is the number of times a benchmark will be run, more iterations will result in more accurate data. Iterations int `json:"iterations,omitempty" yaml:"iterations,omitempty"` // CBMConfig is the configuration which will be passed to 'cbbackupmgr' when run on the remote machine. CBMConfig *CBMConfig `json:"cbbackupmgr_config,omitempty" yaml:"cbbackupmgr_config,omitempty"` }
BenchmarkConfig encapsulates the configuration available for running benchmarks.
type BenchmarkResult ¶
type BenchmarkResult struct { // Duration is the how long the benchmark took to complete (this does not include setup/cleanup). Duration time.Duration // AIN is the actual number of data items that was backed up. This will be used to determine if a workload // generation tool (e.g. cbc-pillowfight) has managed to generate enough mutations during each granularity period // (relevant to Point-In-Time backup testing). AIN uint64 // ADS is the actual size of the data that was backed up. This will be used to calculate how much data is // transferred for backup/restore benchmarks. ADS uint64 }
BenchmarkResult encapsulates a single benchmark results.
func (*BenchmarkResult) AvgTransferRateADS ¶
func (b *BenchmarkResult) AvgTransferRateADS() uint64
AvgTransferRateADS returns the average transfer rate of all the benchmarks calculated using the actual data size.
func (*BenchmarkResult) AvgTransferRateGDS ¶
func (b *BenchmarkResult) AvgTransferRateGDS(blueprint *DataBlueprint) uint64
AvgTransferRateGDS returns the average transfer rate of all the benchmarks calculated using the generated data size.
type BenchmarkResults ¶
type BenchmarkResults []*BenchmarkResult
BenchmarkResults is a wrapper around a slice of benchmark results which provides some utility functions.
type Blueprint ¶
type Blueprint struct { Cluster *ClusterBlueprint `yaml:"cluster,omitempty"` BackupClient *BackupClientBlueprint `yaml:"backup_client,omitempty"` }
Blueprint is an abstraction representing a cluster/backup client setup which will be configured by the 'provision' sub-command.
type BucketBlueprint ¶
type BucketBlueprint struct { VBuckets uint16 `json:"vbuckets,omitempty" yaml:"vbuckets,omitempty"` Type string `json:"type,omitempty" yaml:"type,omitempty"` EvictionPolicy string `json:"eviction_policy,omitempty" yaml:"eviction_policy,omitempty"` Compact bool `json:"compact,omitempty" yaml:"compact,omitempty"` PiTREnabled bool `json:"pitr_enabled,omitempty" yaml:"pitr_enabled,omitempty"` PiTRGranularity uint64 `json:"pitr_granularity,omitempty" yaml:"pitr_granularity,omitempty"` PiTRMaxHistoryAge uint64 `json:"pitr_max_history_age,omitempty" yaml:"pitr_max_history_age,omitempty"` Data *DataBlueprint `json:"data,omitempty" yaml:"data,omitempty"` }
BucketBlueprint represents the configration for a bucket that will be created by the 'provision' sub-command.
func (*BucketBlueprint) String ¶
func (b *BucketBlueprint) String() string
String returns a string representation of the blueprint which will be output in the report.
type CBMConfig ¶
type CBMConfig struct { // EnvVars is the environment that will be passed to 'cbbackupmgr'. EnvVars CBMEnvironment `json:"environment_variables,omitempty" yaml:"environment_variables,omitempty"` // Archive/repository that 'cbbackupmgr' will use. Archive string `json:"archive,omitempty" yaml:"archive,omitempty"` Repository string `json:"repository,omitempty" yaml:"repository,omitempty"` // Storage is the storage type that will be used. This is a hidden command in 'cbbackupmgr' and is unsupported. Storage string `json:"storage,omitempty" yaml:"storage,omitempty"` // TLS indicates whether to use the 'couchbases://' schema. TLS bool `json:"tls,omitempty" yaml:"tls,omitempty"` // Cloud related arguments. ObjStagingDirectory string `json:"obj_staging_directory,omitempty" yaml:"obj_staging_directory,omitempty"` ObjAccessKeyID string `json:"-" yaml:"obj_access_key_id,omitempty"` ObjSecretAccessKey string `json:"-" yaml:"obj_secret_access_key,omitempty"` ObjRegion string `json:"obj_region,omitempty" yaml:"obj_region,omitempty"` ObjEndpoint string `json:"obj_endpoint,omitempty" yaml:"obj_endpoint,omitempty"` ObjAuthByInstanceMetadata bool `json:"obj_auth_by_instance_metadata,omitempty" yaml:"obj_auth_by_instance_metadata,omitempty"` //nolint:lll ObjNoSSLVerify bool `json:"obj_no_ssl_verify,omitempty" yaml:"obj_no_ssl_verify,omitempty"` S3LogLevel string `json:"s3_log_level,omitempty" yaml:"s3_log_level,omitempty"` S3ForcePathStyle bool `json:"s3_force_path_style,omitempty" yaml:"s3_force_path_style,omitempty"` // Encrypted related arguments Encrypted bool `json:"encrypted,omitempty" yaml:"encrypted,omitempty"` Passphrase string `json:"passphrase,omitempty" yaml:"passphrase,omitempty"` EncryptionAlgo string `json:"encryption_algo,omitempty" yaml:"encryption_algo,omitempty"` // NumThreads is the default of threads which will be used by 'cbbackupmgr'. A zero value will allow 'cbbackupmgr' // to automatically determine the number of threads. Threads int `json:"threads,omitempty" yaml:"threads,omitempty"` // PiTR indicates whether the backup repository should be configured for Point-In-Time backups. PiTR bool `json:"pitr,omitempty" yaml:"pitr,omitempty"` // Blackhole indicates whether the benchmarks should actually backup any data or just pull it from the cluster and // then discard it immediately. Blackhole bool `json:"blackhole,omitempty" yaml:"blackhole,omitempty"` }
CBMConfig encapsulates the available config for 'cbbackupmgr' and is used when commands are run on the remote machine.
func (*CBMConfig) CommandBackup ¶
CommandBackup returns a command which may be run on the remote backup client to perform a backup.
func (*CBMConfig) CommandCollectLogs ¶
CommandCollectLogs returns a command which can be run on the remote backup client to collect the 'cbbackupmgr' logs.
func (*CBMConfig) CommandConfig ¶
CommandConfig returns a command which may be run on the remote backup client to configure the benchmark archive/repository.
func (*CBMConfig) CommandInfo ¶
CommandInfo returns a command which can be run on the remote backup client which will return information about the given backup repository in JSON format.
func (*CBMConfig) CommandRemove ¶
CommandRemove returns a command which can be run on the remote backup client to remove all the backups from start to end.
func (*CBMConfig) CommandRestore ¶
CommandRestore returns a command which can be run on the remote backup client to perform a restore.
type CBMEnvironment ¶
CBMEnvironment is the environment that will be passed to 'cbbackupmgr' when it's run on the remote machine.
func (CBMEnvironment) String ¶
func (c CBMEnvironment) String() string
type ClusterBlueprint ¶
type ClusterBlueprint struct { // PackagePath is the path to a local package. This package will be secure copied to each cluster node and installed // instead of downloading the build from latest builds. // // NOTE: No validation takes place to ensure the package is valid for the current distribution; that's on you... PackagePath string `yaml:"package_path,omitempty"` // Nodes is the list of node blueprints which will be used to create the cluster. Nodes []*NodeBlueprint `yaml:"nodes,omitempty"` // Bucket is the blueprint for the bucket that will be created once the cluster is provisioned. Bucket *BucketBlueprint `yaml:"bucket,omitempty"` // DeveloperPreview is a boolean which indicates whether or not developer preview should be enabled on the // cluster. DeveloperPreview bool `yaml:"developer_preview,omitempty"` }
ClusterBlueprint encapsulates the configuration for the Couchbase Cluster which will be provisioned by the 'provision' sub-command.
func (*ClusterBlueprint) MarshalJSON ¶
func (c *ClusterBlueprint) MarshalJSON() ([]byte, error)
MarshalJSON returns a JSON representation of the cluster blueprint which will be displayed in the report.
func (*ClusterBlueprint) String ¶
func (c *ClusterBlueprint) String() string
String returns a human readable string representation of the cluster blueprint which will be displayed in the report.
type Command ¶
type Command string
Command represents a command to be executed on a system (generally via ssh).
func NewCommand ¶
NewCommand creates a new command whilst exposing formatting functionality similar to fmt.Sprintf.
NOTE: Whitespace will be removed from the return command.
type DataBlueprint ¶
type DataBlueprint struct { DataLoader DataLoaderType `json:"data_loader,omitempty" yaml:"data_loader,omitempty"` Items int `json:"items,omitempty" yaml:"items,omitempty"` ActiveItems int `json:"active_items,omitempty" yaml:"active_items,omitempty"` Size int `json:"size,omitempty" yaml:"size,omitempty"` Compressible bool `json:"compressible,omitempty" yaml:"compressible,omitempty"` LoadThreads int `json:"load_threads,omitempty" yaml:"load_threads,omitempty"` }
DataBlueprint encapsulates all the options available when populating a bucket with benchmarking data.
func (*DataBlueprint) String ¶
func (d *DataBlueprint) String() string
String returns a string representation of the blueprint which will be output in the report.
type DataLoaderType ¶
type DataLoaderType string
const ( CBM DataLoaderType = "cbbackupmgr" Pillowfight DataLoaderType = "pillowfight" )
type NodeBlueprint ¶
type NodeBlueprint struct { Host string `json:"host,omitempty" yaml:"host,omitempty"` DataPath string `json:"-" yaml:"data_path,omitempty"` }
NodeBlueprint represents the configration for a Couchbase Cluster node.
type Platform ¶
type Platform string
Platform represents the platform that 'cbtools-autobench' is currently being run against (note this is referring to the remote machine).
NOTE: At the moment, only Linux is supported, however, package managers and package names may differ; this means additional work may be required to handle different distributions.
const ( // PlatformUbuntu20_04 represents the 20.04 release of Ubuntu. PlatformUbuntu20_04 Platform = "ubuntu20.04" // PlatformAmazonLinux2 represents the second version of Amazon Linux, note that the first version is now hidden // from users and in theory should no longer be used. PlatformAmazonLinux2 Platform = "amzn2" )
func (Platform) CommandDisableCouchbase ¶
CommandDisableCouchbase returns a command which when executed on the remote machine will disable Couchbase Server.
func (Platform) CommandInstallPackageAt ¶
CommandInstallPackageAt returns a command which can be used to install the package at the provided path.
func (Platform) CommandInstallPackages ¶
CommandInstallPackages returns a command which can be used to installed the provided list of packages by name.
func (Platform) CommandUninstallPackages ¶
CommandUninstallPackages returns a command which can be used to uninstall the provided list of package by name.
func (Platform) Dependencies ¶
Dependencies returns a list of package names which will be installed if they are missing.
func (Platform) PackageExtension ¶
PackageExtension returns the extension used by this platforms package manager.
type SSHConfig ¶
type SSHConfig struct { Username string `yaml:"username,omitempty"` PrivateKey string `yaml:"private_key,omitempty"` PrivateKeyPassphrase string `yaml:"private_key_passphrase,omitempty"` }
SSHConfig encapsulates the SSH config accepted by 'cbtools-autobench'. This will be used when connecting to remote hosts. The same config will be used to connect to each server.
type Stats ¶
type Stats struct { ItemCount uint64 `json:"itemCount"` DiskUsed uint64 `json:"diskUsed"` MemUsed uint64 `json:"memUsed"` VBActiveNumNonResident uint64 `json:"vbActiveNumNonResident"` }
Stats encapsulates some useful stats from the current cluster which may be displayed in the report to give more context about the benchmark conditions.
func (*Stats) MarshalJSON ¶
MarshalJSON returns a JSON representation of the stats with raw values converted into human readable strings.