vmstorage

package
v1.87.5 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: Apache-2.0 Imports: 18 Imported by: 6

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.

The caller should limit the number of concurrent calls to AddRows() in order to limit memory usage.

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 DeleteSeries added in v1.79.0

func DeleteSeries(qt *querytracer.Tracer, tfss []*storage.TagFilters) (int, error)

DeleteSeries deletes series matching tfss.

Returns the number of deleted series.

func GetSeriesCount

func GetSeriesCount(deadline uint64) (uint64, error)

GetSeriesCount returns the number of time series in the storage.

func GetTSDBStatus added in v1.78.0

func GetTSDBStatus(qt *querytracer.Tracer, tfss []*storage.TagFilters, date uint64, focusLabel string, topN, maxMetrics int, deadline uint64) (*storage.TSDBStatus, error)

GetTSDBStatus returns TSDB status for given filters on the given date.

func Init

func Init(resetCacheIfNeeded func(mrs []storage.MetricRow))

Init initializes vmstorage.

func RegisterMetricNames added in v1.47.0

func RegisterMetricNames(qt *querytracer.Tracer, 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 SearchGraphitePaths added in v1.53.0

func SearchGraphitePaths(qt *querytracer.Tracer, tr storage.TimeRange, query []byte, maxPaths int, deadline uint64) ([]string, error)

SearchGraphitePaths returns all the metric names matching the given Graphite query.

func SearchLabelNamesWithFiltersOnTimeRange added in v1.78.0

func SearchLabelNamesWithFiltersOnTimeRange(qt *querytracer.Tracer, tfss []*storage.TagFilters, tr storage.TimeRange, maxTagKeys, maxMetrics int, deadline uint64) ([]string, error)

SearchLabelNamesWithFiltersOnTimeRange searches for tag keys matching the given tfss on tr.

func SearchLabelValuesWithFiltersOnTimeRange added in v1.78.0

func SearchLabelValuesWithFiltersOnTimeRange(qt *querytracer.Tracer, labelName string, tfss []*storage.TagFilters,
	tr storage.TimeRange, maxLabelValues, maxMetrics int, deadline uint64) ([]string, error)

SearchLabelValuesWithFiltersOnTimeRange searches for label values for the given labelName, tfss and tr.

func SearchMetricNames added in v1.47.0

func SearchMetricNames(qt *querytracer.Tracer, tfss []*storage.TagFilters, tr storage.TimeRange, maxMetrics int, deadline uint64) ([]string, error)

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

func SearchTagValueSuffixes added in v1.41.0

func SearchTagValueSuffixes(qt *querytracer.Tracer, tr storage.TimeRange, tagKey, tagValuePrefix string, 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 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