Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is used for interacting with the apps over the network.
At the moment it only supports HTTP protocol but may be exptended to support RPCs, etc.
func (*Client) CloseConnections ¶
func (c *Client) CloseConnections()
CloseConnections closes client connections.
func (*Client) Get ¶
Get sends a HTTP GET request. Once the function receives a response, it checks whether the response status code matches the expected one and returns the response body to the caller.
func (*Client) Post ¶
Post sends a HTTP POST request. Once the function receives a response, it checks whether the response status code matches the expected one and returns the response body to the caller.
type PrometheusAPIV1SeriesResponse ¶
PrometheusAPIV1SeriesResponse is an inmemory representation of the /prometheus/api/v1/series response.
type ServesMetrics ¶
type ServesMetrics struct {
// contains filtered or unexported fields
}
ServesMetrics is used to retrive the app's metrics.
This type is expected to be embdded by the apps that serve metrics.
func (*ServesMetrics) GetIntMetric ¶
func (app *ServesMetrics) GetIntMetric(t *testing.T, metricName string) int
GetIntMetric retrieves the value of a metric served by an app at /metrics URL. The value is then converted to int.
type TestCase ¶
type TestCase struct {
// contains filtered or unexported fields
}
TestCase holds the state and defines clean-up procedure common for all test cases.
func (*TestCase) Client ¶
Client returns an instance of the client that can be used for interacting with the app(s) under test.
type Vminsert ¶
type Vminsert struct {
*ServesMetrics
// contains filtered or unexported fields
}
Vminsert holds the state of a vminsert app and provides vminsert-specific functions.
func MustStartVminsert ¶
MustStartVminsert is a test helper function that starts an instance of vminsert and fails the test if the app fails to start.
func StartVminsert ¶
StartVminsert starts an instance of vminsert with the given flags. It also sets the default flags and populates the app instance state with runtime values extracted from the application log (such as httpListenAddr)
func (*Vminsert) PrometheusAPIV1ImportPrometheus ¶
PrometheusAPIV1ImportPrometheus is a test helper function that inserts a collection of records in Prometheus text exposition format for the given tenant by sending a HTTP POST request to /prometheus/api/v1/import/prometheus vminsert endpoint.
See https://docs.victoriametrics.com/url-examples/#apiv1importprometheus
type Vmselect ¶
type Vmselect struct {
*ServesMetrics
// contains filtered or unexported fields
}
Vmselect holds the state of a vmselect app and provides vmselect-specific functions.
func MustStartVmselect ¶
MustStartVmselect is a test helper function that starts an instance of vmselect and fails the test if the app fails to start.
func StartVmselect ¶
StartVmselect starts an instance of vmselect with the given flags. It also sets the default flags and populates the app instance state with runtime values extracted from the application log (such as httpListenAddr)
func (*Vmselect) ClusternativeListenAddr ¶
ClusternativeListenAddr returns the address at which the vmselect process is listening for connections from other vmselect apps.
func (*Vmselect) PrometheusAPIV1Series ¶
func (app *Vmselect) PrometheusAPIV1Series(t *testing.T, tenant, matchQuery string) *PrometheusAPIV1SeriesResponse
PrometheusAPIV1Series sends a query to a /prometheus/api/v1/series endpoint and returns the list of time series that match the query.
See https://docs.victoriametrics.com/url-examples/#apiv1series
type Vmstorage ¶
type Vmstorage struct {
*ServesMetrics
// contains filtered or unexported fields
}
Vmstorage holds the state of a vmstorage app and provides vmstorage-specific functions.
func MustStartVmstorage ¶
MustStartVmstorage is a test helper function that starts an instance of vmstorage and fails the test if the app fails to start.
func StartVmstorage ¶
StartVmstorage starts an instance of vmstorage with the given flags. It also sets the default flags and populates the app instance state with runtime values extracted from the application log (such as httpListenAddr)
func (Vmstorage) Stop ¶
func (app Vmstorage) Stop()
stop sends the app process a SIGINT signal and waits until it terminates gracefully.
func (*Vmstorage) VminsertAddr ¶
VminsertAddr returns the address at which the vmstorage process is listening for vminsert connections.
func (*Vmstorage) VmselectAddr ¶
VmselectAddr returns the address at which the vmstorage process is listening for vmselect connections.