netstorage

package
v1.40.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

Index

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 GetLabelEntries added in v1.19.0

func GetLabelEntries(deadline Deadline) ([]storage.TagEntry, error)

GetLabelEntries returns all the label entries until the given deadline.

func GetLabelValues

func GetLabelValues(labelName string, deadline Deadline) ([]string, error)

GetLabelValues returns label values for the given labelName until the given deadline.

func GetLabels

func GetLabels(deadline Deadline) ([]string, error)

GetLabels returns labels until the given deadline.

func GetSeriesCount

func GetSeriesCount(deadline Deadline) (uint64, error)

GetSeriesCount returns the number of unique series.

func GetTSDBStatusForDate added in v1.35.0

func GetTSDBStatusForDate(deadline Deadline, date uint64, topN int) (*storage.TSDBStatus, error)

GetTSDBStatusForDate returns tsdb status according to https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-stats

Types

type Deadline

type Deadline struct {
	// contains filtered or unexported fields
}

Deadline contains deadline with the corresponding timeout for pretty error messages.

func NewDeadline

func NewDeadline(startTime time.Time, timeout time.Duration, flagHint string) Deadline

NewDeadline returns deadline for the given timeout.

flagHint must contain a hit for command-line flag, which could be used in order to increase timeout.

func (*Deadline) Exceeded added in v1.39.0

func (d *Deadline) Exceeded() bool

Exceeded returns true if deadline is exceeded.

func (*Deadline) String added in v1.32.7

func (d *Deadline) String() string

String returns human-readable string representation for d.

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 Deadline) (*Results, error)

ProcessSearchQuery performs sq on storage nodes until the given deadline.

Results.RunParallel or Results.Cancel must be called on the returned Results.

func (*Results) Cancel

func (rss *Results) Cancel()

Cancel cancels rss work.

func (*Results) Len

func (rss *Results) Len() int

Len returns the number of results in rss.

func (*Results) RunParallel

func (rss *Results) RunParallel(f func(rs *Result, workerID uint)) error

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.

rss becomes unusable after the call to RunParallel.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL