Documentation ¶
Index ¶
- func InitStorageNodes(addrs []string, hashSeed uint64)
- func PutInsertCtx(ctx *InsertCtx)
- func Stop()
- type InsertCtx
- func (ctx *InsertCtx) AddLabel(name, value string)
- func (ctx *InsertCtx) AddLabelBytes(name, value []byte)
- func (ctx *InsertCtx) ApplyRelabeling()
- func (ctx *InsertCtx) FlushBufs() error
- func (ctx *InsertCtx) GetStorageNodeIdx(at *auth.Token, labels []prompb.Label) int
- func (ctx *InsertCtx) Reset()
- func (ctx *InsertCtx) SortLabelsIfNeeded()
- func (ctx *InsertCtx) WriteDataPoint(at *auth.Token, labels []prompb.Label, timestamp int64, value float64) error
- func (ctx *InsertCtx) WriteDataPointExt(at *auth.Token, storageNodeIdx int, metricNameRaw []byte, timestamp int64, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitStorageNodes ¶
InitStorageNodes initializes vmstorage nodes' connections to the given addrs.
hashSeed is used for changing the distribution of input time series among addrs.
func PutInsertCtx ¶
func PutInsertCtx(ctx *InsertCtx)
PutInsertCtx returns ctx to the pool.
ctx cannot be used after the call.
Types ¶
type InsertCtx ¶
type InsertCtx struct { Labels sortedLabels MetricNameBuf []byte // contains filtered or unexported fields }
InsertCtx is a generic context for inserting data.
InsertCtx.Reset must be called before the first usage.
func GetInsertCtx ¶
func GetInsertCtx() *InsertCtx
GetInsertCtx returns InsertCtx from the pool.
Call PutInsertCtx for returning it to the pool.
func (*InsertCtx) AddLabel ¶
AddLabel adds (name, value) label to ctx.Labels.
name and value must exist until ctx.Labels is used.
func (*InsertCtx) AddLabelBytes ¶
AddLabelBytes adds (name, value) label to ctx.Labels.
name and value must exist until ctx.Labels is used.
func (*InsertCtx) ApplyRelabeling ¶
func (ctx *InsertCtx) ApplyRelabeling()
ApplyRelabeling applies relabeling to ctx.Labels.
func (*InsertCtx) GetStorageNodeIdx ¶
GetStorageNodeIdx returns storage node index for the given at and labels.
The returned index must be passed to WriteDataPoint.
func (*InsertCtx) SortLabelsIfNeeded ¶
func (ctx *InsertCtx) SortLabelsIfNeeded()
SortLabelsIfNeeded sorts labels if -sortLabels command-line flag is set