vmstorage

package
v1.47.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: Apache-2.0 Imports: 15 Imported by: 5

README

vmstorage performs the following tasks:

  • Accepts inserts from vminsert and stores them to local storage.

  • Performs select requests from vmselect.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DataPath is a path to storage data.
	DataPath = flag.String("storageDataPath", "victoria-metrics-data", "Path to storage data")
)
View Source
var Storage *storage.Storage

Storage is a storage.

Every storage call must be wrapped into WG.Add(1) ... WG.Done() for proper graceful shutdown when Stop is called.

WG must be incremented before Storage call.

Use syncwg instead of sync, since Add is called from concurrent goroutines.

Functions

func AddRows

func AddRows(mrs []storage.MetricRow) error

AddRows adds mrs to the storage.

func CheckTimeRange added in v1.37.4

func CheckTimeRange(tr storage.TimeRange) error

CheckTimeRange returns true if the given tr is denied for querying.

func DeleteMetrics

func DeleteMetrics(tfss []*storage.TagFilters) (int, error)

DeleteMetrics deletes metrics matching tfss.

Returns the number of deleted metrics.

func GetSeriesCount

func GetSeriesCount(deadline uint64) (uint64, error)

GetSeriesCount returns the number of time series in the storage.

func GetTSDBStatusForDate added in v1.35.0

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

GetTSDBStatusForDate returns TSDB status for the given date.

func Init

func Init()

Init initializes vmstorage.

func InitWithoutMetrics added in v1.22.0

func InitWithoutMetrics()

InitWithoutMetrics must be called instead of Init inside tests.

This allows multiple Init / Stop cycles.

func RegisterMetricNames added in v1.47.0

func RegisterMetricNames(mrs []storage.MetricRow) error

RegisterMetricNames registers all the metrics from mrs in the storage.

func RequestHandler

func RequestHandler(w http.ResponseWriter, r *http.Request) bool

RequestHandler is a storage request handler.

func SearchMetricNames added in v1.47.0

func SearchMetricNames(tfss []*storage.TagFilters, tr storage.TimeRange, maxMetrics int, deadline uint64) ([]storage.MetricName, error)

SearchMetricNames returns metric names for the given tfss on the given tr.

func SearchTagEntries added in v1.19.0

func SearchTagEntries(maxTagKeys, maxTagValues int, deadline uint64) ([]storage.TagEntry, error)

SearchTagEntries searches for tag entries.

func SearchTagKeys

func SearchTagKeys(maxTagKeys int, deadline uint64) ([]string, error)

SearchTagKeys searches for tag keys

func SearchTagKeysOnTimeRange added in v1.46.0

func SearchTagKeysOnTimeRange(tr storage.TimeRange, maxTagKeys int, deadline uint64) ([]string, error)

SearchTagKeysOnTimeRange searches for tag keys on tr.

func SearchTagValueSuffixes added in v1.41.0

func SearchTagValueSuffixes(tr storage.TimeRange, tagKey, tagValuePrefix []byte, delimiter byte, maxTagValueSuffixes int, deadline uint64) ([]string, error)

SearchTagValueSuffixes returns all the tag value suffixes for the given tagKey and tagValuePrefix on the given tr.

This allows implementing https://graphite-api.readthedocs.io/en/latest/api.html#metrics-find or similar APIs.

func SearchTagValues

func SearchTagValues(tagKey []byte, maxTagValues int, deadline uint64) ([]string, error)

SearchTagValues searches for tag values for the given tagKey

func SearchTagValuesOnTimeRange added in v1.46.0

func SearchTagValuesOnTimeRange(tagKey []byte, tr storage.TimeRange, maxTagValues int, deadline uint64) ([]string, error)

SearchTagValuesOnTimeRange searches for tag values for the given tagKey on tr.

func Stop

func Stop()

Stop stops the vmstorage

Types

This section is empty.

Jump to

Keyboard shortcuts

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