Documentation ¶
Index ¶
- Constants
- Variables
- func EventuallyStatisticsMatchAssertions(statsPortFwd StatsPortFwd, assertions ...types.AsyncAssertion)
- func EventuallyWithOffsetStatisticsMatchAssertions(offset int, statsPortFwd StatsPortFwd, assertions ...types.AsyncAssertion)
- func IntStatisticReachesConsistentValueAssertion(prometheusStat string, inARow int) (types.AsyncAssertion, *int)
- func LogLevelAssertion(logLevel zapcore.Level) types.AsyncAssertion
- type StatsPortFwd
Constants ¶
const ( // SafeTimeToSyncStats represents a safe estimate for metrics reporting interval. We provide a buffer beyond // the time that metrics reporting occurs, to account for latencies. Tests should use the SafeTimeToSyncStats // to ensure that we are polling the stats endpoints infrequently enough that they will have updated each time SafeTimeToSyncStats = timeToSyncStats + time.Second*3 )
Variables ¶
var DefaultStatsPortFwd = StatsPortFwd{ ResourceName: "deployment/gloo", ResourceNamespace: defaults.GlooSystem, LocalPort: stats.DefaultPort, TargetPort: stats.DefaultPort, }
DefaultStatsPortFwd is a commonly used port-forward configuration, since Gloo Deployment stats are the most valuable This is used in Gloo Enterprise
Functions ¶
func EventuallyStatisticsMatchAssertions ¶
func EventuallyStatisticsMatchAssertions(statsPortFwd StatsPortFwd, assertions ...types.AsyncAssertion)
EventuallyStatisticsMatchAssertions first opens a fort-forward and then performs a series of Asynchronous assertions. The fort-forward is cleaned up with the function returns
func EventuallyWithOffsetStatisticsMatchAssertions ¶
func EventuallyWithOffsetStatisticsMatchAssertions(offset int, statsPortFwd StatsPortFwd, assertions ...types.AsyncAssertion)
EventuallyWithOffsetStatisticsMatchAssertions first opens a fort-forward and then performs a series of Asynchronous assertions. The fort-forward is cleaned up with the function returns
func IntStatisticReachesConsistentValueAssertion ¶
func IntStatisticReachesConsistentValueAssertion(prometheusStat string, inARow int) (types.AsyncAssertion, *int)
IntStatisticReachesConsistentValueAssertion returns an assertion that a prometheus stats has reached a consistent value It optionally returns the value of that statistic as well Arguments:
prometheusStat (string) - The name of the statistic we will be evaluating inARow (int) - We periodically poll the statistic value from a metrics endpoint. InARow represents the number of consecutive times the statistic must be the same for it to be considered "consistent" For example, if InARow=4, we must poll the endpoint 4 times consecutively and return the same value
func LogLevelAssertion ¶
func LogLevelAssertion(logLevel zapcore.Level) types.AsyncAssertion
LogLevelAssertion returns an Assertion to verify that the dynamic log level matches the provided value