netstorage

package
v1.40.0-cluster Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteSeries

func DeleteSeries(at *auth.Token, sq *storage.SearchQuery, deadline Deadline) (int, error)

DeleteSeries deletes time series matching the given sq.

func GetLabelEntries added in v1.19.0

func GetLabelEntries(at *auth.Token, deadline Deadline) ([]storage.TagEntry, bool, error)

GetLabelEntries returns all the label entries for at until the given deadline.

func GetLabelValues

func GetLabelValues(at *auth.Token, labelName string, deadline Deadline) ([]string, bool, error)

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

func GetLabels

func GetLabels(at *auth.Token, deadline Deadline) ([]string, bool, error)

GetLabels returns labels until the given deadline.

func GetSeriesCount

func GetSeriesCount(at *auth.Token, deadline Deadline) (uint64, bool, error)

GetSeriesCount returns the number of unique series for the given at.

func GetTSDBStatusForDate added in v1.35.0

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

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

func InitStorageNodes

func InitStorageNodes(addrs []string)

InitStorageNodes initializes storage nodes' connections to the given addrs.

func InitTmpBlocksDir

func InitTmpBlocksDir(tmpDirPath string)

InitTmpBlocksDir initializes directory to store temporary search results.

It stores data in system-defined temporary directory if tmpDirPath is empty.

func Stop

func Stop()

Stop gracefully stops netstorage.

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(at *auth.Token, sq *storage.SearchQuery, fetchData bool, deadline Deadline) (*Results, bool, error)

ProcessSearchQuery performs sq on storage nodes until the given deadline.

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