Documentation ¶
Overview ¶
Package write provides the Point struct
Index ¶
- func PointToLineProtocol(p *Point, precision time.Duration) string
- func PointToLineProtocolBuffer(p *Point, sb *strings.Builder, precision time.Duration)
- type Options
- func (o *Options) AddDefaultTag(key, value string) *Options
- func (o *Options) BatchSize() uint
- func (o *Options) DefaultTags() map[string]string
- func (o *Options) FlushInterval() uint
- func (o *Options) MaxRetries() uint
- func (o *Options) Precision() time.Duration
- func (o *Options) RetryBufferLimit() uint
- func (o *Options) RetryInterval() uint
- func (o *Options) SetBatchSize(batchSize uint) *Options
- func (o *Options) SetFlushInterval(flushIntervalMs uint) *Options
- func (o *Options) SetMaxRetries(maxRetries uint) *Options
- func (o *Options) SetPrecision(precision time.Duration) *Options
- func (o *Options) SetRetryBufferLimit(retryBufferLimit uint) *Options
- func (o *Options) SetRetryInterval(retryIntervalMs uint) *Options
- func (o *Options) SetUseGZip(useGZip bool) *Options
- func (o *Options) UseGZip() bool
- type Point
- func (m *Point) AddField(k string, v interface{}) *Point
- func (m *Point) AddTag(k, v string) *Point
- func (m *Point) FieldList() []*lp.Field
- func (m *Point) Name() string
- func (m *Point) SetTime(timestamp time.Time) *Point
- func (m *Point) SortFields() *Point
- func (m *Point) SortTags() *Point
- func (m *Point) TagList() []*lp.Tag
- func (m *Point) Time() time.Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PointToLineProtocol ¶
PointToLineProtocol creates InfluxDB line protocol string from the Point, converting associated timestamp according to precision
Types ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options holds write configuration properties
func DefaultOptions ¶
func DefaultOptions() *Options
DefaultOptions returns Options object with default values
func (*Options) AddDefaultTag ¶ added in v1.3.0
AddDefaultTag adds a default tag. DefaultTags are added to each written point. If a tag with the same key already exist it is overwritten. If a point already defines such a tag, it is left unchanged.
func (*Options) DefaultTags ¶ added in v1.3.0
DefaultTags returns set of default tags
func (*Options) FlushInterval ¶
FlushInterval returns flush interval in ms
func (*Options) MaxRetries ¶
MaxRetries returns maximum count of retry attempts of failed writes
func (*Options) RetryBufferLimit ¶
RetryBufferLimit returns retry buffer limit
func (*Options) RetryInterval ¶
RetryInterval returns the retry interval in ms
func (*Options) SetBatchSize ¶
SetBatchSize sets number of points sent in single request
func (*Options) SetFlushInterval ¶
SetFlushInterval sets flush interval in ms in which is buffer flushed if it has not been already written
func (*Options) SetMaxRetries ¶
SetMaxRetries sets maximum count of retry attempts of failed writes
func (*Options) SetPrecision ¶
SetPrecision sets time precision to use in writes for timestamp. In unit of duration: time.Nanosecond, time.Microsecond, time.Millisecond, time.Second
func (*Options) SetRetryBufferLimit ¶
SetRetryBufferLimit sets maximum number of points to keep for retry. Should be multiple of BatchSize.
func (*Options) SetRetryInterval ¶
SetRetryInterval sets retry interval in ms, which is set if not sent by server
func (*Options) SetUseGZip ¶
SetUseGZip specifies whether to use GZip compression in write requests.
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
Point is represents InfluxDB time series point, holding tags and fields
func NewPoint ¶
func NewPoint( measurement string, tags map[string]string, fields map[string]interface{}, ts time.Time, ) *Point
NewPoint creates a Point from measurement name, tags, fields and a timestamp.
func NewPointWithMeasurement ¶
NewPointWithMeasurement creates a empty Point Use AddTag and AddField to fill point with data
func (*Point) SortFields ¶
SortFields orders the fields of a point alphanumerically by key.
func (*Point) SortTags ¶
SortTags orders the tags of a point alphanumerically by key. This is just here as a helper, to make it easy to keep tags sorted if you are creating a Point manually.