Documentation
¶
Index ¶
- func AssertGraphiteMetricsExpand(tc *TestCase, app PrometheusQuerier, query, tenantID string, want []string)
- func AssertGraphiteMetricsFind(tc *TestCase, app PrometheusQuerier, query, tenantID string, ...)
- func AssertGraphiteMetricsIndex(tc *TestCase, app PrometheusQuerier, tenantID string, want []string)
- func AssertGraphiteRender(tc *TestCase, app PrometheusQuerier, target, tenantID string, ...)
- func AssertLabelValues(tc *TestCase, app PrometheusQuerier, metricNameRE, labelName, tenantID string, ...)
- func AssertLabels(tc *TestCase, app PrometheusQuerier, metricNameRE, tenantID string, ...)
- func AssertMetadata(tc *TestCase, app PrometheusQuerier, metricName, tenantID string, ...)
- func AssertMetricNamesStats(tc *TestCase, app PrometheusQuerier, metricNameRE, tenantID string, ...)
- func AssertQueryResults(tc *TestCase, app PrometheusQuerier, metricNameRE, tenantID string, ...)
- func AssertSeries(tc *TestCase, app PrometheusQuerier, metricNameRE, tenantID string, ...)
- func AssertSeriesCount(tc *TestCase, app PrometheusQuerier, tenantID string, start, end int64, ...)
- func StartVmbackup(instance, storageDataPath, snapshotCreateURL, dst string, output io.Writer) error
- func StartVmctl(instance string, flags []string, output io.Writer) error
- func StartVmrestore(instance, src, storageDataPath string, output io.Writer) error
- type APIV1AdminTSDBSnapshotResponse
- type AdminTenantsResponse
- type AssertOptions
- type Client
- func (c *Client) CloseConnections()
- func (c *Client) Delete(t *testing.T, url string) (string, int)
- func (c *Client) Get(t *testing.T, url string, headers http.Header) (string, int)
- func (c *Client) Post(t *testing.T, url string, data []byte, headers http.Header) (string, int)
- func (c *Client) PostForm(t *testing.T, url string, data url.Values, headers http.Header) (string, int)
- func (c *Client) Write(t *testing.T, address string, data []string)
- type ClusterOptions
- type GraphiteMetric
- type GraphiteMetricsExpandResponse
- type GraphiteMetricsFindResponse
- type GraphiteMetricsIndexResponse
- type GraphiteRenderResponse
- type GraphiteRenderedTarget
- type GraphiteTestData
- type MetadataEntry
- type MetricNamesStatsRecord
- type MetricNamesStatsResponse
- type PrometheusAPIV1LabelValuesResponse
- type PrometheusAPIV1LabelsResponse
- type PrometheusAPIV1Metadata
- type PrometheusAPIV1QueryResponse
- type PrometheusAPIV1SeriesCountResponse
- type PrometheusAPIV1SeriesResponse
- type PrometheusQuerier
- type PrometheusWriteQuerier
- type QueryData
- type QueryOpts
- type QueryResult
- type Sample
- type SnapshotCreateResponse
- type SnapshotData
- type SnapshotDeleteAllResponse
- type SnapshotDeleteResponse
- type SnapshotListResponse
- type Stopper
- type StorageFlusher
- type StorageMerger
- type TSDBStatusResponse
- type TSDBStatusResponseData
- type TSDBStatusResponseEntry
- type TSDBStatusResponseMetricNameEntry
- type TestCase
- func (tc *TestCase) Assert(opts *AssertOptions)
- func (tc *TestCase) Client() *Client
- func (tc *TestCase) Dir() string
- func (tc *TestCase) ForceFlush(apps ...*Vmstorage)
- func (tc *TestCase) MustStartCluster(opts *ClusterOptions) *Vmcluster
- func (tc *TestCase) MustStartCluster_v1_132_0(opts *ClusterOptions) *Vmcluster
- func (tc *TestCase) MustStartDefaultCluster() *Vmcluster
- func (tc *TestCase) MustStartDefaultRWVmagent(instance string, flags []string) *Vmagent
- func (tc *TestCase) MustStartDefaultVmsingle() *Vmsingle
- func (tc *TestCase) MustStartVmagent(instance string, flags []string, promScrapeConfigFileYAML string) *Vmagent
- func (tc *TestCase) MustStartVmauth(instance string, flags []string, configFileYAML string) *Vmauth
- func (tc *TestCase) MustStartVmbackup(instance, storageDataPath, snapshotCreateURL, dst string)
- func (tc *TestCase) MustStartVmctl(instance string, flags []string)
- func (tc *TestCase) MustStartVminsert(instance string, flags []string) *Vminsert
- func (tc *TestCase) MustStartVmrestore(instance, src, storageDataPath string)
- func (tc *TestCase) MustStartVmselect(instance string, flags []string) *Vmselect
- func (tc *TestCase) MustStartVmsingle(instance string, flags []string) *Vmsingle
- func (tc *TestCase) MustStartVmsingle_v1_132_0(instance string, flags []string) *Vmsingle
- func (tc *TestCase) MustStartVmstorage(instance string, flags []string) *Vmstorage
- func (tc *TestCase) MustStartVmstorage_v1_132_0(instance string, flags []string) *Vmstorage
- func (tc *TestCase) Stop()
- func (tc *TestCase) StopApp(instance string)
- func (tc *TestCase) StopPrometheusWriteQuerier(pwq PrometheusWriteQuerier)
- func (tc *TestCase) T() *testing.T
- type TestData
- type Trace
- type Vmagent
- func (app *Vmagent) APIV1ImportPrometheus(t *testing.T, records []string, opts QueryOpts)
- func (app *Vmagent) APIV1ImportPrometheusNoWaitFlush(t *testing.T, records []string, opts QueryOpts)
- func (c Vmagent) GetIntMetric(t *testing.T, metricName string) int
- func (c Vmagent) GetMetric(t *testing.T, metricName string) float64
- func (c Vmagent) GetMetricsByPrefix(t *testing.T, prefix string) []float64
- func (c Vmagent) GetMetricsByRegexp(t *testing.T, re *regexp.Regexp) []float64
- func (app *Vmagent) HTTPAddr() string
- func (app Vmagent) Name() string
- func (app *Vmagent) PrometheusAPIV1Write(t *testing.T, wr prompb.WriteRequest, opts QueryOpts)
- func (app *Vmagent) ReloadRelabelConfigs(t *testing.T)
- func (app *Vmagent) RemoteWritePacketsDroppedTotal(t *testing.T) int
- func (app *Vmagent) RemoteWritePendingInmemoryBlocks(t *testing.T, url string) int
- func (app *Vmagent) RemoteWriteRequests(t *testing.T, url string) int
- func (app *Vmagent) RemoteWriteRequestsRetriesCountTotal(t *testing.T) int
- func (app *Vmagent) RemoteWriteSamplesDropped(t *testing.T, url string) int
- func (app Vmagent) Stop()
- func (app Vmagent) String() string
- type Vmauth
- func (app *Vmauth) GetHTTPListenAddr() string
- func (c Vmauth) GetIntMetric(t *testing.T, metricName string) int
- func (c Vmauth) GetMetric(t *testing.T, metricName string) float64
- func (c Vmauth) GetMetricsByPrefix(t *testing.T, prefix string) []float64
- func (c Vmauth) GetMetricsByRegexp(t *testing.T, re *regexp.Regexp) []float64
- func (app Vmauth) Name() string
- func (app Vmauth) Stop()
- func (app Vmauth) String() string
- func (app *Vmauth) UpdateConfiguration(t *testing.T, configFileYAML string)
- type Vmcluster
- func (c Vmcluster) APIV1AdminTenants(t *testing.T, opts QueryOpts) *AdminTenantsResponse
- func (c *Vmcluster) ForceFlush(t *testing.T)
- func (c *Vmcluster) ForceMerge(t *testing.T)
- func (c Vmcluster) GraphiteMetricsExpand(t *testing.T, query string, opts QueryOpts) GraphiteMetricsExpandResponse
- func (c Vmcluster) GraphiteMetricsFind(t *testing.T, query string, opts QueryOpts) GraphiteMetricsFindResponse
- func (c Vmcluster) GraphiteMetricsIndex(t *testing.T, opts QueryOpts) GraphiteMetricsIndexResponse
- func (c Vmcluster) GraphiteRender(t *testing.T, target string, opts QueryOpts) GraphiteRenderResponse
- func (c Vmcluster) GraphiteTagsTagMultiSeries(t *testing.T, records []string, opts QueryOpts)
- func (c Vmcluster) GraphiteTagsTagSeries(t *testing.T, record string, opts QueryOpts)
- func (c Vmcluster) GraphiteWrite(t *testing.T, records []string, _ QueryOpts)
- func (c Vmcluster) InfluxWrite(t *testing.T, records []string, opts QueryOpts)
- func (c Vmcluster) OpenTSDBAPIPut(t *testing.T, records []string, opts QueryOpts)
- func (c Vmcluster) OpentelemetryV1Metrics(t *testing.T, md otlppb.MetricsData, opts QueryOpts)
- func (c Vmcluster) PrometheusAPIV1AdminStatusMetricNamesStatsReset(t *testing.T, opts QueryOpts)
- func (c Vmcluster) PrometheusAPIV1AdminTSDBDeleteSeries(t *testing.T, matchQuery string, opts QueryOpts)
- func (c Vmcluster) PrometheusAPIV1Export(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
- func (c Vmcluster) PrometheusAPIV1ExportNative(t *testing.T, query string, opts QueryOpts) []byte
- func (c Vmcluster) PrometheusAPIV1ImportCSV(t *testing.T, records []string, opts QueryOpts)
- func (c Vmcluster) PrometheusAPIV1ImportNative(t *testing.T, data []byte, opts QueryOpts)
- func (c Vmcluster) PrometheusAPIV1ImportPrometheus(t *testing.T, records []string, opts QueryOpts)
- func (c Vmcluster) PrometheusAPIV1LabelValues(t *testing.T, labelName, matchQuery string, opts QueryOpts) *PrometheusAPIV1LabelValuesResponse
- func (c Vmcluster) PrometheusAPIV1Labels(t *testing.T, matchQuery string, opts QueryOpts) *PrometheusAPIV1LabelsResponse
- func (c Vmcluster) PrometheusAPIV1Metadata(t *testing.T, metric string, limit int, opts QueryOpts) *PrometheusAPIV1Metadata
- func (c Vmcluster) PrometheusAPIV1Query(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
- func (c Vmcluster) PrometheusAPIV1QueryRange(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
- func (c Vmcluster) PrometheusAPIV1Series(t *testing.T, matchQuery string, opts QueryOpts) *PrometheusAPIV1SeriesResponse
- func (c Vmcluster) PrometheusAPIV1SeriesCount(t *testing.T, opts QueryOpts) *PrometheusAPIV1SeriesCountResponse
- func (c Vmcluster) PrometheusAPIV1StatusMetricNamesStats(t *testing.T, limit, le, matchPattern string, opts QueryOpts) MetricNamesStatsResponse
- func (c Vmcluster) PrometheusAPIV1StatusTSDB(t *testing.T, matchQuery string, date string, topN string, opts QueryOpts) TSDBStatusResponse
- func (c Vmcluster) PrometheusAPIV1Write(t *testing.T, wr prompb.WriteRequest, opts QueryOpts)
- func (c Vmcluster) ZabbixConnectorHistory(t *testing.T, records []string, opts QueryOpts)
- type Vminsert
- func (app *Vminsert) ClusternativeListenAddr() string
- func (c Vminsert) GetIntMetric(t *testing.T, metricName string) int
- func (c Vminsert) GetMetric(t *testing.T, metricName string) float64
- func (c Vminsert) GetMetricsByPrefix(t *testing.T, prefix string) []float64
- func (c Vminsert) GetMetricsByRegexp(t *testing.T, re *regexp.Regexp) []float64
- func (c Vminsert) GraphiteWrite(t *testing.T, records []string, _ QueryOpts)
- func (app *Vminsert) HTTPAddr() string
- func (c Vminsert) InfluxWrite(t *testing.T, records []string, opts QueryOpts)
- func (app Vminsert) Name() string
- func (c Vminsert) OpenTSDBAPIPut(t *testing.T, records []string, opts QueryOpts)
- func (c Vminsert) OpentelemetryV1Metrics(t *testing.T, md otlppb.MetricsData, opts QueryOpts)
- func (c Vminsert) PrometheusAPIV1ImportCSV(t *testing.T, records []string, opts QueryOpts)
- func (c Vminsert) PrometheusAPIV1ImportNative(t *testing.T, data []byte, opts QueryOpts)
- func (c Vminsert) PrometheusAPIV1ImportPrometheus(t *testing.T, records []string, opts QueryOpts)
- func (c Vminsert) PrometheusAPIV1Write(t *testing.T, wr prompb.WriteRequest, opts QueryOpts)
- func (app Vminsert) Stop()
- func (app *Vminsert) String() string
- func (c Vminsert) ZabbixConnectorHistory(t *testing.T, records []string, opts QueryOpts)
- type Vmselect
- func (c Vmselect) APIV1AdminTenants(t *testing.T, opts QueryOpts) *AdminTenantsResponse
- func (app *Vmselect) ClusternativeListenAddr() string
- func (c Vmselect) GetIntMetric(t *testing.T, metricName string) int
- func (c Vmselect) GetMetric(t *testing.T, metricName string) float64
- func (c Vmselect) GetMetricsByPrefix(t *testing.T, prefix string) []float64
- func (c Vmselect) GetMetricsByRegexp(t *testing.T, re *regexp.Regexp) []float64
- func (c Vmselect) GraphiteMetricsExpand(t *testing.T, query string, opts QueryOpts) GraphiteMetricsExpandResponse
- func (c Vmselect) GraphiteMetricsFind(t *testing.T, query string, opts QueryOpts) GraphiteMetricsFindResponse
- func (c Vmselect) GraphiteMetricsIndex(t *testing.T, opts QueryOpts) GraphiteMetricsIndexResponse
- func (c Vmselect) GraphiteRender(t *testing.T, target string, opts QueryOpts) GraphiteRenderResponse
- func (c Vmselect) GraphiteTagsTagMultiSeries(t *testing.T, records []string, opts QueryOpts)
- func (c Vmselect) GraphiteTagsTagSeries(t *testing.T, record string, opts QueryOpts)
- func (app *Vmselect) HTTPAddr() string
- func (app Vmselect) Name() string
- func (c Vmselect) PrometheusAPIV1AdminStatusMetricNamesStatsReset(t *testing.T, opts QueryOpts)
- func (c Vmselect) PrometheusAPIV1AdminTSDBDeleteSeries(t *testing.T, matchQuery string, opts QueryOpts)
- func (c Vmselect) PrometheusAPIV1Export(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
- func (c Vmselect) PrometheusAPIV1ExportNative(t *testing.T, query string, opts QueryOpts) []byte
- func (c Vmselect) PrometheusAPIV1LabelValues(t *testing.T, labelName, matchQuery string, opts QueryOpts) *PrometheusAPIV1LabelValuesResponse
- func (c Vmselect) PrometheusAPIV1Labels(t *testing.T, matchQuery string, opts QueryOpts) *PrometheusAPIV1LabelsResponse
- func (c Vmselect) PrometheusAPIV1Metadata(t *testing.T, metric string, limit int, opts QueryOpts) *PrometheusAPIV1Metadata
- func (c Vmselect) PrometheusAPIV1Query(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
- func (c Vmselect) PrometheusAPIV1QueryRange(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
- func (c Vmselect) PrometheusAPIV1Series(t *testing.T, matchQuery string, opts QueryOpts) *PrometheusAPIV1SeriesResponse
- func (c Vmselect) PrometheusAPIV1SeriesCount(t *testing.T, opts QueryOpts) *PrometheusAPIV1SeriesCountResponse
- func (c Vmselect) PrometheusAPIV1StatusMetricNamesStats(t *testing.T, limit, le, matchPattern string, opts QueryOpts) MetricNamesStatsResponse
- func (c Vmselect) PrometheusAPIV1StatusTSDB(t *testing.T, matchQuery string, date string, topN string, opts QueryOpts) TSDBStatusResponse
- func (app Vmselect) Stop()
- func (app *Vmselect) String() string
- type Vmsingle
- func (c Vmsingle) APIV1AdminTSDBSnapshot(t *testing.T) *APIV1AdminTSDBSnapshotResponse
- func (c Vmsingle) APIV1AdminTenants(t *testing.T, opts QueryOpts) *AdminTenantsResponse
- func (c Vmsingle) ForceFlush(t *testing.T)
- func (c Vmsingle) ForceMerge(t *testing.T)
- func (c Vmsingle) GetIntMetric(t *testing.T, metricName string) int
- func (c Vmsingle) GetMetric(t *testing.T, metricName string) float64
- func (c Vmsingle) GetMetricsByPrefix(t *testing.T, prefix string) []float64
- func (c Vmsingle) GetMetricsByRegexp(t *testing.T, re *regexp.Regexp) []float64
- func (c Vmsingle) GraphiteMetricsExpand(t *testing.T, query string, opts QueryOpts) GraphiteMetricsExpandResponse
- func (c Vmsingle) GraphiteMetricsFind(t *testing.T, query string, opts QueryOpts) GraphiteMetricsFindResponse
- func (c Vmsingle) GraphiteMetricsIndex(t *testing.T, opts QueryOpts) GraphiteMetricsIndexResponse
- func (c Vmsingle) GraphiteRender(t *testing.T, target string, opts QueryOpts) GraphiteRenderResponse
- func (c Vmsingle) GraphiteTagsTagMultiSeries(t *testing.T, records []string, opts QueryOpts)
- func (c Vmsingle) GraphiteTagsTagSeries(t *testing.T, record string, opts QueryOpts)
- func (c Vmsingle) GraphiteWrite(t *testing.T, records []string, _ QueryOpts)
- func (app *Vmsingle) HTTPAddr() string
- func (c Vmsingle) InfluxWrite(t *testing.T, records []string, opts QueryOpts)
- func (app Vmsingle) Name() string
- func (c Vmsingle) OpenTSDBAPIPut(t *testing.T, records []string, opts QueryOpts)
- func (c Vmsingle) OpentelemetryV1Metrics(t *testing.T, md otlppb.MetricsData, opts QueryOpts)
- func (c Vmsingle) PrometheusAPIV1AdminStatusMetricNamesStatsReset(t *testing.T, opts QueryOpts)
- func (c Vmsingle) PrometheusAPIV1AdminTSDBDeleteSeries(t *testing.T, matchQuery string, opts QueryOpts)
- func (c Vmsingle) PrometheusAPIV1Export(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
- func (c Vmsingle) PrometheusAPIV1ExportNative(t *testing.T, query string, opts QueryOpts) []byte
- func (c Vmsingle) PrometheusAPIV1ImportCSV(t *testing.T, records []string, opts QueryOpts)
- func (c Vmsingle) PrometheusAPIV1ImportNative(t *testing.T, data []byte, opts QueryOpts)
- func (c Vmsingle) PrometheusAPIV1ImportPrometheus(t *testing.T, records []string, opts QueryOpts)
- func (c Vmsingle) PrometheusAPIV1LabelValues(t *testing.T, labelName, matchQuery string, opts QueryOpts) *PrometheusAPIV1LabelValuesResponse
- func (c Vmsingle) PrometheusAPIV1Labels(t *testing.T, matchQuery string, opts QueryOpts) *PrometheusAPIV1LabelsResponse
- func (c Vmsingle) PrometheusAPIV1Metadata(t *testing.T, metric string, limit int, opts QueryOpts) *PrometheusAPIV1Metadata
- func (c Vmsingle) PrometheusAPIV1Query(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
- func (c Vmsingle) PrometheusAPIV1QueryRange(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
- func (c Vmsingle) PrometheusAPIV1Series(t *testing.T, matchQuery string, opts QueryOpts) *PrometheusAPIV1SeriesResponse
- func (c Vmsingle) PrometheusAPIV1SeriesCount(t *testing.T, opts QueryOpts) *PrometheusAPIV1SeriesCountResponse
- func (c Vmsingle) PrometheusAPIV1StatusMetricNamesStats(t *testing.T, limit, le, matchPattern string, opts QueryOpts) MetricNamesStatsResponse
- func (c Vmsingle) PrometheusAPIV1StatusTSDB(t *testing.T, matchQuery string, date string, topN string, opts QueryOpts) TSDBStatusResponse
- func (c Vmsingle) PrometheusAPIV1Write(t *testing.T, wr prompb.WriteRequest, opts QueryOpts)
- func (c Vmsingle) SnapshotCreate(t *testing.T) *SnapshotCreateResponse
- func (c Vmsingle) SnapshotCreateURL() string
- func (c Vmsingle) SnapshotDelete(t *testing.T, snapshotName string) *SnapshotDeleteResponse
- func (c Vmsingle) SnapshotDeleteAll(t *testing.T) *SnapshotDeleteAllResponse
- func (c Vmsingle) SnapshotList(t *testing.T) *SnapshotListResponse
- func (app Vmsingle) Stop()
- func (app *Vmsingle) String() string
- func (app *Vmsingle) VmselectAddr() string
- func (c Vmsingle) ZabbixConnectorHistory(t *testing.T, records []string, opts QueryOpts)
- type Vmstorage
- func (c Vmstorage) APIV1AdminTSDBSnapshot(t *testing.T) *APIV1AdminTSDBSnapshotResponse
- func (c Vmstorage) ForceFlush(t *testing.T)
- func (c Vmstorage) ForceMerge(t *testing.T)
- func (c Vmstorage) GetIntMetric(t *testing.T, metricName string) int
- func (c Vmstorage) GetMetric(t *testing.T, metricName string) float64
- func (c Vmstorage) GetMetricsByPrefix(t *testing.T, prefix string) []float64
- func (c Vmstorage) GetMetricsByRegexp(t *testing.T, re *regexp.Regexp) []float64
- func (app Vmstorage) Name() string
- func (c Vmstorage) SnapshotCreate(t *testing.T) *SnapshotCreateResponse
- func (c Vmstorage) SnapshotCreateURL() string
- func (c Vmstorage) SnapshotDelete(t *testing.T, snapshotName string) *SnapshotDeleteResponse
- func (c Vmstorage) SnapshotDeleteAll(t *testing.T) *SnapshotDeleteAllResponse
- func (c Vmstorage) SnapshotList(t *testing.T) *SnapshotListResponse
- func (app Vmstorage) Stop()
- func (app *Vmstorage) String() string
- func (app *Vmstorage) VminsertAddr() string
- func (app *Vmstorage) VmselectAddr() string
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertGraphiteMetricsExpand ¶ added in v1.122.26
func AssertGraphiteMetricsExpand(tc *TestCase, app PrometheusQuerier, query, tenantID string, want []string)
AssertGraphiteMetricsFind expands metric names by sending a request to /graphite/metrics/expand and compares the result with the expected one.
func AssertGraphiteMetricsFind ¶ added in v1.122.26
func AssertGraphiteMetricsFind(tc *TestCase, app PrometheusQuerier, query, tenantID string, want []GraphiteMetric)
AssertGraphiteMetricsFind finds metric names by sending a request to /graphite/metrics/find and compares the result with the expected one.
func AssertGraphiteMetricsIndex ¶ added in v1.122.26
func AssertGraphiteMetricsIndex(tc *TestCase, app PrometheusQuerier, tenantID string, want []string)
AssertGraphiteMetricsIndex retrieves all metrics by sending a request to /graphite/metrics/index.json and compares the result with the expected one.
func AssertGraphiteRender ¶ added in v1.122.26
func AssertGraphiteRender(tc *TestCase, app PrometheusQuerier, target, tenantID string, from, until, step int64, want []GraphiteRenderedTarget)
AssertGraphiteRender retieves metric raw data by sending a request to /graphite/render and compares the result with the expected one.
func AssertLabelValues ¶ added in v1.122.26
func AssertLabelValues(tc *TestCase, app PrometheusQuerier, metricNameRE, labelName, tenantID string, start, end int64, want []string)
AssertLabelValues retrieves values for the label whose name is labelName for the series whose name mathes metricNameRE, compares the result with the expected one.
func AssertLabels ¶ added in v1.122.26
func AssertLabels(tc *TestCase, app PrometheusQuerier, metricNameRE, tenantID string, start, end int64, want []string)
AssertLabels retrieves label names from the storage and compares the result with the expected one.
func AssertMetadata ¶ added in v1.122.26
func AssertMetadata(tc *TestCase, app PrometheusQuerier, metricName, tenantID string, want map[string][]MetadataEntry)
func AssertMetricNamesStats ¶ added in v1.122.26
func AssertMetricNamesStats(tc *TestCase, app PrometheusQuerier, metricNameRE, tenantID string, want []MetricNamesStatsRecord)
func AssertQueryResults ¶ added in v1.122.26
func AssertQueryResults(tc *TestCase, app PrometheusQuerier, metricNameRE, tenantID string, start, end, step int64, want []*QueryResult)
AssertQueryResults sends a data query to storage and compares the query result with the expected one.
func AssertSeries ¶ added in v1.122.26
func AssertSeries(tc *TestCase, app PrometheusQuerier, metricNameRE, tenantID string, start, end int64, want []map[string]string)
AssertSeries retrieves metric names from the storage and compares the result with the expected one.
func AssertSeriesCount ¶ added in v1.122.26
func AssertSeriesCount(tc *TestCase, app PrometheusQuerier, tenantID string, start, end int64, want uint64)
AssertSeriesCount retrieves series count and compares it with expected one.
func StartVmbackup ¶ added in v1.102.23
func StartVmbackup(instance, storageDataPath, snapshotCreateURL, dst string, output io.Writer) error
StartVmbackup starts the latest version of vmbackup with the given flags and waits until it exits.
The path to the binary can be provided via VMBACKUP_PATH environment variable. If the variable is not set, ../../bin/vmbackup-race will be used.
func StartVmctl ¶ added in v1.102.23
StartVmctl starts the latest version of vmctl with the given flags and waits until it exits.
The path to the binary can be provided via VMCTL_PATH environment variable. If the variable is not set, ../../bin/vmctl-race will be used.
func StartVmrestore ¶ added in v1.102.23
StartVmrestore starts the latest version of vmrestore with the given flags and waits until it exits.
The path to the binary can be provided via VMRESTORE_PATH environment variable. If the variable is not set, ../../bin/vmrestore-race will be used.
Types ¶
type APIV1AdminTSDBSnapshotResponse ¶ added in v1.102.18
type APIV1AdminTSDBSnapshotResponse struct {
Status string
Data *SnapshotData
}
APIV1AdminTSDBSnapshotResponse is an in-memory representation of the json response returned by the /api/v1/admin/tsdb/snapshot endpoint.
type AdminTenantsResponse ¶ added in v1.102.24
AdminTenantsResponse is an in-memory representation of the json response returned by the /api/v1/admin/tenants endpoint.
type AssertOptions ¶ added in v1.97.13
type AssertOptions struct {
Msg string
Got func() any
Want any
CmpOpts []cmp.Option
DoNotRetry bool
Retries int
Period time.Duration
FailNow bool
}
AssertOptions hold the assertion params, such as got and wanted values as well as the message that should be included into the assertion error message in case of failure.
In VictoriaMetrics (especially the cluster version) the inserted data does not become visible for querying right away. Therefore, the first comparisons may fail. AssertOptions allow to configure how many times the actual result must be retrieved and compared with the expected one and for long to wait between the retries. If these two params (`Retries` and `Period`) are not set, the default values will be used.
If it is known that the data is available, then the retry functionality can be disabled by setting the `DoNotRetry` field.
AssertOptions are used by the TestCase.Assert() method, and this method uses cmp.Diff() from go-cmp package for comparing got and wanted values. AssertOptions, therefore, allows to pass cmp.Options to cmp.Diff() via `CmpOpts` field.
Finally the `FailNow` field controls whether the assertion should fail using `testing.T.Errorf()` or `testing.T.Fatalf()`.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is used for interacting with the apps over the network.
func (*Client) CloseConnections ¶
func (c *Client) CloseConnections()
CloseConnections closes client connections.
func (*Client) Delete ¶ added in v1.102.18
Delete sends an HTTP DELETE request and returns the response body and status code to the caller.
func (*Client) Get ¶
Get sends an HTTP GET request, returns the response body and status code to the caller.
func (*Client) Post ¶
Post sends an HTTP POST request, returns the response body and status code to the caller.
type ClusterOptions ¶ added in v1.97.15
type ClusterOptions struct {
Vmstorage1Instance string
Vmstorage1Flags []string
Vmstorage2Instance string
Vmstorage2Flags []string
VminsertInstance string
VminsertFlags []string
VmselectInstance string
VmselectFlags []string
}
ClusterOptions holds the params for simple cluster configuration suitable for most tests.
The cluster consists of two vmstorages, one vminsert and one vmselect, no data replication.
Such configuration is suitable for tests that don't verify the cluster-specific behavior (such as sharding, replication, or multilevel vmselect) but instead just need a typical cluster configuration to verify some business logic (such as API surface, or MetricsQL). Such cluster tests usually come paired with corresponding vmsingle tests.
type GraphiteMetric ¶ added in v1.122.23
type GraphiteMetricsExpandResponse ¶ added in v1.122.23
type GraphiteMetricsExpandResponse = []string
GraphiteMetricsExpandResponse is an in-memory representation of the json response returned by the /graphite/metrics/expand endpoint.
type GraphiteMetricsFindResponse ¶ added in v1.122.23
type GraphiteMetricsFindResponse = []GraphiteMetric
GraphiteMetricsIndexResponse is an in-memory representation of the json response returned by the /graphite/metrics/find endpoint.
type GraphiteMetricsIndexResponse ¶ added in v1.102.25
type GraphiteMetricsIndexResponse = []string
GraphiteMetricsIndexResponse is an in-memory representation of the json response returned by the /graphite/metrics/index.json endpoint.
type GraphiteRenderResponse ¶ added in v1.122.23
type GraphiteRenderResponse = []GraphiteRenderedTarget
GraphiteRenderResponse is an in-memory representation of the json response returned by the /graphite/render endpoint.
type GraphiteRenderedTarget ¶ added in v1.122.23
type GraphiteTestData ¶ added in v1.122.26
type GraphiteTestData struct {
Samples []string
Step int64
WantMetricsIndex []string
WantMetricsFind []GraphiteMetric
WantMetricsExpand []string
WantRenderedTargets []GraphiteRenderedTarget
}
GraphiteTestData holds the data samples in Graphite Pickle format, distance between samples in milliseconds and expected responses for various Graphite API endpoints.
func GenerateGraphiteTestData ¶ added in v1.122.26
func GenerateGraphiteTestData(prefix string, numMetrics, start, end int64) GraphiteTestData
GenerateGraphiteTestData generates Graphite test data.
type MetadataEntry ¶ added in v1.110.24
type MetricNamesStatsRecord ¶ added in v1.102.16
MetricNamesStatsRecord is a record item for MetricNamesStatsResponse
type MetricNamesStatsResponse ¶ added in v1.102.16
type MetricNamesStatsResponse struct {
Records []MetricNamesStatsRecord
}
MetricNamesStatsResponse is an inmemory representation of the /api/v1/status/metric_names_stats API response
type PrometheusAPIV1LabelValuesResponse ¶ added in v1.102.26
type PrometheusAPIV1LabelValuesResponse struct {
Status string
IsPartial bool
Data []string
Trace *Trace
ErrorType string
Error string
}
PrometheusAPIV1LabelValuesResponse is an inmemory representation of the /prometheus/api/v1/labels/.../values response.
func NewPrometheusAPIV1LabelValuesResponse ¶ added in v1.102.26
func NewPrometheusAPIV1LabelValuesResponse(t *testing.T, s string) *PrometheusAPIV1LabelValuesResponse
NewPrometheusAPIV1LabelValuesResponse is a test helper function that creates a new instance of PrometheusAPIV1LabelValuesResponse by unmarshalling a json string.
type PrometheusAPIV1LabelsResponse ¶ added in v1.102.26
type PrometheusAPIV1LabelsResponse struct {
Status string
IsPartial bool
Data []string
Trace *Trace
ErrorType string
Error string
}
PrometheusAPIV1LabelsResponse is an inmemory representation of the /prometheus/api/v1/labels response.
func NewPrometheusAPIV1LabelsResponse ¶ added in v1.102.26
func NewPrometheusAPIV1LabelsResponse(t *testing.T, s string) *PrometheusAPIV1LabelsResponse
NewPrometheusAPIV1LabelsResponse is a test helper function that creates a new instance of PrometheusAPIV1LabelsResponse by unmarshalling a json string.
type PrometheusAPIV1Metadata ¶ added in v1.110.24
type PrometheusAPIV1Metadata struct {
Status string
IsPartial bool
Data map[string][]MetadataEntry
Trace *Trace
}
PrometheusAPIV1Metadata is an inmemory representation of the /prometheus/api/v1/metadata response.
func NewPrometheusAPIV1Metadata ¶ added in v1.110.24
func NewPrometheusAPIV1Metadata(t *testing.T, s string) *PrometheusAPIV1Metadata
NewPrometheusAPIV1Metadata is a test helper function that creates a new instance of PrometheusAPIV1Metadata by unmarshalling a json string.
type PrometheusAPIV1QueryResponse ¶ added in v1.97.12
type PrometheusAPIV1QueryResponse struct {
Status string
Data *QueryData
ErrorType string
Error string
IsPartial bool
}
PrometheusAPIV1QueryResponse is an inmemory representation of the /prometheus/api/v1/query or /prometheus/api/v1/query_range response.
func NewPrometheusAPIV1QueryResponse ¶ added in v1.97.12
func NewPrometheusAPIV1QueryResponse(t *testing.T, s string) *PrometheusAPIV1QueryResponse
NewPrometheusAPIV1QueryResponse is a test helper function that creates a new instance of PrometheusAPIV1QueryResponse by unmarshalling a json string.
func (*PrometheusAPIV1QueryResponse) Sort ¶ added in v1.97.15
func (pqr *PrometheusAPIV1QueryResponse) Sort()
Sort performs data.Result sort by metric labels
type PrometheusAPIV1SeriesCountResponse ¶ added in v1.102.26
type PrometheusAPIV1SeriesCountResponse struct {
Status string
IsPartial bool
Data []uint64
Trace *Trace
ErrorType string
Error string
}
PrometheusAPIV1SeriesCountResponse is an inmemory representation of the /prometheus/api/v1/series/count response.
func NewPrometheusAPIV1SeriesCountResponse ¶ added in v1.102.26
func NewPrometheusAPIV1SeriesCountResponse(t *testing.T, s string) *PrometheusAPIV1SeriesCountResponse
NewPrometheusAPIV1SeriesCountResponse is a test helper function that creates a new instance of PrometheusAPIV1SeriesCountResponse by unmarshalling a json string.
type PrometheusAPIV1SeriesResponse ¶
type PrometheusAPIV1SeriesResponse struct {
Status string
IsPartial bool
Data []map[string]string
Trace *Trace
ErrorType string
Error string
}
PrometheusAPIV1SeriesResponse is an inmemory representation of the /prometheus/api/v1/series response.
func NewPrometheusAPIV1SeriesResponse ¶ added in v1.97.12
func NewPrometheusAPIV1SeriesResponse(t *testing.T, s string) *PrometheusAPIV1SeriesResponse
NewPrometheusAPIV1SeriesResponse is a test helper function that creates a new instance of PrometheusAPIV1SeriesResponse by unmarshalling a json string.
func (*PrometheusAPIV1SeriesResponse) Sort ¶ added in v1.97.13
func (r *PrometheusAPIV1SeriesResponse) Sort() *PrometheusAPIV1SeriesResponse
Sort sorts the response data.
type PrometheusQuerier ¶ added in v1.97.12
type PrometheusQuerier interface {
PrometheusAPIV1Export(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
PrometheusAPIV1Query(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
PrometheusAPIV1QueryRange(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
PrometheusAPIV1Series(t *testing.T, matchQuery string, opts QueryOpts) *PrometheusAPIV1SeriesResponse
PrometheusAPIV1SeriesCount(t *testing.T, opts QueryOpts) *PrometheusAPIV1SeriesCountResponse
PrometheusAPIV1Labels(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1LabelsResponse
PrometheusAPIV1LabelValues(t *testing.T, labelName, query string, opts QueryOpts) *PrometheusAPIV1LabelValuesResponse
PrometheusAPIV1ExportNative(t *testing.T, query string, opts QueryOpts) []byte
PrometheusAPIV1Metadata(t *testing.T, metric string, limit int, opts QueryOpts) *PrometheusAPIV1Metadata
PrometheusAPIV1StatusMetricNamesStats(t *testing.T, limit, le, matchPattern string, opts QueryOpts) MetricNamesStatsResponse
PrometheusAPIV1AdminTSDBDeleteSeries(t *testing.T, matchQuery string, opts QueryOpts)
// TODO(@rtm0): Prometheus does not provide this API. Either move it to a
// separate interface or rename this interface to allow for multiple querier
// types.
GraphiteMetricsIndex(t *testing.T, opts QueryOpts) GraphiteMetricsIndexResponse
GraphiteMetricsFind(t *testing.T, query string, opts QueryOpts) GraphiteMetricsFindResponse
GraphiteMetricsExpand(t *testing.T, query string, opts QueryOpts) GraphiteMetricsExpandResponse
GraphiteRender(t *testing.T, target string, opts QueryOpts) GraphiteRenderResponse
GraphiteTagsTagSeries(t *testing.T, record string, opts QueryOpts)
GraphiteTagsTagMultiSeries(t *testing.T, records []string, opts QueryOpts)
}
PrometheusQuerier contains methods available to Prometheus-like HTTP API for Querying
type PrometheusWriteQuerier ¶ added in v1.97.13
type PrometheusWriteQuerier interface {
Writer
PrometheusQuerier
StorageFlusher
StorageMerger
}
PrometheusWriteQuerier encompasses the methods for writing, flushing and querying the data.
type QueryData ¶ added in v1.97.12
type QueryData struct {
ResultType string
Result []*QueryResult
}
QueryData holds the query result along with its type.
type QueryOpts ¶ added in v1.97.12
type QueryOpts struct {
Tenant string
Timeout string
Start string
End string
Time string
Step string
ExtraFilters []string
ExtraLabels []string
Trace string
ReduceMemUsage string
MaxLookback string
LatencyOffset string
Format string
NoCache string
Headers http.Header
From string
Until string
StorageStep string
DenyPartialResponse string
}
QueryOpts contains various params used for querying or ingesting data
type QueryResult ¶ added in v1.97.12
type QueryResult struct {
Metric map[string]string
Sample *Sample `json:"value"`
Samples []*Sample `json:"values"`
}
QueryResult holds the metric name (in the form of label name-value collection) and its samples.
Sample or Samples field is set for /prometheus/api/v1/query or /prometheus/api/v1/query_range response respectively.
type Sample ¶ added in v1.97.12
Sample is a timeseries value at a given timestamp.
func NewSample ¶ added in v1.97.12
NewSample is a test helper function that creates a new sample out of time in RFC3339 format and a value.
func (*Sample) UnmarshalJSON ¶ added in v1.97.12
UnmarshalJSON populates the sample fields from a JSON string.
type SnapshotCreateResponse ¶ added in v1.102.18
SnapshotCreateResponse is an in-memory representation of the json response returned by the /snapshot/create endpoint.
type SnapshotData ¶ added in v1.102.18
type SnapshotData struct {
Name string
}
SnapshotData holds the info about the snapshot created via /api/v1/admin/tsdb/snapshot endpoint.
type SnapshotDeleteAllResponse ¶ added in v1.102.18
type SnapshotDeleteAllResponse struct {
Status string
}
SnapshotDeleteAllResponse is an in-memory representation of the json response returned by the /snapshot/delete_all endpoint.
type SnapshotDeleteResponse ¶ added in v1.102.18
SnapshotDeleteResponse is an in-memory representation of the json response returned by the /snapshot/delete endpoint.
type SnapshotListResponse ¶ added in v1.102.18
SnapshotListResponse is an in-memory representation of the json response returned by the /snapshot/list endpoint.
type Stopper ¶ added in v1.97.12
type Stopper interface {
Stop()
}
Stopper is an interface of objects that needs to be stopped via Stop() call
type StorageFlusher ¶ added in v1.97.13
StorageFlusher defines a method that forces the flushing of data inserted into the storage, so it becomes available for searching immediately.
type StorageMerger ¶ added in v1.102.17
StorageMerger defines a method that forces the merging of data inserted into the storage.
type TSDBStatusResponse ¶ added in v1.102.19
type TSDBStatusResponse struct {
IsPartial bool
Data TSDBStatusResponseData
}
TSDBStatusResponse is an in-memory representation of the json response returned by the /prometheus/api/v1/status/tsdb endpoint.
func (*TSDBStatusResponse) Sort ¶ added in v1.102.19
func (tsr *TSDBStatusResponse) Sort()
Sort performs sorting of stats entries
type TSDBStatusResponseData ¶ added in v1.102.19
type TSDBStatusResponseData struct {
TotalSeries int
TotalLabelValuePairs int
SeriesCountByMetricName []TSDBStatusResponseMetricNameEntry
SeriesCountByLabelName []TSDBStatusResponseEntry
SeriesCountByFocusLabelValue []TSDBStatusResponseEntry
SeriesCountByLabelValuePair []TSDBStatusResponseEntry
LabelValueCountByLabelName []TSDBStatusResponseEntry
}
TSDBStatusResponseData is a part of TSDBStatusResponse
type TSDBStatusResponseEntry ¶ added in v1.102.19
TSDBStatusResponseEntry defines stats entry for TSDBStatusResponseData
type TSDBStatusResponseMetricNameEntry ¶ added in v1.102.19
type TSDBStatusResponseMetricNameEntry struct {
Name string
Count int
RequestsCount int
LastRequestTimestamp int
}
TSDBStatusResponseMetricNameEntry defines metric names stats entry for TSDBStatusResponseData
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) Assert ¶ added in v1.97.13
func (tc *TestCase) Assert(opts *AssertOptions)
Assert compares the actual result with the expected one possibly multiple times in order to account for the fact that the inserted data does not become available for querying right away (especially in cluster version of VictoriaMetrics).
func (*TestCase) Client ¶
Client returns an instance of the client that can be used for interacting with the app(s) under test.
func (*TestCase) Dir ¶
Dir returns the directory name that should be used by as the -storageDataDir.
func (*TestCase) ForceFlush ¶ added in v1.97.14
ForceFlush flushes zero or more storages.
func (*TestCase) MustStartCluster ¶ added in v1.97.15
func (tc *TestCase) MustStartCluster(opts *ClusterOptions) *Vmcluster
MustStartCluster starts a typical cluster configuration with custom flags.
func (*TestCase) MustStartCluster_v1_132_0 ¶ added in v1.122.24
func (tc *TestCase) MustStartCluster_v1_132_0(opts *ClusterOptions) *Vmcluster
MustStartCluster_v1_132_0 starts a cluster with vmstorage-v1.132.0 with custom flags.
func (*TestCase) MustStartDefaultCluster ¶ added in v1.97.13
MustStartDefaultCluster starts a typical cluster configuration with default flags.
func (*TestCase) MustStartDefaultRWVmagent ¶ added in v1.122.22
MustStartDefaultRWVmagent is a test helper function that starts an instance of vmagent with defaults suitable for remote-write tests.
func (*TestCase) MustStartDefaultVmsingle ¶ added in v1.97.13
MustStartDefaultVmsingle is a test helper function that starts an instance of vmsingle with defaults suitable for most tests.
func (*TestCase) MustStartVmagent ¶ added in v1.102.19
func (tc *TestCase) MustStartVmagent(instance string, flags []string, promScrapeConfigFileYAML string) *Vmagent
MustStartVmagent is a test helper function that starts an instance of vmagent and fails the test if the app fails to start.
func (*TestCase) MustStartVmauth ¶ added in v1.102.13
MustStartVmauth is a test helper function that starts an instance of vmauth and fails the test if the app fails to start.
func (*TestCase) MustStartVmbackup ¶ added in v1.102.23
MustStartVmbackup is a test helper that starts an instance of vmbackup and waits until the app exits. It fails the test if the app fails to start or exits with non zero code.
func (*TestCase) MustStartVmctl ¶ added in v1.102.23
MustStartVmctl is a test helper function that starts an instance of vmctl
func (*TestCase) MustStartVminsert ¶ added in v1.97.12
MustStartVminsert is a test helper function that starts an instance of vminsert and fails the test if the app fails to start.
func (*TestCase) MustStartVmrestore ¶ added in v1.102.23
MustStartVmrestore is a test helper that starts an instance of vmrestore and waits until the app exits. It fails the test if the app fails to start or exits with non zero code.
func (*TestCase) MustStartVmselect ¶ added in v1.97.12
MustStartVmselect is a test helper function that starts an instance of vmselect (latest version) and fails the test if the app fails to start.
func (*TestCase) MustStartVmsingle ¶ added in v1.97.12
MustStartVmsingle is a test helper function that starts an instance of vmsingle (latest version) and fails the test if the app fails to start.
func (*TestCase) MustStartVmsingle_v1_132_0 ¶ added in v1.122.24
MustStartVmsingle_v1_132_0 is a test helper function that starts an instance of vmsingle-v1.132.0 (last version that uses legacy index) and fails the test if the app fails to start.
func (*TestCase) MustStartVmstorage ¶ added in v1.97.12
MustStartVmstorage is a test helper function that starts an instance of vmstorage (latest version) and fails the test if the app fails to start.
func (*TestCase) MustStartVmstorage_v1_132_0 ¶ added in v1.122.24
MustStartVmstorage_v1_132_0 is a test helper function that starts an instance of vmstorage-v1.132.0 (last version that uses legacy index) and fails the test if the app fails to start.
func (*TestCase) Stop ¶ added in v1.97.12
func (tc *TestCase) Stop()
Stop performs the test case clean up, such as closing all client connections and removing the -storageDataDir directory.
Note that the -storageDataDir is not removed in case of test case failure to allow for further manual debugging.
func (*TestCase) StopApp ¶ added in v1.97.14
StopApp stops the app identified by the `instance` name and removes it from the collection of started apps.
func (*TestCase) StopPrometheusWriteQuerier ¶ added in v1.102.14
func (tc *TestCase) StopPrometheusWriteQuerier(pwq PrometheusWriteQuerier)
StopPrometheusWriteQuerier stop all apps that are a part of the pwq.
type TestData ¶ added in v1.122.26
type TestData struct {
Samples []string
Step int64
WantSeries []map[string]string
WantLabels []string
WantLabelValues []string
WantQueryResults []*QueryResult
WantMetadata map[string][]MetadataEntry
WantMetricNamesStats []MetricNamesStatsRecord
}
func GenerateTestData ¶ added in v1.122.26
type Trace ¶ added in v1.97.14
Trace provides the description and the duration of some unit of work that has been performed during the request processing.
type Vmagent ¶ added in v1.102.19
type Vmagent struct {
// contains filtered or unexported fields
}
Vmagent holds the state of a vmagent app and provides vmagent-specific functions.
func StartVmagent ¶ added in v1.102.19
func StartVmagent(instance string, flags []string, cli *Client, promScrapeConfigFilePath string, output io.Writer) (*Vmagent, error)
StartVmagent starts the latest version of vmagent.
The path to the binary can be provided via VMAGENT_PATH environment variable. If the variable is not set, ../../bin/vmagent-race will be used.
func (*Vmagent) APIV1ImportPrometheus ¶ added in v1.102.19
APIV1ImportPrometheus 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 /api/v1/import/prometheus vmagent endpoint.
The call is blocked until the data is flushed to vmstorage or the timeout is reached.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1importprometheus
func (*Vmagent) APIV1ImportPrometheusNoWaitFlush ¶ added in v1.102.19
func (app *Vmagent) APIV1ImportPrometheusNoWaitFlush(t *testing.T, records []string, opts QueryOpts)
APIV1ImportPrometheusNoWaitFlush 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 /api/v1/import/prometheus vmagent endpoint.
The call accepts the records but does not guarantee successful flush to vmstorage. Flushing may still be in progress on the function return.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1importprometheus
func (Vmagent) GetIntMetric ¶ added in v1.122.23
GetIntMetric retrieves the value of a metric served by an app at /metrics URL. The value is then converted to int.
func (Vmagent) GetMetric ¶ added in v1.122.23
GetMetric retrieves the value of a metric served by an app at /metrics URL.
func (Vmagent) GetMetricsByPrefix ¶ added in v1.122.23
GetMetricsByPrefix retrieves the values of all metrics that start with given prefix.
func (Vmagent) GetMetricsByRegexp ¶ added in v1.122.23
func (*Vmagent) HTTPAddr ¶ added in v1.110.22
HTTPAddr returns the address at which the vmagent process is listening for http connections.
func (Vmagent) Name ¶ added in v1.102.19
func (app Vmagent) Name() string
Name returns the application instance name.
func (*Vmagent) PrometheusAPIV1Write ¶ added in v1.122.21
PrometheusAPIV1Write is a test helper function that inserts a collection of records in Prometheus remote-write format by sending a HTTP POST request to /prometheus/api/v1/write vmagent endpoint.
func (*Vmagent) ReloadRelabelConfigs ¶ added in v1.102.24
ReloadRelabelConfigs sends SIGHUP to trigger relabel config reload and waits until vmagent_relabel_config_reloads_total increases. Fails the test if no reload is detected within 3 seconds.
func (*Vmagent) RemoteWritePacketsDroppedTotal ¶ added in v1.102.19
RemoteWritePacketsDroppedTotal sums up the total number of dropped remote write packets.
func (*Vmagent) RemoteWritePendingInmemoryBlocks ¶ added in v1.110.16
RemoteWritePendingInmemoryBlocks sums up the total number of pending in-memory blocks for given remote write URL.
func (*Vmagent) RemoteWriteRequests ¶ added in v1.110.16
RemoteWriteRequests sums up the total number of sending requests for given remote write URL.
func (*Vmagent) RemoteWriteRequestsRetriesCountTotal ¶ added in v1.102.19
RemoteWriteRequestsRetriesCountTotal sums up the total retries for remote write requests.
func (*Vmagent) RemoteWriteSamplesDropped ¶ added in v1.110.16
RemoteWriteSamplesDropped sums up the total number of dropped remote write samples for given remote write URL.
type Vmauth ¶ added in v1.102.13
type Vmauth struct {
// contains filtered or unexported fields
}
Vmauth holds the state of a vmauth app and provides vmauth-specific functions.
func StartVmauth ¶ added in v1.102.13
func StartVmauth(instance string, flags []string, cli *Client, configFilePath string, output io.Writer) (*Vmauth, error)
StartVmauth starts the latest version of vmauth.
The path to the binary can be provided via VMAUTH_PATH environment variable. If the variable is not set, ../../bin/vmauth-race will be used.
func (*Vmauth) GetHTTPListenAddr ¶ added in v1.102.13
GetHTTPListenAddr returns listen http addr
func (Vmauth) GetIntMetric ¶ added in v1.122.23
GetIntMetric retrieves the value of a metric served by an app at /metrics URL. The value is then converted to int.
func (Vmauth) GetMetric ¶ added in v1.122.23
GetMetric retrieves the value of a metric served by an app at /metrics URL.
func (Vmauth) GetMetricsByPrefix ¶ added in v1.122.23
GetMetricsByPrefix retrieves the values of all metrics that start with given prefix.
func (Vmauth) GetMetricsByRegexp ¶ added in v1.122.23
func (Vmauth) Name ¶ added in v1.102.13
func (app Vmauth) Name() string
Name returns the application instance name.
func (Vmauth) Stop ¶ added in v1.102.13
func (app Vmauth) Stop()
Stop sends the app process a SIGINT signal and waits until it terminates gracefully.
func (Vmauth) String ¶ added in v1.102.13
func (app Vmauth) String() string
String returns the string representation of the app state.
func (*Vmauth) UpdateConfiguration ¶ added in v1.102.13
UpdateConfiguration updates the vmauth configuration file with the provided YAML content, sends SIGHUP to trigger config reload and waits until vmauth_config_last_reload_total increases. Fails the test if no reload is detected within 2 seconds.
type Vmcluster ¶ added in v1.102.14
Vmcluster represents a typical cluster setup: several vmstorage replicas, one vminsert, and one vmselect.
Both Vmsingle and Vmcluster implement the PrometheusWriteQuerier used in business logic tests to abstract out the infrastructure.
This type is not suitable for infrastructure tests where custom cluster setups are often required.
func (Vmcluster) APIV1AdminTenants ¶ added in v1.122.23
func (c Vmcluster) APIV1AdminTenants(t *testing.T, opts QueryOpts) *AdminTenantsResponse
APIV1AdminTenants retrieves the list of tenants by sending a request to /admin/tenants endpoint.
func (*Vmcluster) ForceFlush ¶ added in v1.102.14
ForceFlush forces the ingested data to become visible for searching immediately.
func (*Vmcluster) ForceMerge ¶ added in v1.102.17
ForceMerge is a test helper function that forces the merging of parts.
func (Vmcluster) GraphiteMetricsExpand ¶ added in v1.122.23
func (c Vmcluster) GraphiteMetricsExpand(t *testing.T, query string, opts QueryOpts) GraphiteMetricsExpandResponse
GraphiteMetricsExpand expands the given query with matching paths by sending a request to /graphite/metrics/expand endpoint.
See https://docs.victoriametrics.com/victoriametrics/integrations/graphite/#metrics-api and https://graphite.readthedocs.io/en/latest/metrics_api.html#metrics-expand
func (Vmcluster) GraphiteMetricsFind ¶ added in v1.122.23
func (c Vmcluster) GraphiteMetricsFind(t *testing.T, query string, opts QueryOpts) GraphiteMetricsFindResponse
GraphiteMetricsFind finds metrics under a given path by sending a request to /metrics/find endpoint.
See https://docs.victoriametrics.com/victoriametrics/integrations/graphite/#metrics-api and https://graphite.readthedocs.io/en/latest/metrics_api.html#metrics-find
func (Vmcluster) GraphiteMetricsIndex ¶ added in v1.122.23
func (c Vmcluster) GraphiteMetricsIndex(t *testing.T, opts QueryOpts) GraphiteMetricsIndexResponse
GraphiteMetricsIndex retrieves the list of all metrics by sending a request to /graphite/metrics/index.json endpoint.
See https://docs.victoriametrics.com/victoriametrics/integrations/graphite/#metrics-api
func (Vmcluster) GraphiteRender ¶ added in v1.122.23
func (c Vmcluster) GraphiteRender(t *testing.T, target string, opts QueryOpts) GraphiteRenderResponse
GraphiteRender retrieves the raw metric data by sending a request to /graphite/render endpoint.
See https://docs.victoriametrics.com/victoriametrics/integrations/graphite/#render-api and https://graphite-api.readthedocs.io/en/latest/api.html#the-render-api-render
func (Vmcluster) GraphiteTagsTagMultiSeries ¶ added in v1.122.23
GraphiteTagsTagMultiSeries is a test helper function that registers Graphite tags for a multiple time series by sending a request to /graphite/tags/tagSeries endpoint.
func (Vmcluster) GraphiteTagsTagSeries ¶ added in v1.122.23
GraphiteTagsTagSeries is a test helper function that registers Graphite tags for a single time series by sending a request to /graphite/tags/tagSeries endpoint.
func (Vmcluster) GraphiteWrite ¶ added in v1.122.23
GraphiteWrite is a test helper function that sends a collection of records to graphiteListenAddr port.
See https://docs.victoriametrics.com/victoriametrics/integrations/graphite/#ingesting
func (Vmcluster) InfluxWrite ¶ added in v1.122.23
InfluxWrite is a test helper function that inserts a collection of records in Influx line format by sending a HTTP POST request to /influx/write endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#influxwrite
func (Vmcluster) OpenTSDBAPIPut ¶ added in v1.122.23
OpenTSDBAPIPut is a test helper function that inserts a collection of records in OpenTSDB format for the given tenant by sending an HTTP POST request to /opentsdb/api/put vminsert endpoint.
See https://docs.victoriametrics.com/cluster-victoriametrics/#url-format
func (Vmcluster) OpentelemetryV1Metrics ¶ added in v1.122.23
func (c Vmcluster) OpentelemetryV1Metrics(t *testing.T, md otlppb.MetricsData, opts QueryOpts)
OpentelemetryV1Metrics is a test helper function that inserts a collection of records in Opentelemetry protocol format by sending a HTTP POST request to /opentelemetry/v1/metrics vminsert endpoint.
func (Vmcluster) PrometheusAPIV1AdminStatusMetricNamesStatsReset ¶ added in v1.122.23
PrometheusAPIV1AdminStatusMetricNamesStatsReset resets the metric name usage stats by sending a request to /prometheus/api/v1/admin/status/metric_names_stats/reset endpoint
func (Vmcluster) PrometheusAPIV1AdminTSDBDeleteSeries ¶ added in v1.122.23
func (c Vmcluster) PrometheusAPIV1AdminTSDBDeleteSeries(t *testing.T, matchQuery string, opts QueryOpts)
PrometheusAPIV1AdminTSDBDeleteSeries deletes the series that match the query by sending a request to /prometheus/api/v1/admin/tsdb/delete_series.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1admintsdbdelete_series
func (Vmcluster) PrometheusAPIV1Export ¶ added in v1.122.23
func (c Vmcluster) PrometheusAPIV1Export(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
PrometheusAPIV1Export is a test helper function that performs the export of raw samples in JSON line format by sending a request to /prometheus/api/v1/export endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1export
func (Vmcluster) PrometheusAPIV1ExportNative ¶ added in v1.122.23
PrometheusAPIV1ExportNative is a test helper function that performs the export of raw samples in native binary format by sending a request to /prometheus/api/v1/export/native endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1exportnative
func (Vmcluster) PrometheusAPIV1ImportCSV ¶ added in v1.122.23
PrometheusAPIV1ImportCSV is a test helper function that inserts a collection of records in CSV format for the given tenant by sending an HTTP POST request to prometheus/api/v1/import/csv vminsert endpoint.
See https://docs.victoriametrics.com/cluster-victoriametrics/#url-format
func (Vmcluster) PrometheusAPIV1ImportNative ¶ added in v1.122.23
PrometheusAPIV1ImportNative is a test helper function that inserts a collection of records in Native format for the given tenant by sending an HTTP POST request to prometheus/api/v1/import/native vminsert endpoint.
See https://docs.victoriametrics.com/cluster-victoriametrics/#url-format
func (Vmcluster) PrometheusAPIV1ImportPrometheus ¶ added in v1.122.23
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/victoriametrics/url-examples/#apiv1importprometheus
func (Vmcluster) PrometheusAPIV1LabelValues ¶ added in v1.122.23
func (c Vmcluster) PrometheusAPIV1LabelValues(t *testing.T, labelName, matchQuery string, opts QueryOpts) *PrometheusAPIV1LabelValuesResponse
PrometheusAPIV1LabelValues retrieves the labels values for the metrics that match the query by sending a request to /prometheus/api/v1/label/.../values endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1labelvalues
func (Vmcluster) PrometheusAPIV1Labels ¶ added in v1.122.23
func (c Vmcluster) PrometheusAPIV1Labels(t *testing.T, matchQuery string, opts QueryOpts) *PrometheusAPIV1LabelsResponse
PrometheusAPIV1Labels retrieves the label names for time series that match a query by sending a request to /prometheus/api/v1/labels endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1labels
func (Vmcluster) PrometheusAPIV1Metadata ¶ added in v1.122.23
func (c Vmcluster) PrometheusAPIV1Metadata(t *testing.T, metric string, limit int, opts QueryOpts) *PrometheusAPIV1Metadata
PrometheusAPIV1Metadata retrieves metadata for the given metric by sending a request to /prometheus/api/v1/metadata endpoint.
func (Vmcluster) PrometheusAPIV1Query ¶ added in v1.122.23
func (c Vmcluster) PrometheusAPIV1Query(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
PrometheusAPIV1Query is a test helper function that performs PromQL/MetricsQL instant query by sending a request to /prometheus/api/v1/query endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1query
func (Vmcluster) PrometheusAPIV1QueryRange ¶ added in v1.122.23
func (c Vmcluster) PrometheusAPIV1QueryRange(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
PrometheusAPIV1QueryRange is a test helper function that performs PromQL/MetricsQL range query by sending a request to /prometheus/api/v1/query_range endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1query_range
func (Vmcluster) PrometheusAPIV1Series ¶ added in v1.122.23
func (c Vmcluster) PrometheusAPIV1Series(t *testing.T, matchQuery string, opts QueryOpts) *PrometheusAPIV1SeriesResponse
PrometheusAPIV1Series retrieves list of time series that match the query by sending a request to /prometheus/api/v1/series endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1series
func (Vmcluster) PrometheusAPIV1SeriesCount ¶ added in v1.122.23
func (c Vmcluster) PrometheusAPIV1SeriesCount(t *testing.T, opts QueryOpts) *PrometheusAPIV1SeriesCountResponse
PrometheusAPIV1SeriesCount retrieves the total number of time series by sending a request to /prometheus/api/v1/series/count endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1series
func (Vmcluster) PrometheusAPIV1StatusMetricNamesStats ¶ added in v1.122.23
func (c Vmcluster) PrometheusAPIV1StatusMetricNamesStats(t *testing.T, limit, le, matchPattern string, opts QueryOpts) MetricNamesStatsResponse
PrometheusAPIV1StatusMetricNamesStats sends a query to /prometheus/api/v1/status/metric_names_stats endpoint and returns the metric usage stats response for given params.
func (Vmcluster) PrometheusAPIV1StatusTSDB ¶ added in v1.122.23
func (c Vmcluster) PrometheusAPIV1StatusTSDB(t *testing.T, matchQuery string, date string, topN string, opts QueryOpts) TSDBStatusResponse
PrometheusAPIV1StatusTSDB retrieves the TSDB status for the time series that match the query on the given date by sending a request to /prometheus/api/v1/status/tsdb endpoint.
See https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#tsdb-stats
func (Vmcluster) PrometheusAPIV1Write ¶ added in v1.122.23
func (c Vmcluster) PrometheusAPIV1Write(t *testing.T, wr prompb.WriteRequest, opts QueryOpts)
PrometheusAPIV1Write is a test helper function that inserts a collection of records in Prometheus remote-write format by sending a HTTP POST request to /prometheus/api/v1/write vminsert endpoint.
func (Vmcluster) ZabbixConnectorHistory ¶ added in v1.122.23
ZabbixConnectorHistory is a test helper function that inserts a collection of records in zabbixconnector format by sending a HTTP POST request to /zabbixconnector/api/v1/history vmsingle endpoint.
type Vminsert ¶
type Vminsert struct {
// contains filtered or unexported fields
}
Vminsert holds the state of a vminsert app and provides vminsert-specific functions.
func StartVminsert ¶
func StartVminsert(instance string, flags []string, cli *Client, output io.Writer) (*Vminsert, error)
StartVminsert starts the latest version of vminsert.
The path to the binary can be provided via VMINSERT_PATH environment variable. If the variable is not set, ../../bin/vminsert-race will be used.
func (*Vminsert) ClusternativeListenAddr ¶ added in v1.97.14
ClusternativeListenAddr returns the address at which the vminsert process is listening for connections from other vminsert apps.
func (Vminsert) GetIntMetric ¶ added in v1.122.23
GetIntMetric retrieves the value of a metric served by an app at /metrics URL. The value is then converted to int.
func (Vminsert) GetMetric ¶ added in v1.122.23
GetMetric retrieves the value of a metric served by an app at /metrics URL.
func (Vminsert) GetMetricsByPrefix ¶ added in v1.122.23
GetMetricsByPrefix retrieves the values of all metrics that start with given prefix.
func (Vminsert) GetMetricsByRegexp ¶ added in v1.122.23
func (Vminsert) GraphiteWrite ¶ added in v1.102.20
GraphiteWrite is a test helper function that sends a collection of records to graphiteListenAddr port.
See https://docs.victoriametrics.com/victoriametrics/integrations/graphite/#ingesting
func (*Vminsert) HTTPAddr ¶ added in v1.102.23
HTTPAddr returns the address at which the vminsert process is listening for incoming HTTP requests.
func (Vminsert) InfluxWrite ¶ added in v1.97.15
InfluxWrite is a test helper function that inserts a collection of records in Influx line format by sending a HTTP POST request to /influx/write endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#influxwrite
func (Vminsert) Name ¶ added in v1.97.14
func (app Vminsert) Name() string
Name returns the application instance name.
func (Vminsert) OpenTSDBAPIPut ¶ added in v1.102.20
OpenTSDBAPIPut is a test helper function that inserts a collection of records in OpenTSDB format for the given tenant by sending an HTTP POST request to /opentsdb/api/put vminsert endpoint.
See https://docs.victoriametrics.com/cluster-victoriametrics/#url-format
func (Vminsert) OpentelemetryV1Metrics ¶ added in v1.122.22
func (c Vminsert) OpentelemetryV1Metrics(t *testing.T, md otlppb.MetricsData, opts QueryOpts)
OpentelemetryV1Metrics is a test helper function that inserts a collection of records in Opentelemetry protocol format by sending a HTTP POST request to /opentelemetry/v1/metrics vminsert endpoint.
func (Vminsert) PrometheusAPIV1ImportCSV ¶ added in v1.102.20
PrometheusAPIV1ImportCSV is a test helper function that inserts a collection of records in CSV format for the given tenant by sending an HTTP POST request to prometheus/api/v1/import/csv vminsert endpoint.
See https://docs.victoriametrics.com/cluster-victoriametrics/#url-format
func (Vminsert) PrometheusAPIV1ImportNative ¶ added in v1.102.23
PrometheusAPIV1ImportNative is a test helper function that inserts a collection of records in Native format for the given tenant by sending an HTTP POST request to prometheus/api/v1/import/native vminsert endpoint.
See https://docs.victoriametrics.com/cluster-victoriametrics/#url-format
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/victoriametrics/url-examples/#apiv1importprometheus
func (Vminsert) PrometheusAPIV1Write ¶ added in v1.97.13
func (c Vminsert) PrometheusAPIV1Write(t *testing.T, wr prompb.WriteRequest, opts QueryOpts)
PrometheusAPIV1Write is a test helper function that inserts a collection of records in Prometheus remote-write format by sending a HTTP POST request to /prometheus/api/v1/write vminsert endpoint.
func (Vminsert) Stop ¶
func (app Vminsert) Stop()
Stop sends the app process a SIGINT signal and waits until it terminates gracefully.
func (Vminsert) ZabbixConnectorHistory ¶ added in v1.110.28
ZabbixConnectorHistory is a test helper function that inserts a collection of records in zabbixconnector format by sending a HTTP POST request to /zabbixconnector/api/v1/history vmsingle endpoint.
type Vmselect ¶
type Vmselect struct {
// contains filtered or unexported fields
}
Vmselect holds the state of a vmselect app and provides vmselect-specific functions.
func StartVmselect ¶
func StartVmselect(instance string, flags []string, cli *Client, output io.Writer) (*Vmselect, error)
StartVmselect starts the latest version of vmselect.
The path to the binary can be provided via VMSELECT_PATH environment variable. If the variable is not set, ../../bin/vmselect-race will be used.
func (Vmselect) APIV1AdminTenants ¶ added in v1.102.24
func (c Vmselect) APIV1AdminTenants(t *testing.T, opts QueryOpts) *AdminTenantsResponse
APIV1AdminTenants retrieves the list of tenants by sending a request to /admin/tenants endpoint.
func (*Vmselect) ClusternativeListenAddr ¶
ClusternativeListenAddr returns the address at which the vmselect process is listening for connections from other vmselect apps.
func (Vmselect) GetIntMetric ¶ added in v1.122.23
GetIntMetric retrieves the value of a metric served by an app at /metrics URL. The value is then converted to int.
func (Vmselect) GetMetric ¶ added in v1.122.23
GetMetric retrieves the value of a metric served by an app at /metrics URL.
func (Vmselect) GetMetricsByPrefix ¶ added in v1.122.23
GetMetricsByPrefix retrieves the values of all metrics that start with given prefix.
func (Vmselect) GetMetricsByRegexp ¶ added in v1.122.23
func (Vmselect) GraphiteMetricsExpand ¶ added in v1.122.23
func (c Vmselect) GraphiteMetricsExpand(t *testing.T, query string, opts QueryOpts) GraphiteMetricsExpandResponse
GraphiteMetricsExpand expands the given query with matching paths by sending a request to /graphite/metrics/expand endpoint.
See https://docs.victoriametrics.com/victoriametrics/integrations/graphite/#metrics-api and https://graphite.readthedocs.io/en/latest/metrics_api.html#metrics-expand
func (Vmselect) GraphiteMetricsFind ¶ added in v1.122.23
func (c Vmselect) GraphiteMetricsFind(t *testing.T, query string, opts QueryOpts) GraphiteMetricsFindResponse
GraphiteMetricsFind finds metrics under a given path by sending a request to /metrics/find endpoint.
See https://docs.victoriametrics.com/victoriametrics/integrations/graphite/#metrics-api and https://graphite.readthedocs.io/en/latest/metrics_api.html#metrics-find
func (Vmselect) GraphiteMetricsIndex ¶ added in v1.102.25
func (c Vmselect) GraphiteMetricsIndex(t *testing.T, opts QueryOpts) GraphiteMetricsIndexResponse
GraphiteMetricsIndex retrieves the list of all metrics by sending a request to /graphite/metrics/index.json endpoint.
See https://docs.victoriametrics.com/victoriametrics/integrations/graphite/#metrics-api
func (Vmselect) GraphiteRender ¶ added in v1.122.23
func (c Vmselect) GraphiteRender(t *testing.T, target string, opts QueryOpts) GraphiteRenderResponse
GraphiteRender retrieves the raw metric data by sending a request to /graphite/render endpoint.
See https://docs.victoriametrics.com/victoriametrics/integrations/graphite/#render-api and https://graphite-api.readthedocs.io/en/latest/api.html#the-render-api-render
func (Vmselect) GraphiteTagsTagMultiSeries ¶ added in v1.122.17
GraphiteTagsTagMultiSeries is a test helper function that registers Graphite tags for a multiple time series by sending a request to /graphite/tags/tagSeries endpoint.
func (Vmselect) GraphiteTagsTagSeries ¶ added in v1.122.17
GraphiteTagsTagSeries is a test helper function that registers Graphite tags for a single time series by sending a request to /graphite/tags/tagSeries endpoint.
func (*Vmselect) HTTPAddr ¶ added in v1.102.24
HTTPAddr returns the address at which the vmselect process is listening for incoming HTTP requests.
func (Vmselect) Name ¶ added in v1.97.14
func (app Vmselect) Name() string
Name returns the application instance name.
func (Vmselect) PrometheusAPIV1AdminStatusMetricNamesStatsReset ¶ added in v1.122.23
PrometheusAPIV1AdminStatusMetricNamesStatsReset resets the metric name usage stats by sending a request to /prometheus/api/v1/admin/status/metric_names_stats/reset endpoint
func (Vmselect) PrometheusAPIV1AdminTSDBDeleteSeries ¶ added in v1.122.23
func (c Vmselect) PrometheusAPIV1AdminTSDBDeleteSeries(t *testing.T, matchQuery string, opts QueryOpts)
PrometheusAPIV1AdminTSDBDeleteSeries deletes the series that match the query by sending a request to /prometheus/api/v1/admin/tsdb/delete_series.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1admintsdbdelete_series
func (Vmselect) PrometheusAPIV1Export ¶ added in v1.97.13
func (c Vmselect) PrometheusAPIV1Export(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
PrometheusAPIV1Export is a test helper function that performs the export of raw samples in JSON line format by sending a request to /prometheus/api/v1/export endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1export
func (Vmselect) PrometheusAPIV1ExportNative ¶ added in v1.102.23
PrometheusAPIV1ExportNative is a test helper function that performs the export of raw samples in native binary format by sending a request to /prometheus/api/v1/export/native endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1exportnative
func (Vmselect) PrometheusAPIV1LabelValues ¶ added in v1.102.26
func (c Vmselect) PrometheusAPIV1LabelValues(t *testing.T, labelName, matchQuery string, opts QueryOpts) *PrometheusAPIV1LabelValuesResponse
PrometheusAPIV1LabelValues retrieves the labels values for the metrics that match the query by sending a request to /prometheus/api/v1/label/.../values endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1labelvalues
func (Vmselect) PrometheusAPIV1Labels ¶ added in v1.102.26
func (c Vmselect) PrometheusAPIV1Labels(t *testing.T, matchQuery string, opts QueryOpts) *PrometheusAPIV1LabelsResponse
PrometheusAPIV1Labels retrieves the label names for time series that match a query by sending a request to /prometheus/api/v1/labels endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1labels
func (Vmselect) PrometheusAPIV1Metadata ¶ added in v1.110.24
func (c Vmselect) PrometheusAPIV1Metadata(t *testing.T, metric string, limit int, opts QueryOpts) *PrometheusAPIV1Metadata
PrometheusAPIV1Metadata retrieves metadata for the given metric by sending a request to /prometheus/api/v1/metadata endpoint.
func (Vmselect) PrometheusAPIV1Query ¶ added in v1.97.12
func (c Vmselect) PrometheusAPIV1Query(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
PrometheusAPIV1Query is a test helper function that performs PromQL/MetricsQL instant query by sending a request to /prometheus/api/v1/query endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1query
func (Vmselect) PrometheusAPIV1QueryRange ¶ added in v1.97.12
func (c Vmselect) PrometheusAPIV1QueryRange(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
PrometheusAPIV1QueryRange is a test helper function that performs PromQL/MetricsQL range query by sending a request to /prometheus/api/v1/query_range endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1query_range
func (Vmselect) PrometheusAPIV1Series ¶
func (c Vmselect) PrometheusAPIV1Series(t *testing.T, matchQuery string, opts QueryOpts) *PrometheusAPIV1SeriesResponse
PrometheusAPIV1Series retrieves list of time series that match the query by sending a request to /prometheus/api/v1/series endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1series
func (Vmselect) PrometheusAPIV1SeriesCount ¶ added in v1.102.26
func (c Vmselect) PrometheusAPIV1SeriesCount(t *testing.T, opts QueryOpts) *PrometheusAPIV1SeriesCountResponse
PrometheusAPIV1SeriesCount retrieves the total number of time series by sending a request to /prometheus/api/v1/series/count endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1series
func (Vmselect) PrometheusAPIV1StatusMetricNamesStats ¶ added in v1.122.23
func (c Vmselect) PrometheusAPIV1StatusMetricNamesStats(t *testing.T, limit, le, matchPattern string, opts QueryOpts) MetricNamesStatsResponse
PrometheusAPIV1StatusMetricNamesStats sends a query to /prometheus/api/v1/status/metric_names_stats endpoint and returns the metric usage stats response for given params.
func (Vmselect) PrometheusAPIV1StatusTSDB ¶ added in v1.122.23
func (c Vmselect) PrometheusAPIV1StatusTSDB(t *testing.T, matchQuery string, date string, topN string, opts QueryOpts) TSDBStatusResponse
PrometheusAPIV1StatusTSDB retrieves the TSDB status for the time series that match the query on the given date by sending a request to /prometheus/api/v1/status/tsdb endpoint.
See https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#tsdb-stats
type Vmsingle ¶ added in v1.97.12
type Vmsingle struct {
// contains filtered or unexported fields
}
Vmsingle holds the state of a vmsingle app and provides vmsingle-specific functions.
func StartVmsingle ¶ added in v1.97.12
func StartVmsingle(instance string, flags []string, cli *Client, output io.Writer) (*Vmsingle, error)
StartVmsingle starts the latest version of vmsingle.
The path to the binary can be provided via VMSINGLE_PATH environment variable. If the variable is not set, ../../bin/victoria-metrics-race will be used.
func StartVmsingle_v1_132_0 ¶ added in v1.122.24
func StartVmsingle_v1_132_0(instance string, flags []string, cli *Client, output io.Writer) (*Vmsingle, error)
StartVmsingle_v1_132_0 starts vmsingle-v1.132.0 (the last version that uses legacy index).
The path to the binary must be provided via VMSINGLE_V1_132_0_PATH environment variable.
func (Vmsingle) APIV1AdminTSDBSnapshot ¶ added in v1.102.18
func (c Vmsingle) APIV1AdminTSDBSnapshot(t *testing.T) *APIV1AdminTSDBSnapshotResponse
APIV1AdminTSDBSnapshot creates a database snapshot by sending a query to the /api/v1/admin/tsdb/snapshot endpoint.
See https://prometheus.io/docs/prometheus/latest/querying/api/#snapshot.
func (Vmsingle) APIV1AdminTenants ¶ added in v1.122.23
func (c Vmsingle) APIV1AdminTenants(t *testing.T, opts QueryOpts) *AdminTenantsResponse
APIV1AdminTenants retrieves the list of tenants by sending a request to /admin/tenants endpoint.
func (Vmsingle) ForceFlush ¶ added in v1.97.12
ForceFlush is a test helper function that forces the flushing of inserted data, so it becomes available for searching immediately.
func (Vmsingle) ForceMerge ¶ added in v1.102.17
ForceMerge is a test helper function that forces the merging of parts.
func (Vmsingle) GetIntMetric ¶ added in v1.122.23
GetIntMetric retrieves the value of a metric served by an app at /metrics URL. The value is then converted to int.
func (Vmsingle) GetMetric ¶ added in v1.122.23
GetMetric retrieves the value of a metric served by an app at /metrics URL.
func (Vmsingle) GetMetricsByPrefix ¶ added in v1.122.23
GetMetricsByPrefix retrieves the values of all metrics that start with given prefix.
func (Vmsingle) GetMetricsByRegexp ¶ added in v1.122.23
func (Vmsingle) GraphiteMetricsExpand ¶ added in v1.122.23
func (c Vmsingle) GraphiteMetricsExpand(t *testing.T, query string, opts QueryOpts) GraphiteMetricsExpandResponse
GraphiteMetricsExpand expands the given query with matching paths by sending a request to /graphite/metrics/expand endpoint.
See https://docs.victoriametrics.com/victoriametrics/integrations/graphite/#metrics-api and https://graphite.readthedocs.io/en/latest/metrics_api.html#metrics-expand
func (Vmsingle) GraphiteMetricsFind ¶ added in v1.122.23
func (c Vmsingle) GraphiteMetricsFind(t *testing.T, query string, opts QueryOpts) GraphiteMetricsFindResponse
GraphiteMetricsFind finds metrics under a given path by sending a request to /metrics/find endpoint.
See https://docs.victoriametrics.com/victoriametrics/integrations/graphite/#metrics-api and https://graphite.readthedocs.io/en/latest/metrics_api.html#metrics-find
func (Vmsingle) GraphiteMetricsIndex ¶ added in v1.102.25
func (c Vmsingle) GraphiteMetricsIndex(t *testing.T, opts QueryOpts) GraphiteMetricsIndexResponse
GraphiteMetricsIndex retrieves the list of all metrics by sending a request to /graphite/metrics/index.json endpoint.
See https://docs.victoriametrics.com/victoriametrics/integrations/graphite/#metrics-api
func (Vmsingle) GraphiteRender ¶ added in v1.122.23
func (c Vmsingle) GraphiteRender(t *testing.T, target string, opts QueryOpts) GraphiteRenderResponse
GraphiteRender retrieves the raw metric data by sending a request to /graphite/render endpoint.
See https://docs.victoriametrics.com/victoriametrics/integrations/graphite/#render-api and https://graphite-api.readthedocs.io/en/latest/api.html#the-render-api-render
func (Vmsingle) GraphiteTagsTagMultiSeries ¶ added in v1.122.17
GraphiteTagsTagMultiSeries is a test helper function that registers Graphite tags for a multiple time series by sending a request to /graphite/tags/tagSeries endpoint.
func (Vmsingle) GraphiteTagsTagSeries ¶ added in v1.122.17
GraphiteTagsTagSeries is a test helper function that registers Graphite tags for a single time series by sending a request to /graphite/tags/tagSeries endpoint.
func (Vmsingle) GraphiteWrite ¶ added in v1.102.20
GraphiteWrite is a test helper function that sends a collection of records to graphiteListenAddr port.
See https://docs.victoriametrics.com/victoriametrics/integrations/graphite/#ingesting
func (*Vmsingle) HTTPAddr ¶ added in v1.102.19
HTTPAddr returns the address at which the vminsert process is listening for incoming HTTP requests.
func (Vmsingle) InfluxWrite ¶ added in v1.97.15
InfluxWrite is a test helper function that inserts a collection of records in Influx line format by sending a HTTP POST request to /influx/write endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#influxwrite
func (Vmsingle) Name ¶ added in v1.97.14
func (app Vmsingle) Name() string
Name returns the application instance name.
func (Vmsingle) OpenTSDBAPIPut ¶ added in v1.102.20
OpenTSDBAPIPut is a test helper function that inserts a collection of records in OpenTSDB format for the given tenant by sending an HTTP POST request to /opentsdb/api/put vminsert endpoint.
See https://docs.victoriametrics.com/cluster-victoriametrics/#url-format
func (Vmsingle) OpentelemetryV1Metrics ¶ added in v1.122.22
func (c Vmsingle) OpentelemetryV1Metrics(t *testing.T, md otlppb.MetricsData, opts QueryOpts)
OpentelemetryV1Metrics is a test helper function that inserts a collection of records in Opentelemetry protocol format by sending a HTTP POST request to /opentelemetry/v1/metrics vminsert endpoint.
func (Vmsingle) PrometheusAPIV1AdminStatusMetricNamesStatsReset ¶ added in v1.122.23
PrometheusAPIV1AdminStatusMetricNamesStatsReset resets the metric name usage stats by sending a request to /prometheus/api/v1/admin/status/metric_names_stats/reset endpoint
func (Vmsingle) PrometheusAPIV1AdminTSDBDeleteSeries ¶ added in v1.122.23
func (c Vmsingle) PrometheusAPIV1AdminTSDBDeleteSeries(t *testing.T, matchQuery string, opts QueryOpts)
PrometheusAPIV1AdminTSDBDeleteSeries deletes the series that match the query by sending a request to /prometheus/api/v1/admin/tsdb/delete_series.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1admintsdbdelete_series
func (Vmsingle) PrometheusAPIV1Export ¶ added in v1.97.13
func (c Vmsingle) PrometheusAPIV1Export(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
PrometheusAPIV1Export is a test helper function that performs the export of raw samples in JSON line format by sending a request to /prometheus/api/v1/export endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1export
func (Vmsingle) PrometheusAPIV1ExportNative ¶ added in v1.102.23
PrometheusAPIV1ExportNative is a test helper function that performs the export of raw samples in native binary format by sending a request to /prometheus/api/v1/export/native endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1exportnative
func (Vmsingle) PrometheusAPIV1ImportCSV ¶ added in v1.102.20
PrometheusAPIV1ImportCSV is a test helper function that inserts a collection of records in CSV format for the given tenant by sending an HTTP POST request to prometheus/api/v1/import/csv vminsert endpoint.
See https://docs.victoriametrics.com/cluster-victoriametrics/#url-format
func (Vmsingle) PrometheusAPIV1ImportNative ¶ added in v1.102.23
PrometheusAPIV1ImportNative is a test helper function that inserts a collection of records in Native format for the given tenant by sending an HTTP POST request to prometheus/api/v1/import/native vminsert endpoint.
See https://docs.victoriametrics.com/cluster-victoriametrics/#url-format
func (Vmsingle) PrometheusAPIV1ImportPrometheus ¶ added in v1.97.12
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/victoriametrics/url-examples/#apiv1importprometheus
func (Vmsingle) PrometheusAPIV1LabelValues ¶ added in v1.102.26
func (c Vmsingle) PrometheusAPIV1LabelValues(t *testing.T, labelName, matchQuery string, opts QueryOpts) *PrometheusAPIV1LabelValuesResponse
PrometheusAPIV1LabelValues retrieves the labels values for the metrics that match the query by sending a request to /prometheus/api/v1/label/.../values endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1labelvalues
func (Vmsingle) PrometheusAPIV1Labels ¶ added in v1.102.26
func (c Vmsingle) PrometheusAPIV1Labels(t *testing.T, matchQuery string, opts QueryOpts) *PrometheusAPIV1LabelsResponse
PrometheusAPIV1Labels retrieves the label names for time series that match a query by sending a request to /prometheus/api/v1/labels endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1labels
func (Vmsingle) PrometheusAPIV1Metadata ¶ added in v1.110.24
func (c Vmsingle) PrometheusAPIV1Metadata(t *testing.T, metric string, limit int, opts QueryOpts) *PrometheusAPIV1Metadata
PrometheusAPIV1Metadata retrieves metadata for the given metric by sending a request to /prometheus/api/v1/metadata endpoint.
func (Vmsingle) PrometheusAPIV1Query ¶ added in v1.97.12
func (c Vmsingle) PrometheusAPIV1Query(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
PrometheusAPIV1Query is a test helper function that performs PromQL/MetricsQL instant query by sending a request to /prometheus/api/v1/query endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1query
func (Vmsingle) PrometheusAPIV1QueryRange ¶ added in v1.97.12
func (c Vmsingle) PrometheusAPIV1QueryRange(t *testing.T, query string, opts QueryOpts) *PrometheusAPIV1QueryResponse
PrometheusAPIV1QueryRange is a test helper function that performs PromQL/MetricsQL range query by sending a request to /prometheus/api/v1/query_range endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1query_range
func (Vmsingle) PrometheusAPIV1Series ¶ added in v1.97.12
func (c Vmsingle) PrometheusAPIV1Series(t *testing.T, matchQuery string, opts QueryOpts) *PrometheusAPIV1SeriesResponse
PrometheusAPIV1Series retrieves list of time series that match the query by sending a request to /prometheus/api/v1/series endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1series
func (Vmsingle) PrometheusAPIV1SeriesCount ¶ added in v1.102.26
func (c Vmsingle) PrometheusAPIV1SeriesCount(t *testing.T, opts QueryOpts) *PrometheusAPIV1SeriesCountResponse
PrometheusAPIV1SeriesCount retrieves the total number of time series by sending a request to /prometheus/api/v1/series/count endpoint.
See https://docs.victoriametrics.com/victoriametrics/url-examples/#apiv1series
func (Vmsingle) PrometheusAPIV1StatusMetricNamesStats ¶ added in v1.122.23
func (c Vmsingle) PrometheusAPIV1StatusMetricNamesStats(t *testing.T, limit, le, matchPattern string, opts QueryOpts) MetricNamesStatsResponse
PrometheusAPIV1StatusMetricNamesStats sends a query to /prometheus/api/v1/status/metric_names_stats endpoint and returns the metric usage stats response for given params.
func (Vmsingle) PrometheusAPIV1StatusTSDB ¶ added in v1.122.23
func (c Vmsingle) PrometheusAPIV1StatusTSDB(t *testing.T, matchQuery string, date string, topN string, opts QueryOpts) TSDBStatusResponse
PrometheusAPIV1StatusTSDB retrieves the TSDB status for the time series that match the query on the given date by sending a request to /prometheus/api/v1/status/tsdb endpoint.
See https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#tsdb-stats
func (Vmsingle) PrometheusAPIV1Write ¶ added in v1.97.13
func (c Vmsingle) PrometheusAPIV1Write(t *testing.T, wr prompb.WriteRequest, opts QueryOpts)
PrometheusAPIV1Write is a test helper function that inserts a collection of records in Prometheus remote-write format by sending a HTTP POST request to /prometheus/api/v1/write vminsert endpoint.
func (Vmsingle) SnapshotCreate ¶ added in v1.102.18
func (c Vmsingle) SnapshotCreate(t *testing.T) *SnapshotCreateResponse
SnapshotCreate creates a database snapshot by sending a query to the /snapshot/create endpoint.
func (Vmsingle) SnapshotCreateURL ¶ added in v1.102.23
func (c Vmsingle) SnapshotCreateURL() string
SnapshotCreateURL returns the URL for creating snapshots.
func (Vmsingle) SnapshotDelete ¶ added in v1.102.18
func (c Vmsingle) SnapshotDelete(t *testing.T, snapshotName string) *SnapshotDeleteResponse
SnapshotDelete deletes a snapshot by sending a query to the /snapshot/delete endpoint.
func (Vmsingle) SnapshotDeleteAll ¶ added in v1.102.18
func (c Vmsingle) SnapshotDeleteAll(t *testing.T) *SnapshotDeleteAllResponse
SnapshotDeleteAll deletes all snapshots by sending a query to the /snapshot/delete_all endpoint.
func (Vmsingle) SnapshotList ¶ added in v1.102.18
func (c Vmsingle) SnapshotList(t *testing.T) *SnapshotListResponse
SnapshotList lists existing database snapshots by sending a query to the /snapshot/list endpoint.
func (Vmsingle) Stop ¶ added in v1.97.12
func (app Vmsingle) Stop()
Stop sends the app process a SIGINT signal and waits until it terminates gracefully.
func (*Vmsingle) String ¶ added in v1.97.12
String returns the string representation of the vmsingle app state.
func (*Vmsingle) VmselectAddr ¶ added in v1.122.26
VmselectAddr returns the address at which the vmsingle process is listening for vmselect connections.
func (Vmsingle) ZabbixConnectorHistory ¶ added in v1.110.28
ZabbixConnectorHistory is a test helper function that inserts a collection of records in zabbixconnector format by sending a HTTP POST request to /zabbixconnector/api/v1/history vmsingle endpoint.
type Vmstorage ¶
type Vmstorage struct {
// contains filtered or unexported fields
}
Vmstorage holds the state of a vmstorage app and provides vmstorage-specific functions.
func StartVmstorage ¶
func StartVmstorage(instance string, flags []string, cli *Client, output io.Writer) (*Vmstorage, error)
StartVmstorage starts the latest version of vmstorage.
The path to the binary can be provided via VMSTORAGE_PATH environment variable. If the variable is not set, ../../bin/vmstorage-race will be used.
func StartVmstorage_v1_132_0 ¶ added in v1.122.24
func StartVmstorage_v1_132_0(instance string, flags []string, cli *Client, output io.Writer) (*Vmstorage, error)
StartVmstorage_v1_132_0 starts vmstorage-v1.132.0 (the last version that uses legacy index).
The path to the binary must be provided via VMSTORAGE_V1_132_0_PATH environment variable.
func (Vmstorage) APIV1AdminTSDBSnapshot ¶ added in v1.122.23
func (c Vmstorage) APIV1AdminTSDBSnapshot(t *testing.T) *APIV1AdminTSDBSnapshotResponse
APIV1AdminTSDBSnapshot creates a database snapshot by sending a query to the /api/v1/admin/tsdb/snapshot endpoint.
See https://prometheus.io/docs/prometheus/latest/querying/api/#snapshot.
func (Vmstorage) ForceFlush ¶ added in v1.97.12
ForceFlush is a test helper function that forces the flushing of inserted data, so it becomes available for searching immediately.
func (Vmstorage) ForceMerge ¶ added in v1.102.17
ForceMerge is a test helper function that forces the merging of parts.
func (Vmstorage) GetIntMetric ¶ added in v1.122.23
GetIntMetric retrieves the value of a metric served by an app at /metrics URL. The value is then converted to int.
func (Vmstorage) GetMetric ¶ added in v1.122.23
GetMetric retrieves the value of a metric served by an app at /metrics URL.
func (Vmstorage) GetMetricsByPrefix ¶ added in v1.122.23
GetMetricsByPrefix retrieves the values of all metrics that start with given prefix.
func (Vmstorage) GetMetricsByRegexp ¶ added in v1.122.23
func (Vmstorage) Name ¶ added in v1.97.14
func (app Vmstorage) Name() string
Name returns the application instance name.
func (Vmstorage) SnapshotCreate ¶ added in v1.102.18
func (c Vmstorage) SnapshotCreate(t *testing.T) *SnapshotCreateResponse
SnapshotCreate creates a database snapshot by sending a query to the /snapshot/create endpoint.
func (Vmstorage) SnapshotCreateURL ¶ added in v1.102.23
func (c Vmstorage) SnapshotCreateURL() string
SnapshotCreateURL returns the URL for creating snapshots.
func (Vmstorage) SnapshotDelete ¶ added in v1.102.18
func (c Vmstorage) SnapshotDelete(t *testing.T, snapshotName string) *SnapshotDeleteResponse
SnapshotDelete deletes a snapshot by sending a query to the /snapshot/delete endpoint.
func (Vmstorage) SnapshotDeleteAll ¶ added in v1.102.18
func (c Vmstorage) SnapshotDeleteAll(t *testing.T) *SnapshotDeleteAllResponse
SnapshotDeleteAll deletes all snapshots by sending a query to the /snapshot/delete_all endpoint.
func (Vmstorage) SnapshotList ¶ added in v1.102.18
func (c Vmstorage) SnapshotList(t *testing.T) *SnapshotListResponse
SnapshotList lists existing database snapshots by sending a query to the /snapshot/list endpoint.
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.
type Writer ¶ added in v1.102.20
type Writer interface {
// Prometheus APIs
PrometheusAPIV1Write(t *testing.T, wr prompb.WriteRequest, opts QueryOpts)
PrometheusAPIV1ImportPrometheus(t *testing.T, records []string, opts QueryOpts)
PrometheusAPIV1ImportCSV(t *testing.T, records []string, opts QueryOpts)
PrometheusAPIV1ImportNative(t *testing.T, data []byte, opts QueryOpts)
// Graphit APIs
GraphiteWrite(t *testing.T, records []string, opts QueryOpts)
// OpenTSDB APIs
OpenTSDBAPIPut(t *testing.T, records []string, opts QueryOpts)
}
Writer contains methods for writing new data