Documentation ¶
Index ¶
- func InitStorageNodes(addrs []string)
- func PutInsertCtx(ctx *InsertCtx)
- func Stop()
- type InsertCtx
- func (ctx *InsertCtx) AddLabel(name, value []byte)
- func (ctx *InsertCtx) FlushBufs() error
- func (ctx *InsertCtx) GetStorageNodeIdx(labels []storage.Label) int
- func (ctx *InsertCtx) Reset()
- func (ctx *InsertCtx) WriteDataPoint(labels []storage.Label, timestamp int64, value []byte) error
- func (ctx *InsertCtx) WriteDataPointExt(storageNodeIdx int, metricNameRaw []byte, timestamp int64, value []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitStorageNodes ¶
func InitStorageNodes(addrs []string)
InitStorageNodes initializes vmstorage nodes' connections to the given 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 []storage.Label 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) GetStorageNodeIdx ¶
GetStorageNodeIdx returns storage node index for the given at and labels.
The returned index must be passed to WriteDataPoint.
func (*InsertCtx) WriteDataPoint ¶
WriteDataPoint writes (timestamp, value) data point with the given at and labels to ctx buffer.