Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateRecomendedReplicasByCpuCosts(sldb *sldbv1.ServerlessDB, sq *SingleQuery, client promClient.Client, ...) (float64, error)
- func CalculateStoragePressureBaseTc(sldb *sldbv1.ServerlessDB, tc *v1alpha1.TidbCluster) (bool, error)
- func CalculateStorageSize(sldb *sldbv1.ServerlessDB, usedSq *SingleQuery, client promClient.Client) (uint64, error)
- func CalculateWhetherStoragePressure(sldb *sldbv1.ServerlessDB, capacitySq, availableSq *SingleQuery, ...) (bool, error)
- func GetUtilizationRatio() (float64, error)
- type Data
- type Metric
- type Response
- type Result
- type SingleQuery
Constants ¶
View Source
const ( TikvSumStorageMetricsPattern = `` /* 153-byte string literal not displayed */ TikvSumStorageMetricsPressurePattern = `` /* 170-byte string literal not displayed */ TidbSumCpuMetricsPattern = `` /* 191-byte string literal not displayed */ TidbSumTpsMetricsPattern = `` /* 203-byte string literal not displayed */ )
View Source
const ( CpuSumMetricsErrorMsg = "" /* 139-byte string literal not displayed */ TpmcSumMetricsErrorMsg = "" /* 139-byte string literal not displayed */ )
View Source
const ( TpmcType = 0 CpuType = 1 )
Variables ¶
View Source
var AverageUtilization = os.Getenv("CPU_AVERAGE_UTILIZATION")
View Source
var Tpc = os.Getenv("TPMC_PER_CPU")
Functions ¶
func CalculateRecomendedReplicasByCpuCosts ¶
func CalculateRecomendedReplicasByCpuCosts(sldb *sldbv1.ServerlessDB, sq *SingleQuery, client promClient.Client, memberType v1alpha1.MemberType, duration time.Duration, isCpuOrTpmc int) (float64, error)
TODO: create issue to explain how auto-scaling algorithm based on cpu metrics work
func CalculateStoragePressureBaseTc ¶
func CalculateStoragePressureBaseTc(sldb *sldbv1.ServerlessDB, tc *v1alpha1.TidbCluster) (bool, error)
func CalculateStorageSize ¶
func CalculateStorageSize(sldb *sldbv1.ServerlessDB, usedSq *SingleQuery, client promClient.Client) (uint64, error)
func CalculateWhetherStoragePressure ¶
func CalculateWhetherStoragePressure(sldb *sldbv1.ServerlessDB, capacitySq, availableSq *SingleQuery, client promClient.Client) (bool, error)
func GetUtilizationRatio ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.