Documentation
¶
Index ¶
- Variables
- func AddRow(metricNameRaw []byte, timestamp int64, value float64) error
- func AddRows(mrs []storage.MetricRow) error
- func GetSeriesCount() (uint64, error)
- func Init()
- func MaxWorkers() int
- func OutputTimeseriesCoverage(mns []string, funcNames []string)
- func RegisterMetricNameFuncName(mn *storage.MetricName, funcName string, window int64, item_window int64) error
- func SearchAndUpdateWindowMetricNameFuncName(mn *storage.MetricName, funcName string, window int64) bool
- func Stop()
- type SketchResult
- type SketchResults
Constants ¶
This section is empty.
Variables ¶
var SketchCache *promsketch.VMSketches
SketchCache is a rollup cache with sketches.
Every sketch 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 sketch cache.
The caller should limit the number of concurrent calls to AddRows() in order to limit memory usage.
func GetSeriesCount ¶
GetSeriesCount returns the number of time series in the storage.
func MaxWorkers ¶
func MaxWorkers() int
MaxWorkers returns the maximum number of concurrent goroutines, which can be used by RunParallel()
func RegisterMetricNameFuncName ¶
func RegisterMetricNameFuncName(mn *storage.MetricName, funcName string, window int64, item_window int64) error
RegisterMetricNames registers all the metrics from mrs in the storage.
func SearchAndUpdateWindowMetricNameFuncName ¶
func SearchAndUpdateWindowMetricNameFuncName(mn *storage.MetricName, funcName string, window int64) bool
SearchMetricNames returns metric names for the given tfss on the given tr.
Types ¶
type SketchResult ¶
type SketchResult struct {
MetricName *storage.MetricName
// contains filtered or unexported fields
}
Result is a single timeseries result.
Search returns Result slice.
func (*SketchResult) Eval ¶
func (sr *SketchResult) Eval(mn *storage.MetricName, funcName string, args []float64, mint, maxt, cur_time int64) float64
type SketchResults ¶
type SketchResults struct {
// contains filtered or unexported fields
}
Results holds results returned from ProcessSearchQuery.
func SearchTimeSeriesCoverage ¶
func SearchTimeSeriesCoverage(start, end int64, mns []string, funcNames []string, maxMetrics int, deadline searchutils.Deadline) (*SketchResults, bool, error)
func (*SketchResults) Len ¶
func (srs *SketchResults) Len() int
Len returns the number of results in srs.
func (*SketchResults) RunParallel ¶
func (srs *SketchResults) RunParallel(qt *querytracer.Tracer, f func(sr *SketchResult, workerID uint) error) error
RunParallel runs f in parallel for all the results from srs.
f shouldn't hold references to rs after returning. workerID is the id of the worker goroutine that calls f. The workerID is in the range [0..MaxWorkers()-1]. Data processing is immediately stopped if f returns non-nil error.
srs becomes unusable after the call to RunParallel.