Documentation
¶
Index ¶
- Constants
- func ContextWithTimeout(tc TestContext, duration time.Duration) context.Context
- func DefaultContext(tc TestContext) context.Context
- func GetMetricValue(metrics NodeMetrics, name string, labels prometheus.Labels) (float64, bool)
- func WithDefaultContext(tc TestContext) common.Option
- type NodeMetrics
- type NodesMetrics
- type TestContext
Constants ¶
const DefaultTimeout = 2 * time.Minute
A long default timeout used to timeout failed operations but unlikely to induce flaking due to unexpected resource contention.
Variables ¶
This section is empty.
Functions ¶
func ContextWithTimeout ¶
func ContextWithTimeout(tc TestContext, duration time.Duration) context.Context
Helper simplifying use of a timed context by canceling the context with the test context.
func DefaultContext ¶
func DefaultContext(tc TestContext) context.Context
Helper simplifying use of a timed context configured with the default timeout.
func GetMetricValue ¶
func GetMetricValue(metrics NodeMetrics, name string, labels prometheus.Labels) (float64, bool)
GetMetricValue returns the value of the specified metric which has the required labels.
If multiple metrics match the provided labels, the first metric found is returned.
Only Counter and Gauge metrics are supported.
func WithDefaultContext ¶
func WithDefaultContext(tc TestContext) common.Option
Helper simplifying use via an option of a timed context configured with the default timeout.
Types ¶
type NodeMetrics ¶
type NodeMetrics map[string]*dto.MetricFamily
"metric name" -> "metric value"
func GetNodeMetrics ¶
func GetNodeMetrics(ctx context.Context, nodeURI string) (NodeMetrics, error)
GetNodeMetrics retrieves the specified metrics the provided node URI.
type NodesMetrics ¶
type NodesMetrics map[string]NodeMetrics
URI -> "metric name" -> "metric value"
func GetNodesMetrics ¶
func GetNodesMetrics(ctx context.Context, nodeURIs []string) (NodesMetrics, error)
GetNodesMetrics retrieves the specified metrics for the provided node URIs.
type TestContext ¶
type TestContext interface { // Ensures the context can be used to instantiate a require instance require.TestingT // Ensures compatibility with ginkgo.By By(text string, callback ...func()) // Ensures compatibility with ginkgo.DeferCleanup // // TODO(marun) Ensure registered cleanup functions are called at // the end of the registering test. DeferCleanup(args ...interface{}) // Enables color output to stdout Outf(format string, args ...interface{}) // Ensures compatibility with ginkgo.GinkgoWriter GetWriter() io.Writer // Context helpers requiring cleanup with DeferCleanup ContextWithTimeout(duration time.Duration) context.Context DefaultContext() context.Context WithDefaultContext() common.Option // Ensures compatibility with require.Eventually Eventually(condition func() bool, waitFor time.Duration, tick time.Duration, msg string) }
Directories
¶
Path | Synopsis |
---|---|
banff
Implements tests for the banff network upgrade.
|
Implements tests for the banff network upgrade. |
c
AUTOMATICALLY GENERATED.
|
AUTOMATICALLY GENERATED. |
etna
Implements tests for the etna network upgrade.
|
Implements tests for the etna network upgrade. |
x/transfer
Implements X-chain transfer tests.
|
Implements X-chain transfer tests. |