Documentation ¶
Index ¶
- Constants
- Variables
- func UpdateThrottlerTopoConfig(clusterInstance *cluster.LocalProcessCluster, enable bool, disable bool, ...) (result string, err error)
- func WaitForQueryResult(t *testing.T, tablet *cluster.Vttablet, query, result string, ...)
- func WaitForThrottlerStatusEnabled(t *testing.T, tablet *cluster.Vttablet, enabled bool, config *Config, ...)
- func WaitForValidData(t *testing.T, tablet *cluster.Vttablet, timeout time.Duration)
- type Config
Constants ¶
const ( DefaultQuery = "select unix_timestamp(now(6))-max(ts/1000000000) as replication_lag from _vt.heartbeat" DefaultThreshold = 1 * time.Second ConfigTimeout = 60 * time.Second )
Variables ¶
var DefaultConfig = &Config{ Query: DefaultQuery, Threshold: DefaultThreshold.Seconds(), }
Functions ¶
func UpdateThrottlerTopoConfig ¶
func UpdateThrottlerTopoConfig(clusterInstance *cluster.LocalProcessCluster, enable bool, disable bool, threshold float64, metricsQuery string, viaVtctldClient bool) (result string, err error)
UpdateThrottlerTopoConfig runs vtctlclient UpdateThrottlerConfig. This retries the command until it succeeds or times out as the SrvKeyspace record may not yet exist for a newly created Keyspace that is still initializing before it becomes serving.
func WaitForQueryResult ¶
func WaitForQueryResult(t *testing.T, tablet *cluster.Vttablet, query, result string, timeout time.Duration)
WaitForQueryResult waits for a tablet to return the given result for the given query until the specified timeout. This is for simple queries that return 1 column in 1 row. It compares the result for that column as a string with the provided result.
func WaitForThrottlerStatusEnabled ¶
func WaitForThrottlerStatusEnabled(t *testing.T, tablet *cluster.Vttablet, enabled bool, config *Config, timeout time.Duration)
WaitForThrottlerStatusEnabled waits for a tablet to report its throttler status as enabled/disabled and have the provided config (if any) until the specified timeout.
func WaitForValidData ¶
WaitForValidData waits for a tablet's checks to return a non 500 http response which indicates that it's not able to provide valid results. This is most commonly caused by the throttler still gathering the initial results for the given configuration.