Documentation
¶
Index ¶
Constants ¶
const ( DBTypeGroupReplication = mysqlcalc.DbTypeGroupReplication DBTypeAsync = mysqlcalc.DbTypeAsync DBTypePXC = mysqlcalc.DbTypePXC )
DB replication topologies accepted by Request.DBType.
const ( LoadTypeMostlyReads = mysqlcalc.LoadTypeMostlyReads // ~95% reads LoadTypeSomeWrites = mysqlcalc.LoadTypeSomeWrites // ~80% reads LoadTypeEqualReadsWrites = mysqlcalc.LoadTypeEqualReadsWrites // ~50/50 LoadTypeHeavyWrites = mysqlcalc.LoadTypeHeavyWrites // write dominated )
Workload read/write profiles accepted by Request.LoadType.
Variables ¶
var ( ErrMemoryRequired = errors.New("memory is required") ErrCPURequired = errors.New("cpu is required") // outside its supported range the calculator returns an empty // configuration rather than an error ErrVersionUnsupported = errors.New("mysql version is out of the supported range") )
var ( MinSupportedVersion = Version{ Major: mysqlcalc.MySQLMinSupported.Major, Minor: mysqlcalc.MySQLMinSupported.Minor, Patch: mysqlcalc.MySQLMinSupported.Patch, } MaxSupportedVersion = Version{ Major: mysqlcalc.MySQLMaxSupported.Major, Minor: mysqlcalc.MySQLMaxSupported.Minor, Patch: mysqlcalc.MySQLMaxSupported.Patch, } )
MinSupportedVersion and MaxSupportedVersion mirror the bounds the calculator filters its parameters by.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct {
// DBType is the replication topology (one of the DBType* constants).
// Defaults to group replication.
DBType string
// CPU is the CPU allocation for the whole pod in millicores (e.g. 4000 = 4 cores).
CPU int
// Memory is the memory allocation for the whole pod as a human-readable
// string, e.g. "2.5G". Ignored when MemoryBytes is set.
Memory string
// MemoryBytes is the memory allocation for the whole pod in bytes. When
// greater than zero it takes precedence over Memory.
MemoryBytes int64
// Connections is the target number of client connections.
Connections int
// Version is the MySQL server version being configured.
Version Version
// LoadType selects the read/write profile (one of the LoadType* constants).
// Defaults to LoadTypeSomeWrites.
LoadType int
// ProviderCostPct optionally reserves a fraction (0..1) of the allocated
// resources to account for provider overhead. Zero disables the adjustment.
ProviderCostPct float64
// with the proxy and monitoring components. The operator gives those their
// own allocations, so its request leaves this at the zero value.
SharedResources bool
}
Request describes the workload MySQL is tuned for. Only CPU and Memory are required.
type Result ¶
type Result struct {
// Message is the calculator's status message (warnings, notes). A MType > 0
// signals the caller may want to log it.
Message mysqlcalc.ResponseMessage
// Families is the raw calculator output, keyed by family (mysql, proxy,
// monitor), for callers that need groups beyond mysqld.
Families map[string]mysqlcalc.Family
// contains filtered or unexported fields
}
Result holds the outcome of a Calculate call.
func (*Result) MySQLdConfig ¶
MySQLdConfig returns the tuned mysqld parameters as an INI section.