Documentation ¶
Index ¶
- Variables
- func AddRows(mrs []storage.MetricRow) error
- func CheckTimeRange(tr storage.TimeRange) error
- func DeleteSeries(qt *querytracer.Tracer, tfss []*storage.TagFilters) (int, error)
- func GetSeriesCount(deadline uint64) (uint64, error)
- func GetTSDBStatus(qt *querytracer.Tracer, tfss []*storage.TagFilters, date uint64, ...) (*storage.TSDBStatus, error)
- func Init(resetCacheIfNeeded func(mrs []storage.MetricRow))
- func RegisterMetricNames(qt *querytracer.Tracer, mrs []storage.MetricRow) error
- func RequestHandler(w http.ResponseWriter, r *http.Request) bool
- func SearchGraphitePaths(qt *querytracer.Tracer, tr storage.TimeRange, query []byte, maxPaths int, ...) ([]string, error)
- func SearchLabelNamesWithFiltersOnTimeRange(qt *querytracer.Tracer, tfss []*storage.TagFilters, tr storage.TimeRange, ...) ([]string, error)
- func SearchLabelValuesWithFiltersOnTimeRange(qt *querytracer.Tracer, labelName string, tfss []*storage.TagFilters, ...) ([]string, error)
- func SearchMetricNames(qt *querytracer.Tracer, tfss []*storage.TagFilters, tr storage.TimeRange, ...) ([]string, error)
- func SearchTagValueSuffixes(qt *querytracer.Tracer, tr storage.TimeRange, tagKey, tagValuePrefix string, ...) ([]string, error)
- func Stop()
Constants ¶
This section is empty.
Variables ¶
var ( // DataPath is a path to storage data. DataPath = flag.String("storageDataPath", "victoria-metrics-data", "Path to storage data") )
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.
var WG syncwg.WaitGroup
WG must be incremented before Storage call.
Use syncwg instead of sync, since Add is called from concurrent goroutines.
Functions ¶
func AddRows ¶
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
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 ¶
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 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.
Types ¶
This section is empty.