Documentation ¶
Index ¶
- func DeleteSeries(sq *storage.SearchQuery) (int, error)
- func ExportBlocks(sq *storage.SearchQuery, deadline searchutils.Deadline, ...) error
- func GetLabelEntries(deadline searchutils.Deadline) ([]storage.TagEntry, error)
- func GetLabelValues(labelName string, deadline searchutils.Deadline) ([]string, error)
- func GetLabels(deadline searchutils.Deadline) ([]string, error)
- func GetSeriesCount(deadline searchutils.Deadline) (uint64, error)
- func GetTSDBStatusForDate(deadline searchutils.Deadline, date uint64, topN int) (*storage.TSDBStatus, error)
- func GetTagValueSuffixes(tr storage.TimeRange, tagKey, tagValuePrefix string, delimiter byte, ...) ([]string, error)
- type Result
- type Results
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteSeries ¶
func DeleteSeries(sq *storage.SearchQuery) (int, error)
DeleteSeries deletes time series matching the given tagFilterss.
func ExportBlocks ¶ added in v1.42.0
func ExportBlocks(sq *storage.SearchQuery, deadline searchutils.Deadline, f func(mn *storage.MetricName, b *storage.Block, tr storage.TimeRange) error) error
ExportBlocks searches for time series matching sq and calls f for each found block.
f is called in parallel from multiple goroutines. Data processing is immediately stopped if f returns non-nil error. It is the responsibility of f to call b.UnmarshalData before reading timestamps and values from the block. It is the responsibility of f to filter blocks according to the given tr.
func GetLabelEntries ¶ added in v1.19.0
func GetLabelEntries(deadline searchutils.Deadline) ([]storage.TagEntry, error)
GetLabelEntries returns all the label entries until the given deadline.
func GetLabelValues ¶
func GetLabelValues(labelName string, deadline searchutils.Deadline) ([]string, error)
GetLabelValues returns label values for the given labelName until the given deadline.
func GetLabels ¶
func GetLabels(deadline searchutils.Deadline) ([]string, error)
GetLabels returns labels until the given deadline.
func GetSeriesCount ¶
func GetSeriesCount(deadline searchutils.Deadline) (uint64, error)
GetSeriesCount returns the number of unique series.
func GetTSDBStatusForDate ¶ added in v1.35.0
func GetTSDBStatusForDate(deadline searchutils.Deadline, date uint64, topN int) (*storage.TSDBStatus, error)
GetTSDBStatusForDate returns tsdb status according to https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-stats
func GetTagValueSuffixes ¶ added in v1.41.0
func GetTagValueSuffixes(tr storage.TimeRange, tagKey, tagValuePrefix string, delimiter byte, deadline searchutils.Deadline) ([]string, error)
GetTagValueSuffixes returns tag value suffixes for the given tagKey and the given tagValuePrefix.
It can be used for implementing https://graphite-api.readthedocs.io/en/latest/api.html#metrics-find
Types ¶
type Result ¶
type Result struct { // The name of the metric. MetricName storage.MetricName // Values are sorted by Timestamps. Values []float64 Timestamps []int64 // Marshaled MetricName. Used only for results sorting // in app/vmselect/promql MetricNameMarshaled []byte }
Result is a single timeseries result.
ProcessSearchQuery returns Result slice.
type Results ¶
type Results struct {
// contains filtered or unexported fields
}
Results holds results returned from ProcessSearchQuery.
func ProcessSearchQuery ¶
func ProcessSearchQuery(sq *storage.SearchQuery, fetchData bool, deadline searchutils.Deadline) (*Results, error)
ProcessSearchQuery performs sq until the given deadline.
Results.RunParallel or Results.Cancel must be called on the returned Results.
func (*Results) RunParallel ¶
RunParallel runs f in parallel for all the results from rss.
f shouldn't hold references to rs after returning. workerID is the id of the worker goroutine that calls f. Data processing is immediately stopped if f returns non-nil error.
rss becomes unusable after the call to RunParallel.