Documentation ¶
Index ¶
- func AlertmanagerBinary() string
- func Assert(tb testing.TB, condition bool, msg string, v ...interface{})
- func CreateBlock(dir string, series []labels.Labels, numSamples int, mint, maxt int64, ...) (id ulid.ULID, err error)
- func CreateBlockWithTombstone(dir string, series []labels.Labels, numSamples int, mint, maxt int64, ...) (id ulid.ULID, err error)
- func Equals(tb testing.TB, exp, act interface{}, v ...interface{})
- func ForeachPrometheus(t *testing.T, testFn func(t testing.TB, p *Prometheus))
- func FreePort() (int, error)
- func MinioBinary() string
- func NewTSDB() (*tsdb.DB, error)
- func NotOk(tb testing.TB, err error)
- func Ok(tb testing.TB, err error)
- func PrometheusBinary() string
- type Prometheus
- func (p *Prometheus) Addr() string
- func (p *Prometheus) Appender() tsdb.Appender
- func (p *Prometheus) Dir() string
- func (p *Prometheus) DisableCompaction()
- func (p *Prometheus) Restart() error
- func (p *Prometheus) SetConfig(s string) (err error)
- func (p *Prometheus) Start() error
- func (p *Prometheus) Stop() error
- func (p *Prometheus) WaitPrometheusUp(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlertmanagerBinary ¶
func AlertmanagerBinary() string
func CreateBlock ¶
func CreateBlock( dir string, series []labels.Labels, numSamples int, mint, maxt int64, extLset labels.Labels, resolution int64, ) (id ulid.ULID, err error)
CreateBlock writes a block with the given series and numSamples samples each. Samples will be in the time range [mint, maxt).
func CreateBlockWithTombstone ¶ added in v0.3.0
func CreateBlockWithTombstone( dir string, series []labels.Labels, numSamples int, mint, maxt int64, extLset labels.Labels, resolution int64, ) (id ulid.ULID, err error)
CreateBlockWithTombstone is same as CreateBlock but leaves tombstones which mimics the Prometheus local block.
func ForeachPrometheus ¶ added in v0.3.0
func ForeachPrometheus(t *testing.T, testFn func(t testing.TB, p *Prometheus))
func MinioBinary ¶ added in v0.2.0
func MinioBinary() string
func PrometheusBinary ¶
func PrometheusBinary() string
Types ¶
type Prometheus ¶
type Prometheus struct {
// contains filtered or unexported fields
}
Prometheus represents a test instance for integration testing. It can be populated with data before being started.
func NewPrometheus ¶
func NewPrometheus() (*Prometheus, error)
NewPrometheus creates a new test Prometheus instance that will listen on local address. DEPRECARED: Use ForeachPrometheus instead.
func NewPrometheusOnPath ¶
func NewPrometheusOnPath(prefix string) (*Prometheus, error)
NewPrometheus creates a new test Prometheus instance that will listen on local address and given prefix path.
func (*Prometheus) Addr ¶
func (p *Prometheus) Addr() string
Addr returns correct address after Start method.
func (*Prometheus) Appender ¶
func (p *Prometheus) Appender() tsdb.Appender
Appender returns a new appender to populate the Prometheus instance with data. All appenders must be closed before Start is called and no new ones must be opened afterwards.
func (*Prometheus) DisableCompaction ¶ added in v0.3.0
func (p *Prometheus) DisableCompaction()
func (*Prometheus) Restart ¶ added in v0.3.0
func (p *Prometheus) Restart() error
func (*Prometheus) SetConfig ¶
func (p *Prometheus) SetConfig(s string) (err error)
SetConfig updates the contents of the config file. By default it is empty.
func (*Prometheus) Start ¶
func (p *Prometheus) Start() error
Start running the Prometheus instance and return.
func (*Prometheus) Stop ¶
func (p *Prometheus) Stop() error
Stop terminates Prometheus and clean up its data directory.
func (*Prometheus) WaitPrometheusUp ¶ added in v0.3.0
func (p *Prometheus) WaitPrometheusUp(ctx context.Context) error